Commit 7040c40a authored by 9731087's avatar 9731087

Second commit

parent 00cc2050
Pipeline #412 failed with stages
...@@ -27,13 +27,15 @@ public class Order { ...@@ -27,13 +27,15 @@ public class Order {
return price; return price;
} }
public void addFood(Food food, int amount){ public void addFood(Food food, int amount) {
Food[] temp = new Food[foods.length + amount]; Food[] temp = new Food[foods.length + amount];
for (int i = 0; i < foods.length; i++) { for (int i = 0; i < foods.length; i++) {
temp[i] = foods[i]; temp[i] = foods[i];
} }
for (int i = 0; i < amount; i++) { for (int i = 0; i < amount; i++) {
temp[foods.length + i] = food; temp[foods.length + i] = food;
this.price += (temp[foods.length + i].getPrice()) * 1.4;
} }
foods = temp; foods = temp;
temp = null; temp = null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment