Exercise while reading "C++ program design"