Question: Q 2 Write a program and draw a flow chart to ask the user for repeated input by writing the input statements repeating multiple times.
Q Write a program and draw a flow chart to ask the user for repeated input by writing the input statements repeating multiple times. But it's more efficient to use loops to deal with repeated input.
Write a program that prompts the user for five numbers and computes the total of the numbers.
Example Output
Enter a number.
Enter a number:
Enter a number.
Enter a number:
Enter a number.
The total is
Constraints
The prompting must use repetition, such as a counted loop, not three separate prompts.
Create a flowchart before writing the program.
Chalienges
Modify the program to prompt for how many numbers to add, instead of hardcoding the value. Be sure you convert the input to a number before doing the comparison.
Modify the program so that it only adds numbers and sitently rejects nonnumeric values. Count these invalid entries as attempts anyway. In other words if the number of numbers to add is : vous program should still prompt only five times
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
