c++ homework