HW2 of C++ Programming Class