Question: Write a program that will determine the minimum number and sum of all the numbers entered by the user that are greater than 2 0

Write a program that will determine the minimum number and sum of all the numbers entered by the user that are greater than 20. Create a priming read to prompt the user to enter a number or 0 to quit. Create a sentinel value while loop that continuously prompts the user to enter a number or 0 to quit. In the loop you should determine if the number entered is greater than 20. If it is you should determine if it is the minimum value, and sum the number. When the user enters 0 the program should stop and print out the minimum number and the sum. Your output should match the sample runs below, including labels. User input is shown in bold:
Sample Run 1:
Enter a number or 0 to quit: 10
Enter a number or 0 to quit: 25
Enter a number or 0 to quit: 5
Enter a number or 0 to quit: 34
Enter a number or 0 to quit: 65
Enter a number or 0 to quit: 21
Enter a number or 0 to quit: 0
The minimum number greater than 20 is: 21
The sum of the numbers greater than 20 is: 145
Sample Run 2:
Enter a number or 0 to quit: 5
Enter a number or 0 to quit: 22
Enter a number or 0 to quit: 98
Enter a number or 0 to quit: 13
Enter a number or 0 to quit: 0
The minimum number greater than 20 is: 22
The sum of the numbers greater than 20 is: 120
Step 2: Modify the program to execute the above code a random number of times(sets). The program would generate a random number between 1 and 5, then prompt the user for numbers until they enter zero. It should then display the minimum and sum of those numbers greater than 20. It should continue doing this for the number of times determined by the random number. User input is shown in bold.
Sample Run 1:
Number of sets to calculate: 3
Enter a number or 0 to quit: 5
Enter a number of 0 to quit: 22
Enter a number of 0 to quit: 98
Enter a number of 0 to quit: 13
Enter a number of 0 to quit: 0
The minimum number greater than 20 is: 22
The sum of the numbers greater than 20 is: 120
Enter a number or 0 to quit: 2
Enter a number of 0 to quit: 3
Enter a number of 0 to quit: 4
Enter a number of 0 to quit: 5
Enter a number of 0 to quit: 6
Enter a number of 0 to quit: 0
The minimum number greater than 20 is: 0
The sum of the numbers greater than 20 is: 0
Enter a number or 0 to quit: 13
Enter a number of 0 to quit: 14
Enter a number of 0 to quit: 0
The minimum number greater than 20 is: 0
The sum of the numbers greater than 20 is: 0

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!