Assignment 5 of c++