Cpp homework