-
Notifications
You must be signed in to change notification settings - Fork 0
/
BevShopInterface.java
103 lines (93 loc) · 4.82 KB
/
BevShopInterface.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
public interface BevShopInterface {
int MIN_AGE_FOR_ALCOHOL = 21; //Minimum age for offering alcohol drink
int MAX_ORDER_FOR_ALCOHOL= 3; /*Maximum number of alcohol beverages
that can be ordered within an order */
int MIN_TIME= 8; //earliest time for the order
int MAX_TIME= 23; //latest time for the order
int MAX_FRUIT = 5; //Maximum number of fruits that this shop offers for SMOOTHIE beverage
/**
* Checks if the time is valid (between 8 and 23 )
* @param time time represents the time
* @return true if times is within the range of 8 to 23 , false otherwise
*/
public boolean validTime(int time);
/**
* checks if the number of alcohol beverages for the current order has reached the maximum
* @return true if number of alcohol drinks for the current order has reached the maximum , false otherwise
*/
public boolean eligibleForMore();
/**
* check the valid age for the alcohol drink
* @param age the age
* @return returns true if age is more than minimum eligible age , false otherwise
*/
public boolean validAge(int age);
/**
* Creates a new order , NO BEVERAGE is added to the order yet
* @param time time of the order
* @param day day of the order of type DAY
* @param customerName customer name
* @param customerAge customer age
*/
public void startNewOrder(int time,
DAY day,
String customerName,
int customerAge);
/**
* process the Coffee order for the current order by adding it to the current order
* @param bevName beverage name
* @param size beverage size
* @param extraShot true if the coffee beverage has extra shot , false otherwise
* @param extraSyrup true if the coffee beverage has extra syrup , false otherwise
*/
public void processCoffeeOrder( String bevName,
SIZE size,
boolean extraShot,
boolean extraSyrup );
/**
* process the Alcohol order for the current order by adding it to the current order
* @param bevName beverage name
* @param size beverage size
*/
public void processAlcoholOrder( String bevName,
SIZE size );
/**
* process the Smoothie order for the current order by adding it to the current order
* @param bevName beverage name
* @param size beverage size
* @param numOfFruits number of fruits to be added
* @param addProtien true if protein is added , false otherwise
*/
public void processSmoothieOrder( String bevName,
SIZE size,
int numOfFruits,
boolean addProtien);
/**
* locate an order based on the order number
* @param orderNo the order number
* @return the index of the order in the list of Orders if found or -1 if not found
*/
public int findOrder(int orderNo);
/**
* locates an order in the list of orders and returns the total value on the order.
* @param orderNo the order number
* @returns the calculated price on this order.
*/
public double totalOrderPrice(int orderNo);
/**
* Calculates the total sale of all the orders for this beverage shop
* @return the total sale of all the orders
*/
public double totalMonthlySale();
/**
* sorts the orders within this bevShop using the Selection
* sort algorithm
*/
public void sortOrders();
/**
* returns Order in the list of orders at the index
* Notes: this method returns the shallow copy of the order
* @return Order in the list of orders at the index
*/
public Order getOrderAtIndex(int index);
}