Problem 1 - Min, Mean, Max
Write a program that reads in successive integer values from the user. The user will indicate termination of these values with the sentinel value 0 (zero). After the program has read in the values, the program will output the minimum value entered, the maximum value entered, and the mean (average) of the values entered (to two decimal places). If the user does not enter any numbers before entering 0, the program will display the message "No numbers were read".
Please enter some integers, and a 0 (zero) to terminate:
1 2 3 4 5 0
The minimum number entered was 1
The maximum number entered was 5
The mean of the numbers was 3.00
Press any key to continue . . .
Please enter some integers, and a 0 (zero) to terminate:
1 2 3 4 5 6 7 8 9 10 0
The minimum number entered was 1
The maximum number entered was 10
The mean of the numbers was 5.50
Press any key to continue . . .
Please enter some integers, and a 0 (zero) to terminate:
0
No numbers were read.
Press any key to continue . . .
You may assume that the user enters a valid integer.
okay that is what the assignment isthis is what i have so far and im totally lost
CODE
#include <iostream>
#include <cmath>
using namespace std;
int main ()
{
int number;
cout << "Please enter some integers, and a 0 (zero) to terminate:" <<endl;
cout << endl;
cin >> number;
if (number == 0)
{
cout << endl;
cout << "No numbers were read." << endl;
cout << endl;
}
while (number !=0)
{
int count;
count ++;
}
return 0;
}
edit: added [code] tags ~ jayman9