Implementing the ATM System Design Incorporating Inheritance

We now modify our implementation to incorporate inheritance, using class Withdrawal as an example.

1. If a class A is a generalization of class B, then class B is derived from (and is a specialization of) class A. For example, abstract base class Transaction is a generalization of class Withdrawal. Thus, class Withdrawal is derived from (and is a specialization of) class Transaction. Figure 23.12 contains a portion of class Withdrawal’s header file, in which the class definition indicates the inheritance relationship between Withdrawal and Transaction (line 9).

 1   // Fig. 23.12: Withdrawal.h 2   // Definition of class Withdrawal that represents a withdrawal ...

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.