I got these two errors when I compiled, but everything else worked! |
"My car won't start, but everything else about it works!"
Okay. I'm really sorry about that. That is, however, how it comes across. When you get a compilation error, that means that there's something wrong with the written code such that the compiler cannot translate your code into an executable program, not even one that works incorrectly. That really is like your car not being able to start. It may be a simple issue or it may be something more fundamental, but the end result is that you don't have a working car.
That said, there is quite a lot of work that needs to be done here still. Here's the comprehensive list, in no particular order.
For one, line 48 in your main function is a declaration, not a call to the constructor. If you want to avoid making this sort of mistake again and you're set up to use C++11 or later, you can swap the (parentheses) for {curly braces} on that line. If your prof doesn't allow it, then your prof needs a lecture.
Your while loops do not test for negative scores.
grade in your main function never gets set, so on line 53 you're just going to print out nothing in place of an empty grade. It won't result in a crash, but this definitely isn't what you wanted.
Your constructor declared on line 21 of the header takes a bunch of arguments and uses none of them. EDIT: Except the parameter called CL, which shadows the data member also called CL. I'm guessing that wasn't intentional.
addScore takes a bunch of arguments and uses none of them (EDIT: Except for CL, again), yet it's called without any arguments on line 50 in your main function. Either it needs to take arguments, or your constructor needs to set the data members correctly.
findGrade takes a bunch of arguments that end up shadowing your data members, preventing that member function from working correctly. It too is called without arguments. Also, what happens if someone gets a score of 95, 79, or 50?
I don't know if you're expected to do this or not, but as a heads up,
using namespace std
in a header is especially bad practice. If there's nothing you can do about that, I'm really sorry to hear that. Make that two lectures your prof needs.
-Albatross
EDIT2: Lengthened the preface just to be clear about my intentions with that first line.