|
@@ -1,6 +1,27 @@
|
1
|
|
-
|
|
1
|
+import java.util.Scanner;
|
2
|
2
|
/**
|
3
|
3
|
* Created by leon on 1/10/18.
|
4
|
4
|
*/
|
5
|
5
|
public class MainApplication {
|
|
6
|
+ Scanner scanner = new Scanner(System.in);
|
|
7
|
+ Product lemons = new Product("lemon",584389);
|
|
8
|
+ Product sugar = new Product("sugar",590452);
|
|
9
|
+ Product water = new Product("water",590329);
|
|
10
|
+ Product[] products = {lemons, sugar, water};
|
|
11
|
+ Inventory inventory = new Inventory(products);
|
|
12
|
+
|
|
13
|
+ public void runManager(){
|
|
14
|
+ for(int i = 0; i < 3; i++){
|
|
15
|
+ System.out.println("Enter price, quantity of "+ products[i].getName());
|
|
16
|
+ double price = scanner.nextInt();
|
|
17
|
+ products[i].setPrice(price);
|
|
18
|
+ int quantity = scanner.nextInt();
|
|
19
|
+ products[i].setQuantity(quantity);
|
|
20
|
+ }
|
|
21
|
+
|
|
22
|
+ double total = inventory.getWholeInventoryValue(products);
|
|
23
|
+
|
|
24
|
+ System.out.println("Total value of your inventory: "+total);
|
|
25
|
+ }
|
6
|
26
|
}
|
|
27
|
+
|