Compare commits

...

2 Commits

Author SHA1 Message Date
df521054ef had to 2024-10-18 15:17:59 +02:00
89bb3a674e TechStore code (#1)
Technikladen-Aufgaben-Lösung hinzugefügt, weitere kleinere Änderungen werden noch folgen, aber funktional hiermit vollständig

Reviewed-on: denyskon/info-java#1
Reviewed-by: Denys Konovalov <kontakt@denyskon.de>
Co-authored-by: ibartkowski <ibartkowski@git.cantorgymnasium.de>
Co-committed-by: ibartkowski <ibartkowski@git.cantorgymnasium.de>
2024-10-14 19:12:15 +02:00
3 changed files with 31 additions and 0 deletions

@ -3,9 +3,15 @@ import java.util.ArrayList;
public class OrderSystem {
private StorageManager systemManager;
private ArrayList<Client> systemClients;
<<<<<<< HEAD
public OrderSystem(StorageManager manager) {
this.systemManager = manager;
this.systemClients = new ArrayList<Client>();
=======
public OrderSystem(StorageManager manager, ArrayList<Client> clients) {
this.systemManager = manager;
this.systemClients = clients;
>>>>>>> 89bb3a674e4304644c37109ed5a608b97926deb9
}
public void addProduct(Product product) {
this.systemManager.addProduct(product);
@ -52,4 +58,8 @@ public class OrderSystem {
System.out.println("ID: " + product.getID() + ", Name: " + product.getName() + ", Price: " + product.getPrice() + ", Amount: " + product.getAmount());
}
}
<<<<<<< HEAD
}
=======
}
>>>>>>> 89bb3a674e4304644c37109ed5a608b97926deb9

@ -2,8 +2,13 @@ import java.util.ArrayList;
public class StorageManager {
private ArrayList<Product> storageProducts;
<<<<<<< HEAD
public StorageManager() {
this.storageProducts = new ArrayList<Product>();
=======
public StorageManager(ArrayList<Product> products) {
this.storageProducts = products;
>>>>>>> 89bb3a674e4304644c37109ed5a608b97926deb9
}
public void addProduct(Product product) {
this.storageProducts.add(product);

@ -1,13 +1,23 @@
<<<<<<< HEAD
import java.util.Scanner;
import java.util.ArrayList;
=======
import java.util.ArrayList;
import java.util.Scanner;
>>>>>>> 89bb3a674e4304644c37109ed5a608b97926deb9
public class TechStore {
public static void p(String input) {
System.out.print(input);
}
public static void main(String[] args) {
<<<<<<< HEAD
StorageManager manager = new StorageManager();
OrderSystem system = new OrderSystem(manager);
=======
StorageManager manager = new StorageManager(new ArrayList<Product>());
OrderSystem system = new OrderSystem(manager, new ArrayList<Client>());
>>>>>>> 89bb3a674e4304644c37109ed5a608b97926deb9
Scanner scnr = new Scanner(System.in);
while (true) {
p("\nInput mode: ");
@ -106,3 +116,9 @@ public class TechStore {
}
}
}
<<<<<<< HEAD
=======
>>>>>>> 89bb3a674e4304644c37109ed5a608b97926deb9