I am less than a beginner in c++ and am taking a college course, an online course at that. The teacher is knowledgeable about c++, but I don't think he is so great at teaching it, or maybe I am just bad at learning it. He gave us some code and we were supposed to come up with the rest to write a win32 console program using visual studio 2008. The program is supposed to take the points a student received on a test, the points possible, and calculate the percentage or score. Here is the code I have, but it is always returning 0.0.
You don't take the result form 'CalcPercentage()'. Like so:
1 2 3 4 5 6 7 8 9 10 11 12
void main()
{
double earned = 0.0;
double possible = 0.0;
double percent = 0.0;
ReadTestInfo(earned, possible); //Enter code to call the function ReadTestInfo
percent = CalcPercentage(earned, possible); //Enter code to call the function CalcPercentage
PrintPercentage(percent);//Enter code to call the function PrintPercentage
}