C++ programming foundation (first edition) problem answer