Enter PIN: 1234
A=Checking, B=Savings, C=Quit: A
A=Deposit, B=Withdrawal, C=Cancel: A
A=Checking, B=Savings, C=Quit: C
In our solution, only the user interface classes are affected by the choice of user
interface. The remainder of the classes can be used for both solutionsȌthey are
decoupled from the user interface.
Because this is a simulation, the ATM does not actually communicate with a bank.
It simply loads a set of customer numbers and PINs from a file. All accounts are
initialized with a zero balance.
12.5.2 CRC Cards
We will again follow the recipe of Section 12.2 and show how to discover classes,
responsibilities, and relationships and how to obtain a detailed design for the ATM
Recall that the first rule for finding classes is ȒLook for nouns in the problem
descriptionȓ. Here is a list of the nouns:
Of course, not all of these nouns will become names of classes, and we may yet
discover the need for classes that aren't in this list, but it is a good start.