User menu w/options

This is homework so I am not trying to get answers I am just hoping you guys can guide me to the correct path.

Write a program that presents the user with a menu. Option 1 allows the user to enter grades from the keyboard until a negative value is entered. Option 2 displays the mean (average) for the grades. Option 3 displays the standard deviation for the grades. Use the following formula: sdx=sqrt((sumx2-(sumx*sumx)/n)/(n-1)); Option 4 displays the high and low grades. And my personal favorite, option 5, allows the user to end the program.

It doesn't look like you did any kind of aritmatic for the grades. In option two you just wrote cout<<total, which with the code above is an empty variable. you stored the grades in grades in option 1.

Sorry I meant to erase that I am trying to figure out how to get the mean from the 1st choice I know it's the sum / by the total of numbers like if put in grades; 40, 30, 20 I would do 90/3 but I don't know how to do that in the while loop.

Ohh my bad. The way it seems that this is set up is that it keeps looping back to the begining of the variable so it keeps over writing it. One thing that you could do is have a variable that it keeps looping through like you have but also have another variable outside of the loop and have something like

amount = amount + grades;

you have the while loop loop through the variable grades so that you can insert numbers into that then it spits them out into amount.

Choice 3 nothing yet I am trying to figure out the standard deviation. This is my 3rd I think it's an online class and the teacher isn't very helpful so I've had to either learn it from the book or just figure it out on my own so I've been struggling a little.