Aktienhandel #4

Merged
Denys Konovalov merged 22 commits from ibartkowski/info-java:main into main 2024-10-18 18:21:55 +02:00
3 changed files with 11 additions and 7 deletions
Showing only changes of commit 0aff196b75 - Show all commits

@ -3,9 +3,9 @@ import java.util.ArrayList;
public class OrderSystem {
private StorageManager systemManager;
private ArrayList<Client> systemClients;
public OrderSystem(StorageManager manager) {
public OrderSystem(StorageManager manager, ArrayList<Client> clients) {
this.systemManager = manager;
this.systemClients = new ArrayList<Client>();
this.systemClients = clients;
}
public void addProduct(Product product) {
this.systemManager.addProduct(product);

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

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