C++ object-oriented fourth chapter