Assignment 4 for OOP in C++