J.11. Class Withdrawal

Class Withdrawal (Fig. J.10) extends Transaction and represents an ATM withdrawal transaction. This class expands upon the “skeleton” code for this class developed in Fig. 11.22. Recall from the class diagram of Fig. 11.19 that class Withdrawal has one attribute, amount, which line 6 implements as a Decimal instance variable. Fig. 11.19 models associations between class Withdrawal and classes Keypad and CashDispenser, for which lines 7–8 implement reference attributes keypadHandle and dispenserHandle, respectively. Line 11 declares a constant corresponding to the cancel menu option. We will soon discuss how the class uses this constant.

Figure J.10. Class Withdrawal represents an ATM withdrawal transaction.
					1
					' Withdrawal.vb ...

Get Visual Basic 2005 for Programmers: Deitel Developer Series, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.