C++ Code I wrote while in school