-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOrder.java
More file actions
68 lines (56 loc) · 2.1 KB
/
Copy pathOrder.java
File metadata and controls
68 lines (56 loc) · 2.1 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
public class Order {
private int tableNum;
private int quantity;
private int orderMenu;
private String name;
Order() {
tableNum = 0;
quantity = 0;
orderMenu = 0;
}
public Order(Order o) // copy constructor
{
tableNum = o.tableNum;
quantity = o.quantity;
orderMenu = o.orderMenu;
name = o.name;
}
Order(int tableNum, int quantity, int orderMenu) {
this.tableNum = tableNum;
this.quantity = quantity;
this.orderMenu = orderMenu;
}
public int getTableNum() {return tableNum;}
int getQuantity() {return quantity;}
int getOrderMenu() {return orderMenu;}
String getName() {return name;}
void setTableNum(int t) {tableNum = t;}
void setOrderMenu(int o) {orderMenu = o;}
void setQuantity(int q) {quantity = q;}
public double setPrice() {
double total = 0.0;
switch(orderMenu) {
case 1:{name="Tom Yunk Campur";total += 12.9;break;}
case 2:{name="Siakap 2+1 Rasa";total += 27.6;break;}
case 3:{name="Ikan Merapu Stim Aq Yahoo";total += 30.0;break;}
case 4:{name="Mee Goreng Ayum";total += 7.8;break;}
case 5:{name="Udang/Sotong Goreng Tepunk";total += 6.0;break;}
case 6:{name="Telur Goreng";total += 4.5;break;}
case 7:{name="Sayur Kang Keng Kong Goreng";total += 5.0;break;}
case 8:{name="Lamb Chop";total += 25.0;break;}
case 9:{name="Nasi Goreng LGBT";total += 26.5;break;}
case 10:{name="Nasi Putih";total += 1.8;break;}
case 11:{name="Mango Juice";total += 2.9;break;}
case 12:{name="Chocolate Milk";total += 7.6;break;}
case 13:{name="Fresh Milk";total += 3.0;break;}
case 14:{name="Iced Cincau";total += 7.8;break;}
case 15:{name="Carrot Juice";total += 6.0;break;}
case 16:{name="Iced Thin Lime";total += 4.5;break;}
case 17:{name="Soy Bean Milk";total += 5.0;break;}
case 18:{name="Pen PineApple Juice";total += 5.0;break;}
case 19:{name="WaterMELON Juice";total += 6.5;break;}
case 20:{name="Sugar cane Juice";total += 1.8;break;}
default: System.out.println("\nERROR : Unknown Input");}
return total;
}
}