Suppose I have a class called Student with private member variables and public member functions. There are two functions, a set and get function to retrieve the total test score. The segment of code where I need assistance is below,
1 2 3 4 5 6 7 8 9 10 11 12
#include <iostream>
usingnamespace std;
class Student{
private:
double testOne;
double testTwo;
public:
void setTestScores(); //This function has to calculate the total test score.
double getTestScores();
}
void Cake::setTestScores() //Here is the declaration of the function.
double Cake::getTestScores(){return Total;}
My question is that how would you make it so the getTestScores function returns the total using the calculation from the setTestScores function?