Browse Source

awesome output achieved

mpierse 6 years ago
parent
commit
a1e1451fad
1 changed files with 5 additions and 5 deletions
  1. 5
    5
      src/main/java/io/zipcoder/ItemParser.java

+ 5
- 5
src/main/java/io/zipcoder/ItemParser.java View File

@@ -44,7 +44,7 @@ public class ItemParser {
44 44
     public String fixCookies(String str){
45 45
         String result ="";
46 46
         for (char c: str.toCharArray()) {
47
-            if(c == 0){result += "o";}
47
+            if(c == '0'){result += "o";}
48 48
             else if (c != 0) result += c;
49 49
         }
50 50
         return result;
@@ -123,11 +123,11 @@ public class ItemParser {
123 123
         Set<String> nameSet = getUniqueNames(itemList);
124 124
         for (String name : nameSet) {
125 125
             Set<Double> priceList = getUniquePrices(name, itemList);
126
-            System.out.printf("%-15s %15s %n", "name: " + name, "seen: " + getCountName(name, itemList) + " times");
127
-            System.out.printf("%-15s %15s %n", "==============", "==============");
126
+            System.out.printf("%-13s %13s %n", "name: " + name, "seen: " + getCountName(name, itemList) + " times");
127
+            System.out.printf("%-13s %13s %n", "=============", "=============");
128 128
             for (Double price : priceList) {
129
-                System.out.printf("%-15s %15s %n", "price: " + price,"seen: " + getCountPrice(price, name, itemList) + " times");
130
-                System.out.printf("%-15s %15s %n", "--------------", "--------------");
129
+                System.out.printf("%-13s %13s %n", "price: " + price,"seen: " + getCountPrice(price, name, itemList) + " times");
130
+                System.out.printf("%-13s %13s %n", "-------------", "-------------");
131 131
             }
132 132
             System.out.println();
133 133
         }