- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChapter60.java
More file actions
Latest commit
50 lines (42 loc) · 1.45 KB
/
Copy pathChapter60.java
File metadata and controls
50 lines (42 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
packagecom.javaex.Chapter60;
importjava.util.Scanner;
publicclassAccountApp {
publicstaticvoidmain(String[] args) {
Scannersc = newScanner(System.in);
booleanrun = true;
intmoney;
Accountaccount = newAccount("312-89562-123456");
while(run) {
System.out.println("");
System.out.println("--------------------");
System.out.println("1.예금, 2.출금, 3.잔고, 4.종료");
System.out.println("--------------------");
System.out.println("선택>");
intmenuNo = sc.nextInt();
switch(menuNo) {
case1:
System.out.print("예금액>");
money = sc.nextInt();
account.deposit(money);
break;
case2:
System.out.print("출금액>");
money = sc.nextInt();
account.withdraw(money);
break;
case3:
System.out.print("잔고액>");
account.showBalance();
break;
case4:
System.out.print("프로그램 종료");
run = false;
break;
default:
System.out.println("다시 입력해주세요");
continue;
}
}
sc.close();
}
}