Code from a C++ course I am taking. Assignment work.