Explorar el Código

awesome output achieved

mpierse hace 6 años
padre
commit
a1e1451fad
Se han modificado 1 ficheros con 5 adiciones y 5 borrados
  1. 5
    5
      src/main/java/io/zipcoder/ItemParser.java

+ 5
- 5
src/main/java/io/zipcoder/ItemParser.java Ver fichero

44
     public String fixCookies(String str){
44
     public String fixCookies(String str){
45
         String result ="";
45
         String result ="";
46
         for (char c: str.toCharArray()) {
46
         for (char c: str.toCharArray()) {
47
-            if(c == 0){result += "o";}
47
+            if(c == '0'){result += "o";}
48
             else if (c != 0) result += c;
48
             else if (c != 0) result += c;
49
         }
49
         }
50
         return result;
50
         return result;
123
         Set<String> nameSet = getUniqueNames(itemList);
123
         Set<String> nameSet = getUniqueNames(itemList);
124
         for (String name : nameSet) {
124
         for (String name : nameSet) {
125
             Set<Double> priceList = getUniquePrices(name, itemList);
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
             for (Double price : priceList) {
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
             System.out.println();
132
             System.out.println();
133
         }
133
         }