From 192ae021dc9702c81ad23024e8b272e258d1b9f9 Mon Sep 17 00:00:00 2001 From: ibartkowski Date: Mon, 14 Oct 2024 19:06:05 +0200 Subject: [PATCH] Update Technikladen/Order.java Removed package line --- Technikladen/Order.java | 86 ++++++++++++++++++++--------------------- 1 file changed, 42 insertions(+), 44 deletions(-) diff --git a/Technikladen/Order.java b/Technikladen/Order.java index cc6c232..dc08e7c 100755 --- a/Technikladen/Order.java +++ b/Technikladen/Order.java @@ -1,44 +1,42 @@ -package tech_store; - -import java.util.ArrayList; - -public class Order { - private int orderClientID; - private ArrayList orderEntries; - private String orderDate; - public Order(int clientID, String date) { - this.orderClientID = clientID; - this.orderEntries = new ArrayList(); - this.orderDate = date; - } - public int getClientID() { - return this.orderClientID; - } - public String getDate() { - return this.orderDate; - } - public ArrayList getEntries() { - return this.orderEntries; - } - public void addEntry(OrderEntry entry) { - this.orderEntries.add(entry); - } - public int calcPrice() { - int price = 0; - for (OrderEntry entry : this.orderEntries) { - price += entry.calcPrice(); - } - return price; - } - public String createReceipt() { - String output = "\n"; - for (OrderEntry entry : this.orderEntries) { - output += entry.toString() + ", Price: " + entry.calcPrice() + "\n"; - } - output += "=====" + this.calcPrice() + "====="; - return output; - } - public String toString() { - return ("Client: " + this.orderClientID + ", Date: " + this.orderDate); - } -} +import java.util.ArrayList; + +public class Order { + private int orderClientID; + private ArrayList orderEntries; + private String orderDate; + public Order(int clientID, String date) { + this.orderClientID = clientID; + this.orderEntries = new ArrayList(); + this.orderDate = date; + } + public int getClientID() { + return this.orderClientID; + } + public String getDate() { + return this.orderDate; + } + public ArrayList getEntries() { + return this.orderEntries; + } + public void addEntry(OrderEntry entry) { + this.orderEntries.add(entry); + } + public int calcPrice() { + int price = 0; + for (OrderEntry entry : this.orderEntries) { + price += entry.calcPrice(); + } + return price; + } + public String createReceipt() { + String output = "\n"; + for (OrderEntry entry : this.orderEntries) { + output += entry.toString() + ", Price: " + entry.calcPrice() + "\n"; + } + output += "=====" + this.calcPrice() + "====="; + return output; + } + public String toString() { + return ("Client: " + this.orderClientID + ", Date: " + this.orderDate); + } +}