Java Reference
In-Depth Information
The user enters the customer number on the keypad and presses the A button. The
display message changes to
Enter PIN
A = OK
Next, the user enters the PIN and presses the A button again. If the customer
number and ID match those of one of the customers in the bank, then the customer
can proceed. If not, the user is again prompted to enter the customer number.
If the customer has been authorized to use the system, then the display message
changes to
Select Account
A = Checking
B = Savings
C = Exit
If the user presses the C button, the ATM reverts to its original state and asks the
next user to enter a customer number.
If the user presses the A or B buttons, the ATM remembers the selected account,
and the display message changes to
Balance = balance of selected account
Enter amount and select transaction
A = Withdraw
B = Deposit
C = Cancel
If the user presses the A or B buttons, the value entered in the keypad is withdrawn
from or deposited into the selected account. (This is just a simulation, so no money
is dispensed and no deposit is accepted.) Afterwards, the ATM reverts to the
preceding state, allowing the user to select another account or to exit.
If the user presses the C button, the ATM reverts to the preceding state without
executing any transaction.
557
558
In the text-based interaction, we read input from System.in instead of the
buttons. Here is a typical dialog:
Enter account number: 1
Search WWH ::




Custom Search