-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBurgerOrder.java
164 lines (145 loc) · 3.96 KB
/
BurgerOrder.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package lab5;
/**
*
* @author ReileyMeeks
*/
class BurgerOrder {
private int orderNum = 1;
private int numSodas;
private int numVeggieburgers = 0;
private int numCheeseburgers = 0;
private int numHamburgers = 0;
private boolean isOrderTogo = false;
public BurgerOrder(int _numSodas, int _numVeggieburgers, int _numCheeseburgers,
int _numHamburgers, int _orderNum, boolean _isOrderTogo) {
this.numSodas = _numSodas;
this.numVeggieburgers = _numVeggieburgers;
this.numCheeseburgers = _numCheeseburgers;
this.numHamburgers = _numHamburgers;
this.orderNum = _orderNum;
this.isOrderTogo = _isOrderTogo;
}
/**
* Get the value of orderNum
*
* @return the value of orderNum
*/
public int getOrderNum() {
return orderNum;
}
/**
* Set the value of orderNum
*
* @param orderNum new value of orderNum
*/
public void setOrderNum(int orderNum) {
this.orderNum = orderNum;
}
/**
* Get the value of isOrderTogo
*
* @return the value of isOrderTogo
*/
public boolean isIsOrderTogo() {
return isOrderTogo;
}
/**
* Set the value of isOrderTogo
*
* @param isOrderTogo new value of isOrderTogo
*/
public void setIsOrderTogo(boolean isOrderTogo) {
this.isOrderTogo = isOrderTogo;
}
/**
* Get the value of numSodas
*
* @return the value of numSodas
*/
public int getNumSodas() {
return numSodas;
}
/**
* Set the value of numSodas
*
* @param numSodas new value of numSodas
*/
public void setNumSodas(int numSodas) {
if (numSodas >= 0) {
this.numSodas = numSodas;
} else if (numSodas < 0) {
System.out.println("Error");
}
}
/**
* Get the value of numVeggieburgers
*
* @return the value of numVeggieburgers
*/
public int getNumVeggieburgers() {
return numVeggieburgers;
}
/**
* Set the value of numVeggieburgers
*
* @param numVeggieburgers new value of numVeggieburgers
*/
public void setNumVeggieburgers(int numVeggieburgers) {
if (numVeggieburgers >= 0) {
this.numVeggieburgers = numVeggieburgers;
} else if (numVeggieburgers < 0) {
System.out.println("Error");
}
}
/**
* Get the value of numCheeseburgers
*
* @return the value of numCheeseburgers
*/
public int getNumCheeseburgers() {
return numCheeseburgers;
}
/**
* Set the value of numCheeseburgers
*
* @param numCheeseburgers new value of numCheeseburgers
*/
public void setNumCheeseburgers(int numCheeseburgers) {
if (numCheeseburgers >= 0) {
this.numCheeseburgers = numCheeseburgers;
} else if (numCheeseburgers < 0) {
System.out.println("Error");
}
}
/**
* Get the value of numHamburgers
*
* @return the value of numHamburgers
*/
public int getNumHamburgers() {
return numHamburgers;
}
/**
* Set the value of numHamburgers
*
* @param numHamburgers new value of numHamburgers
*/
public void setNumHamburgers(int numHamburgers) {
if (numHamburgers >= 0) {
this.numHamburgers = numHamburgers;
} else if (numHamburgers < 0) {
System.out.println("Error");
}
}
@Override
public String toString() {
return "BurgerOrder{" + "orderNum=" + orderNum + ", numSodas=" + numSodas
+ ", numVeggieburgers=" + numVeggieburgers + ", numCheeseburgers=" + numCheeseburgers
+ ", numHamburgers=" + numHamburgers + ", isOrderTogo=" + isOrderTogo + '}';
}
}