Question: Prompt the user to repeatedly enter an integer. Stop when the user enters 'q' and display the sum, the minimum, the maximum and the average

Prompt the user to repeatedly enter an integer. Stop when the user enters 'q' and display the sum, the minimum, the maximum and the average of all the numbers entered.

Refer to the sample interactions below.

Example I: Enter an integer. You entered  

Example I: Enter an integer. You entered "q". Example II: Enter an integer. Enter an integer. Enter an integer. Enter an integer. Enter an integer. Enter "q" to stop: q Exiting the program. Enter "q" to stop: 4 Enter "q" to stop: 8 Enter "q" to stop: 19 Enter "q" to stop: 23 Enter "q" to stop: q You entered 4 integers. The sum of all the integers you entered is 54. The average is 13.50. The largest integer entered is 23. The smallest integer entered is 4.

Step by Step Solution

3.42 Rating (171 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Code def calculatestatisticsnumbers numcount lennumbers totalsum sumnumbers average totalsum numcount minimum minnumbers maximum maxnumbers printfYou entered numcount integer if numcount 1 else intege... View full answer

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 Programming Questions!