Here is the project im working on, im having a hard time figuring out an algorithm that will read the minimum and maximum values. Also when i am confused about the end of input signal(cntl+Z). My instructor also tells me that the program should instantly print the output and that i dont have to hit enter once I use it. I think he is completely wrong about this but I am not sure. My program also keeps assigning ^Z a numerical value.
Project description:
Design and implement a C++ program that works as follows.
First read a sequence of integer values. Stop reading values when the user enters the end-of-input signal, which is usually a <Ctrl-D> or <Ctrl-Z> combination on most computers.
Then print the following statistics:
* the total number of values that were entered
* the number of times the value 0 appeared
* the number of positive values
* the number of negative values
* the number of even values
* the number of odd values
* the minimum value
* the maximum value
* the sum of all the values
* the average of all the values (as a floating point number)
* the product of all the values (as a floating point number)
Your program should correctly handle unusual cases such as when all the values are negative, or all the values are positive, or the total number of values entered is 0.
The only library your C++ program may include is <iostream>.
Here is a sample run. The user input is shown in boldface red.
Enter value: 3
Enter value: 6
Enter value: 12
Enter value: -2
Enter value: -5
Enter value: -8
Enter value: 7
Enter value: 1
Enter value: 2
Enter value: 5
Enter value: <Ctrl-Z>
Number of values = 10
Number of zero values = 0
Number of positive values = 7
Number of negative values = 3
Number of even values = 5
Number of odd values = 5
Minimum value = -8
Maximum value = 12
Sum = 21
Average = 2.1
Product = -1209600