Starting Out with Programming Logic and Design (4th Edition)
4th Edition
ISBN: 9780133985078
Author: Tony Gaddis
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 7, Problem 5MC
The term empty input describes what happens when
- a. the user presses the and then the key
- b. an input operation attempts to read data, but there is no data to read
- c. the user enters 0 when 0 is an invalid value
- d. the user enters any invalid data as input
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
solve in python:
Write a program that receives a series of numbers from the user and allows the user to press the enter key to indicate that he or she is finished providing inputs. After the user presses the enter key, the program should print the sum and average of the numbers. Use while loop and if statements for this assignment.
9
2357 00 0
Input
2
Write a program that repeatedly gets integer input from the user until the value 99999 is entered. The
program must then print the values the user entered alternating between odd and even values
starting with the first odd value as in the examples below. The odd and even values must respectively
be in the order they were entered but the overall output will not necessarily be in the order entered.
8
If more odd or even values were entered, the program should continue to print the remaining values
after all other odd/even values have been printed in the order they were entered.
Note: You must use Queues to solve this problem: an implementation of the Queue class is given -
you do not need to provide your own. You will have the following methods available from the Queue
class: Queue(), enqueue(), .dequeue(), .peek(), len(), and.is_empty().
Note: You must NOT access private data fields of the Queue class, you must NOT create any other
built-in collections (e.g. lists,…
The output after running the code is [0,0,0] but it should be just the number 9.
Chapter 7 Solutions
Starting Out with Programming Logic and Design (4th Edition)
Ch. 7.1 - What does the phrase garbage in, garbage out mean?Ch. 7.1 - Give a general description of the input validation...Ch. 7.2 - Describe the steps that are generally taken when...Ch. 7.2 - Prob. 7.4CPCh. 7.2 - If the input that is read by the priming read is...Ch. 7 - GIGO stands for a. great input, great output b....Ch. 7 - The integrity of a programs output is only as good...Ch. 7 - The input operation that appears just before a...Ch. 7 - Validation loops are also known as a. error traps...Ch. 7 - The term empty input describes what happens when...
Ch. 7 - The process of input validation works like this:...Ch. 7 - The priming read appears inside the validation...Ch. 7 - The approach of using a posttest validation loop...Ch. 7 - What does the phrase garbage in, garbage out mean?Ch. 7 - Give a general description of the input validation...Ch. 7 - Prob. 3SACh. 7 - In this chapter you saw how a posttest loop can be...Ch. 7 - Design an algorithm that prompts the user to enter...Ch. 7 - Design an algorithm that prompts the user to enter...Ch. 7 - Design an algorithm that prompts the user to enter...Ch. 7 - Design an algorithm that prompts the user to enter...Ch. 7 - Design an algorithm that prompts the user to enter...Ch. 7 - Prob. 1DECh. 7 - Why does the following pseudocode not perform as...Ch. 7 - The following pseudocode works, but it performs a...Ch. 7 - Payroll Program with Input Validation Design a...Ch. 7 - Theater Seating Revenue with Input Validation A...Ch. 7 - Fat Gram Calculator Design a program that asks for...Ch. 7 - Speeding Violation Calculator Design a program...Ch. 7 - Rock, Paper, Scissors Modification Programming...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
Write code that will fill the following array a with numbers typed at the keyboard: int [][] a = new int [4][5]...
Java: An Introduction to Problem Solving and Programming (7th Edition)
Software Sales Software companies often offer their customers the option to lease the software yearly or purcha...
Starting Out With Visual Basic (8th Edition)
True or False: When passing an argument to a method, the arguments data type must be compatible with the parame...
Starting Out with Java: Early Objects (6th Edition)
3.12 (Date Create a class called Date that includes three pieces Of information as data
members—a month (type ...
C++ How to Program (10th Edition)
Consider the following program: a. What output does the program produce? b. What output would the program produ...
Java: An Introduction to Problem Solving and Programming (8th Edition)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- (Misc. application) a. Write a program that continuously requests a grade to be entered. If the grade is less than 0 or greater than 100, your program should print an appropriate message informing the user that an invalid grade has been entered; else, the grade should be added to a total. When a grade of 999 is entered, the program should exit the repetition loop and compute and display the average of the valid grades entered. b. Run the program written in Exercise 2a and verify the program by using appropriate test data.arrow_forwardFollow instructionsarrow_forwardThe process of input validation works as follows: when the user of a program enters invalid data, the program should ask the user “Are you sure you meant to enter that?” If the user answers “yes,” the program should accept the data.True or Falsearrow_forward
- -Prompts the user to enter an integer x. Assume without error checking the user enters a positive integer. -The program then will print all the odd integers between 1 and x that are a multiple of 3. Sample: Enter an integer x: 15 3 is a multiple of 3 9 is a multiple of 3 15 is a multiple of 3arrow_forwardamin728 9 Input 3 Write a program that repeatedly gets integer input from the user until the value 99999 is entered. The program must then print the values the user entered alternating between odd and even values starting with the first odd value as in the examples below. The odd and even values must respectively be in the order they were entered but the overall output will not necessarily be in the order entered. 5 If more odd or even values were entered, the program should continue to print the remaining values after all other odd/even values have been printed in the order they were entered. Note: You must use Queues to solve this problem: an implementation of the Queue class is given - you do not need to provide your own. You will have the following methods available from the Queue class: Queue), enqueue(), dequeue(), -peek(), len(), and is_empty(). Note: You must NOT access private data fields of the Queue class, you must NOT create any other built-in collections (e.g. lists,…arrow_forwardInstruction: Create a flowchart and a java program of the problem stated as follows. Create user-defined methods that will perform 4 functionalities of an Automated Teller Machine (Withdraw, Deposit, Transfer, Balance Check) 1. Withdraw (method name: withdraw) * Input the amount to be withdrawn. Compute for the remaining balance after the operation (balance = balance - withdrawn) 2. Deposit (method name: deposit) * Input the amount to be deposited. Compute for the updated balance after the operation (balance = balance + deposit) 3. Transfer (method name: transfer) *Input the acCount number and the amount to be transferred. Compute for the updated balance after the operation (balance = balance - moneySent) 4. Balance Check (method name: balanceCheck) * Display the remaining balance.arrow_forward
- - Java if else if- Use BufferedReaderarrow_forward(1) Prompt the user for a string that contains two strings separated by a comma • Examples of strings that can be accepted: • Jill, Allen • Jill, Allen • Jill, Allen Ex: Enter input string: Jill, Allen (2) Print an error message if the input string does not contain a comma. Continue to prompt until a valid string is entered. Note: If the input contains a comma, then assume that the input also contains two strings Ex: Enter input string: Jill Allen Error: No comma in string. Enter input strings ming Fundamentals home > 9.11: LAB: Warm up: Parsing strings Ex: (3) Extract the two words from the input string and remove any spaces. Store the strings in two separate variables and output the strings. Enter input string: Jill, Allen First word: Jill Second word: Allen (4) Using a loop, extend the program to handle multiple lines of input. Continue until the user enters q to quit Ex: Enter input string: Jill, Allen First word: Jill Second word: Allen 0 Enter input string: Golden Monkey , First…arrow_forwardIn the function XZ̅ + Y, if X is false, Z is false, Y is true then the whole statement is False Unknown Wrong Truearrow_forward
- Write code that prompts the user to enter a positive nonzero number and validates the input.arrow_forward8. Write a program to input 5 numbers from keyboard and find their sum and average. The program should allow user to continue to use the calculator with choice of Y or X to exit. Sample input: Input 5 integer numbers Integer 1: 6 Integer 2: 4 Integer 3: 6 Integer 4: 8 Integer 5: 15 The sum of 5 number is : 39 The Average is : 7.0 Do you want to continue? Press Y to continue Press X to exit Your choice [Y / X] :Y Input 5 integer numbers Integer 1: 5 Integer 2: 9 Integer 3: 15 Integer 4: 23 Integer 5: 45 The sum of 5 number is : 136 The Average is : 27.0 Do you want to continue? Press Y to continue Press X to exit Your choice [Y / X] :arrow_forwardQuestion kan True or False: In a program using blocking Input/Output, the program is put to sleep while waiting for input. True or False: In a program using non-blocking Input/Output, the read() function will wait until data is available and return the data that was read. ....... .Full explain this question and text typing work only We should answer our question within 2 hours takes more time then we will reduce Rating Dont ignore this line ....arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Introduction to Operators in C; Author: Neso Academy;https://www.youtube.com/watch?v=50Pb27JoUrw;License: Standard YouTube License, CC-BY