Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please answer this in C++ that finds the minimum and maximum of a set of numbers entered by Write a program the user. Your program
Please answer this in C++
that finds the minimum and maximum of a set of numbers entered by Write a program the user. Your program should enter a loop in which it repeatedly asks the user to enter a number. The program should exit the loop if the user enters a 1". While in this loop the program must keep track of the smallest and largest numbers entered by the user. After the user enters a -" the program should output the minimum and maximum. Users may not enter any numbers less than 0 (other than -1 to stop) or greater than Hint: Keep track of the "current"minimum and maximum in separate variables. Each time the user enters a number, you may need to "update" these variables After printing the minimum and maximum, your program should ask the user if they wish to continue by entering yes (y') or no (n'). If they continue, your program should start over, if the user enters 'n', the program In total, you should have two loop structures. (I) an outer loop controlling how many times the user "repeats" the entire program (Do you wish to continue?). (2) an inner loop that allows the user to repeatedly enter in numbers for which you will find the minimum and maximum Here is a sample of the input and output for your program. The user has entered text in red (bold) and the program has printed out text in black should quit. Please enter as many numbers as you like. Enter-1 to stop. >Please enter a number 16 >Please enter a number: 46 >Please enter a number: 19 >Please enter a number: 6 >Please enter a number: 98 > Please enter a number: 56 > Please enter a number:-1 > Maximum: 98 > Minimum: 6 > Do you wish to continue? (y): y > Please enter as many numbers as you like. Enter-1 to stop. >Please enter a number:9 > Please enter a number: 128 > Please enter a number: 18 > Please enter a number: -1 > Maximum: 128 > Minimum: 9 Do you wish to continue? (y): n Goodbye Your program should not accept any numbers less than -1 or greater than 9999 and should warn the user when they enter numbers out of this range. Your program should not exit just warn the user 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