|
@@ -21,16 +21,18 @@ public class Main {
|
21
|
21
|
itemParser.createItems();
|
22
|
22
|
itemParser.addNameAndItemsOfSameNameToItemOrganizer();
|
23
|
23
|
|
24
|
|
- System.out.println(itemParser.itemNameAndCountAsString("milk"));
|
25
|
|
- System.out.println(itemParser.pricesAndTheirCountAsString(itemParser.getPricesAndTheirCount("milk")));
|
26
|
|
- System.out.println(itemParser.itemNameAndCountAsString("bread"));
|
27
|
|
- System.out.println(itemParser.pricesAndTheirCountAsString(itemParser.getPricesAndTheirCount("bread")));
|
28
|
|
- System.out.println(itemParser.itemNameAndCountAsString("cookies"));
|
29
|
|
- System.out.println(itemParser.pricesAndTheirCountAsString(itemParser.getPricesAndTheirCount("cookies")));
|
30
|
|
- System.out.println(itemParser.itemNameAndCountAsString("apples"));
|
31
|
|
- System.out.println(itemParser.pricesAndTheirCountAsString(itemParser.getPricesAndTheirCount("apples")));
|
32
|
|
- System.out.println(itemParser.getIpe().errorCountAsString());
|
33
|
|
-
|
34
|
|
-
|
|
24
|
+ // Prints report in alphabetical order by name (the prices/counts match output.txt)
|
|
25
|
+ System.out.println(itemParser.getReportAsString());
|
|
26
|
+
|
|
27
|
+ // These commands (commented out) will print the same information in the order of output.txt
|
|
28
|
+// System.out.println(itemParser.itemNameAndCountAsString("milk"));
|
|
29
|
+// System.out.println(itemParser.pricesAndTheirCountAsString(itemParser.getPricesAndTheirCount("milk")));
|
|
30
|
+// System.out.println(itemParser.itemNameAndCountAsString("bread"));
|
|
31
|
+// System.out.println(itemParser.pricesAndTheirCountAsString(itemParser.getPricesAndTheirCount("bread")));
|
|
32
|
+// System.out.println(itemParser.itemNameAndCountAsString("cookies"));
|
|
33
|
+// System.out.println(itemParser.pricesAndTheirCountAsString(itemParser.getPricesAndTheirCount("cookies")));
|
|
34
|
+// System.out.println(itemParser.itemNameAndCountAsString("apples"));
|
|
35
|
+// System.out.println(itemParser.pricesAndTheirCountAsString(itemParser.getPricesAndTheirCount("apples")));
|
|
36
|
+// System.out.println(itemParser.getIpe().errorCountAsString());
|
35
|
37
|
}
|
36
|
38
|
}
|