Assignment: You are to create one variable to keep track of five grades which will be input by the user. You should also have another variable which calculates and holds the sum of these five grades, and an average/max/min variable each to hold the average/max/min of the five grades.
*******When I run the program, it comes out like so:
Enter a number: 5
enter a number: enter a number: enter a number: enter a number:
*******I checked the code and I don't know how to fix it.
#include<iostream>
usingnamespace std;
int main()
{
double sum, max, min, avg;
double number;
int N=5; //N is the number to be inpute
cout << "\nEnter a number: ";
cin >> number;
sum = number;
max = number;
min = number;
for (int i = 2; i <= N; i++) //loop
{
cout<<"enter a number: ";
sum = sum + number;
if (max < number) max = number;
if (min > number) min = number;
} // end of loop
avg = sum/N; //display the results sum, max...
cout <<"\nsum is:" << sum <<"\nmax is:" << max;
cout <<"\nmin is:" << min;
cout<< "\naverage is:" << avg;
}