Java Reference
In-Depth Information
31 System.out.print(
ÐEnter customer
number: Ñ
);
32
int
number = in.nextInt();
33 theATM.setCustomerNumber(number);
34 }
35
else if
(state == ATM.PIN)
36 {
37 System.out.print(
ÐEnter PIN: Ñ
);
38
int
pin = in.nextInt();
39 theATM.selectCustomer(pin);
40 }
41
else if
(state == ATM.ACCOUNT)
42 {
43 System.out.print(
ÐA=Checking,
B=Savings, C=Quit: Ñ
);
44 String command = in.next();
45
if
(command.equalsIgnoreCase(
ÐAÑ
))
46 theATM.selectAccount(ATM.CHECKING);
47
else if
(command.equalsIgnoreCase(
ÐBÑ
))
48 theATM.selectAccount(ATM.SAVINGS);
49
else if
(command.equalsIgnoreCase(
ÐCÑ
))
50 theATM.reset();
51
else
52 System.out.println(
ÐIllegal
input!Ñ
);
53 }
54
else if
(state == ATM.TRANSACT)
55 {
56 System.out.println(
ÐBalance=Ñ
+
theATM.getBalance());
57 System.out.print(
ÐA=Deposit,
B=Withdrawal, C=Cancel: Ñ
);
58 String command = in.next();
59
if
(command.equalsIgnoreCase(
ÐAÑ
))
60 {
61 System.out.print(
ÐAmount: Ñ
);
62
double
amount =
in.nextDouble();
63 theATM.deposit(amount);
64 theATM.back();
65 }