Assignment 5 for OOP in C++