Homework for c++