First, thank you for the response!
I see what you are saying about global vs local variables. I actually removed all of those initializers from GradeBook.cpp and Lab2.cpp, and I received the same results, which leads me to believe that they were extraneous. Unfortunately, those results still do not include the lab or quiz averages. When I plug in 100 for all the grades, which should yield me a final result of 102 final semester grade (given the extra credit is worth an additional 2%) and a letter grade of A, I get:
Average Lab Grade: 0.00
Average Quiz Grade: -0.00
Midterm Grade: 100.00
Final Grade: 100.00
Extra Credit Grade: 100.00
Final Semester Grade: 42.00
Final Letter Grade: F
Given that it's calculating the grade with a 0 average for the labs and quizzes, the 42.00 final grade is correct. But I still do not understand why it does not calculate the averages correctly. Do you have anymore hints or advice to offer?
PS: I do actually use:
1 2 3 4 5
|
void GradeBook::setFinalGrade(double grade)
{
cout << "Enter final grade: ";
cin >> finalGrade;
}
|
It's the function that asks the user for the final exam grade. I would rather have named it setFinalExamGrade to avoid confusion, but the names of the functions were not up to me in this exercise.