Final exam practice

Remember, the exam will use pencil and paper, NOT Visual Studio! I'd recommend solving these problems with pencil and paper first. Afterwards you can type your code and fix any errors that you made. When solving these, remember to use appropriate comments, const member functions, and so on.


Here are some class-writing practice problems. Each problem gives you a definition of int main(). Your job is to build the necessary class so that my code runs properly. You should NOT need to change the main() code in any way. (Exception: the "Dice" example includes a couple of extra challenges which do require modification of main(). But the first/main part still uses the main() I provided.)

In case you want a hint to get you started, here is one reasonable way to set up the Clock class. You still need to define those functions yourself though!

Solutions: Clock.cpp Car.cpp Dice.cpp