work done for the COMP3512 C++ class