Question: Write a C++ program which prompts the user to enter some numbers and finds the minimum, maximum, and count (number) of the entered numbers separately

Write a C++ program which prompts the user to enter some numbers and finds the minimum, maximum, and count (number) of the entered numbers separately for the positive and negative numbers. It then prints out this information in the format shown below. Entering 0 should terminate the input sequence and cause the results to be displayed. Requirements: Name the source file for your program program2.cpp The user can enter numbers with or without a fractional part (e.g. 2 and 6.78 are acceptable input values). The value 0 which is entered to end the input sequence must not be considered as being in the input sequence. The program must work for input sequences which contain numbers that are all positive, all negative, or a mixture of positive and negative. If there are no positive numbers, it mustn't display a minimum and maximum of positive numbers, but must instead give a message as shown in the sample run below. (And similarly if there are no negative numbers.) If the first number entered by the user is zero, the behavior must be as shown below. The prompts and output displayed by the program must be formatted as shown in the sample run below (e.g. blank lines, spacing, numbers with fractions displayed with 3 places after the decimal point). A sample run of your program should look like: Entering 0 will terminate the sequence of input values. Enter a number: 6 Enter a number: 2.3 Enter a number: -4 Enter a number: 98 Enter a number: -4.5 Enter a number: -22 Enter a number: -1.3 Enter a number: 0 There were 3 positive values entered, with minimum 2.300, maximum 98.000. There were 4 negative values entered, with minimum -2.000, maximum -1.300. A sample run showing behavior for zero entered at the start is: Entering 0 will terminate the sequence of input values. Enter a number: 0 No positive numbers were entered. No negative numbers were entered. A sample run showing behavior for only positive numbers entered (only negative has similar behavior): Entering 0 will terminate the sequence of input values. Enter a number: 72 Enter a number: 3.33 Enter a number: 5 Enter a number: 8 Enter a number: 79.1 Enter a number: 0 There were 5 positive values entered, with minimum 3.330, maximum 79.100. No negative numbers were entered
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
