Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I'm getting an error when executing the code DESCRIPTION Write a C++ program that defines the following variables count: initialized to 0; the number of
I'm getting an error when executing the code
DESCRIPTION Write a C++ program that defines the following variables count: initialized to 0; the number of valid numbers that were entered sum: initialized to 0; the sum of the valid numbers that were entered minimum: intialized to 101; the minimum of the valid numbers that were entered maximum: initialized to 0; the maximum of the valid numbers that were entered The program should then use a do-while loop to keep asking the user to enter integers between 1 and 100, an If the entered integer is -1, terminate the loop and display the count of valid integers that were entered, their minimum, their maximum, and their average (a decimal number) in a format similar to the sample outcome below If the entered integer is O, less than -1, or greater than 100, ignore the entered integer, display an error message stating that "Invalid integer; must be between 1 and 100.", and prompt the user to enter an integer again Otherwise, increment count by 1, add the entered integer to sum, assign it to minimum if it is less than minimum, and assign it to maximum if it is greater than maximum. . . The following is a sample outcome Enter an integer between 1 and 100 (-1 to terminate): 45 Enter an integer between 1 and 100 (-1 to terminate): 68Step 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