-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRestaurant.java
48 lines (46 loc) · 1.11 KB
/
Restaurant.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
/**
* Write a description of class Restaurant here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Restaurant
{
private Food[] orders; // holds different orders
private int clickCount; // holds the amount of times click is pressed
/**
* Constructor for objects of class restaurant
*/
public Restaurant()
// instantiates instance variables
{
clickCount = 0;
orders = new Food[3];
orders[0] = new BananasFoster();
orders[1] = new BananaSmoothie();
orders[2] = new BananaCreamPie();
}
public void incrementOrder()
// increments clickCount by 1
{
clickCount++;
}
public int getOrderNum()
// returns the number of orders
{
return clickCount;
}
public int getOrderLength()
// returns the length of orders
{
return orders.length;
}
public Food getMyOrder()
//Returns the food that is being made in the order
{
if(clickCount < orders.length){
return orders[clickCount];
}
return null;
}
}