23.4.9. Class BalanceInquiry

Class BalanceInquiry (Figs. 23.3023.31) derives from abstract base class Transaction and represents a balanceinquiry ATM transaction. BalanceInquiry does not have any data members of its own, but it inherits Transaction data members accountNumber, screen and bankDatabase, which are accessible through Transaction’s public get functions. Line 6 #includes the definition of base class Transaction. The BalanceInquiry constructor (declared in line 11 of Fig. 23.30 and defined in lines 8–13 of Fig. 23.31) takes arguments corresponding to the Transaction data members and simply forwards them to Transaction’s constructor, using base-class initializer syntax (line 10 of Fig. 23.31). Line 12 of Fig. 23.30 contains the function ...

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.