Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 Create a priming read to prompt the user to enter a number or to quit. Create a sentinel value while loop that continuously prompts the user to enter a number or to quit. In the loop you should determine if the number entered is greater than If it is you should determine if it is the minimum value, and sum the number. When the user enters 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 :
Enter a number or to quit:
Enter a number or to quit:
Enter a number or to quit:
Enter a number or to quit:
Enter a number or to quit:
Enter a number or to quit:
Enter a number or to quit:
The minimum number greater than is:
The sum of the numbers greater than is:
Sample Run :
Enter a number or to quit:
Enter a number or to quit:
Enter a number or to quit:
Enter a number or to quit:
Enter a number or to quit:
The minimum number greater than is:
The sum of the numbers greater than is:
Step : Modify the program to execute the above code a random number of timessets The program would generate a random number between and then prompt the user for numbers until they enter zero. It should then display the minimum and sum of those numbers greater than It should continue doing this for the number of times determined by the random number. User input is shown in bold.
Sample Run :
Number of sets to calculate:
Enter a number or to quit:
Enter a number of to quit:
Enter a number of to quit:
Enter a number of to quit:
Enter a number of to quit:
The minimum number greater than is:
The sum of the numbers greater than is:
Enter a number or to quit:
Enter a number of to quit:
Enter a number of to quit:
Enter a number of to quit:
Enter a number of to quit:
Enter a number of to quit:
The minimum number greater than is:
The sum of the numbers greater than is:
Enter a number or to quit:
Enter a number of to quit:
Enter a number of to quit:
The minimum number greater than is:
The sum of the numbers greater than is:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started