X796: getAverage for Gradebook Class in C++

Consider already having a class called gradebook that manages a student's grades for a class, but you want to define the following member function for it:

double getAverage(); // returns the average of all the current grades

Write the function getAverage, assuming the gradebook stores each grade in the following private member variable:

vector <double> book;

Your Answer:

Feedback

Your feedback will appear here when you check your answer.