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
Transaction (line 9).
1 // Fig. 23.12: Withdrawal.h 2 // Definition of class Withdrawal that represents a withdrawal ...