c++ code written in cs1400