Answers to Self-Review Exercises

23.1 True. The minus sign () indicates private visibility. We’ve mentioned “friendship” as an exception to private visibility. Friendship is discussed in Chapter 9.

23.2 b.

23.3 The design for class Account yields the header file in Fig. 23.37.

 1   // Fig. 23.37: Account.h 2   // Account class definition. Represents a bank account. 3   #ifndef ACCOUNT_H  4   #define ACCOUNT_H  5  6   class Account 7   { 8   public9      bool validatePIN( int ); // is user-specified PIN correct?10      double getAvailableBalance(); // returns available balance11      double getTotalBalance(); // returns total balance12      void credit( double ); // adds an amount to the Account13      void debit( ...

Get C++11 for Programmers, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.