-
Notifications
You must be signed in to change notification settings - Fork 566
Expand file tree
/
Copy pathOutputHandler.java
More file actions
69 lines (55 loc) · 2.51 KB
/
OutputHandler.java
File metadata and controls
69 lines (55 loc) · 2.51 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package cleancode.studycafe.asis.io;
import cleancode.studycafe.asis.model.StudyCafeLockerPass;
import cleancode.studycafe.asis.model.StudyCafePass;
import java.util.List;
import java.util.logging.Logger;
public class OutputHandler {
public void showWelcomeMessage() {
System.out.println("*** 프리미엄 스터디카페 ***");
}
public void showAnnouncement() {
System.out.println("* 사물함은 고정석 선택 시 이용 가능합니다. (추가 결제)");
System.out.println("* !오픈 이벤트! 2주권 이상 결제 시 10% 할인, 12주권 결제 시 15% 할인! (결제 시 적용)");
System.out.println();
}
public void askPassTypeSelection() {
System.out.println("사용하실 이용권을 선택해 주세요.");
System.out.println("1. 시간 이용권(자유석) | 2. 주단위 이용권(자유석) | 3. 1인 고정석");
}
public void showPassListForSelection(List<StudyCafePass> passes) {
System.out.println();
System.out.println("이용권 목록");
for (int index = 0; index < passes.size(); index++) {
StudyCafePass pass = passes.get(index);
System.out.println(String.format("%s. ", index + 1) + pass.display());
}
}
public void askLockerPass(StudyCafeLockerPass lockerPass) {
System.out.println();
String askMessage = String.format(
"사물함을 이용하시겠습니까? (%s)",
lockerPass.display()
);
System.out.println(askMessage);
System.out.println("1. 예 | 2. 아니오");
}
public void showPassOrderSummary(StudyCafePass selectedPass, StudyCafeLockerPass lockerPass) {
System.out.println();
System.out.println("이용 내역");
System.out.println("이용권: " + selectedPass.display());
if (lockerPass != null) {
System.out.println("사물함: " + lockerPass.display());
}
double discountRate = selectedPass.getDiscountRate();
int discountPrice = (int) (selectedPass.getPrice() * discountRate);
if (discountPrice > 0) {
System.out.println("이벤트 할인 금액: " + discountPrice + "원");
}
int totalPrice = selectedPass.getPrice() - discountPrice + (lockerPass != null ? lockerPass.getPrice() : 0);
System.out.println("총 결제 금액: " + totalPrice + "원");
System.out.println();
}
public void showSimpleMessage(String message) {
System.out.println(message);
}
}