C++ homework for Software Lab II.