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.

Q2 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. 1
Enter a number: 2
Enter a number. 3
Enter a number: 4
Enter a number. 5
The total is 15.
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 hard-coding 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 non-numeric values. Count these invalid entries as attempts anyway. In other words if the number of numbers to add is 5 : vous program should still prompt only five times
 Q2 Write a program and draw a flow chart to ask

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!