an example of a "for loop"
Code:
length = 2;
for (int i = 0;i < length;++i)
{
cout << i << ' ';
}
Outputs : "0 1 2 "
Experiment with the "for loop" and try to get a grip on it (basically, it's for repeating a task for a certain number of times. in your case, the number of grades the student has. and the task to be performed is the addition of those grades and after the for loop ou have to divide the sum of the grades with the number of the grades to get an avg.
read this:
http://www.intap.net/~drw/cpp/cpp04_03.htm
I am not sure what does the calculateGrade do, but I tink that it should call the calculateAvg function and then return it's calculated average.
gl