-
Notifications
You must be signed in to change notification settings - Fork 0
/
CardSaleInfoEng.java
68 lines (54 loc) · 2.17 KB
/
CardSaleInfoEng.java
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
import java.util.Scanner;
enum Card {
CJONE_SAMSUNG(30, 1), CJONE_SHINHAN(30, 1),
THE_CJ(20, 2), SAMSUNG_6_V4(20, 0),
SHINHAN_LADY(20, 0), KB_STAR(20, 0), EMART_KB(15, 0);
int sale;
int save;
//
Card(int sale, int save) {
this.sale = sale;
this.save = save;
}
//
int getSale() {
return sale;
}
int getSave() {
return save;
}
}
public class CardSaleInfoEng {
public static void main(String[] args) {
System.out.println("CHOOSE AND INPUT THE CARD.\n: CJ ONE SAMSUNG CARD,CJ ONE SHINHWAN CARD, THE CJ,SAMSUNG 6 V4,SHINHAN LADY,KB STAR,EMART KB");
Scanner sc = new Scanner(System.in);
String Input;
Input = sc.nextLine();
System.out.println("CARD NAME:"+Input);
switch(Input) {
case "CJ ONE SAMSUNG CARD":
System.out.println("sale: " + Card.CJONE_SAMSUNG.getSale() + ", save:" + Card.CJONE_SAMSUNG.getSave());
break;
case "CJ ONE SHINHWAN CARD":
System.out.println("sale: " + Card.CJONE_SHINHAN.getSale() + ", save:" + Card.CJONE_SHINHAN.getSave());
break;
case "THE CJ":
System.out.println("sale: " + Card.THE_CJ.getSale() + ", save:" + Card.THE_CJ.getSave());
break;
case "SAMSUNG 6 V4":
System.out.println("sale: " + Card.SAMSUNG_6_V4.getSale() + ", save:" + Card.SAMSUNG_6_V4.getSave());
break;
case "SHINHAN LADY":
System.out.println("sale: " + Card.SHINHAN_LADY.getSale() + ", save:" + Card.SHINHAN_LADY.getSave());
break;
case "KB STAR":
System.out.println("sale: " + Card.KB_STAR.getSale() + ", save:" + Card.KB_STAR.getSave());
break;
case "EMART KB":
System.out.println("sale: " + Card.EMART_KB.getSale() + ", save:" + Card.EMART_KB.getSave());
break;
default:
break;
}
}
}