forked from denyskon/info-java
Compare commits
No commits in common. "2694e7b7b056a9ace4c40bab3c6713556a8b4d90" and "ed9f84a466ea1c9b3393608d8db49fdec0f5233d" have entirely different histories.
2694e7b7b0
...
ed9f84a466
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -3,9 +3,9 @@ import java.util.ArrayList;
|
|||||||
public class OrderSystem {
|
public class OrderSystem {
|
||||||
private StorageManager systemManager;
|
private StorageManager systemManager;
|
||||||
private ArrayList<Client> systemClients;
|
private ArrayList<Client> systemClients;
|
||||||
public OrderSystem(StorageManager manager) {
|
public OrderSystem(StorageManager manager, ArrayList<Client> clients) {
|
||||||
this.systemManager = manager;
|
this.systemManager = manager;
|
||||||
this.systemClients = new ArrayList<Client>();
|
this.systemClients = clients;
|
||||||
}
|
}
|
||||||
public void addProduct(Product product) {
|
public void addProduct(Product product) {
|
||||||
this.systemManager.addProduct(product);
|
this.systemManager.addProduct(product);
|
||||||
@ -52,4 +52,4 @@ public class OrderSystem {
|
|||||||
System.out.println("ID: " + product.getID() + ", Name: " + product.getName() + ", Price: " + product.getPrice() + ", Amount: " + product.getAmount());
|
System.out.println("ID: " + product.getID() + ", Name: " + product.getName() + ", Price: " + product.getPrice() + ", Amount: " + product.getAmount());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Binary file not shown.
Binary file not shown.
@ -2,8 +2,8 @@ import java.util.ArrayList;
|
|||||||
|
|
||||||
public class StorageManager {
|
public class StorageManager {
|
||||||
private ArrayList<Product> storageProducts;
|
private ArrayList<Product> storageProducts;
|
||||||
public StorageManager() {
|
public StorageManager(ArrayList<Product> products) {
|
||||||
this.storageProducts = new ArrayList<Product>();
|
this.storageProducts = products;
|
||||||
}
|
}
|
||||||
public void addProduct(Product product) {
|
public void addProduct(Product product) {
|
||||||
this.storageProducts.add(product);
|
this.storageProducts.add(product);
|
||||||
|
Binary file not shown.
@ -1,13 +1,13 @@
|
|||||||
import java.util.Scanner;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Scanner;
|
||||||
|
|
||||||
public class TechStore {
|
public class TechStore {
|
||||||
public static void p(String input) {
|
public static void p(String input) {
|
||||||
System.out.print(input);
|
System.out.print(input);
|
||||||
}
|
}
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
StorageManager manager = new StorageManager();
|
StorageManager manager = new StorageManager(new ArrayList<Product>());
|
||||||
OrderSystem system = new OrderSystem(manager);
|
OrderSystem system = new OrderSystem(manager, new ArrayList<Client>());
|
||||||
Scanner scnr = new Scanner(System.in);
|
Scanner scnr = new Scanner(System.in);
|
||||||
while (true) {
|
while (true) {
|
||||||
p("\nInput mode: ");
|
p("\nInput mode: ");
|
||||||
@ -106,3 +106,6 @@ public class TechStore {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user