Asked by Max
Design a flowchart for a program that prompts the user to enter ten numbers one at a time. After the user
has entered all ten number the program will then print out the total of those ten number and quit.
has entered all ten number the program will then print out the total of those ten number and quit.
Answers
Answered by
Steve
can't draw flowcharts here. However, the logic might look like this:
define n as a 10-number array
sum = 0
i=1
ask for number
assign it to n(i)
add it to the sum
increase i
i <= 10?
yes, go back to ask again
no, print the sum
quit
define n as a 10-number array
sum = 0
i=1
ask for number
assign it to n(i)
add it to the sum
increase i
i <= 10?
yes, go back to ask again
no, print the sum
quit