Commit 2db187f

mo <mo.khan@gmail.com>
2019-07-13 21:37:58
remove debugging code
1 parent d822598
Changed files (1)
src/Q6/WeekDay.java
@@ -27,8 +27,6 @@ public class WeekDay {
 
   public String getWeekDay(int day, int month, int year) {
     int totalDaysSinceEpoch = daysSinceEpoch(day, month, year);
-    this.puts("days since epoch: %d", totalDaysSinceEpoch);
-    this.puts("weekday: %d", totalDaysSinceEpoch % 7);
     switch (totalDaysSinceEpoch % 7) {
       case 0:
         return "Sunday";
@@ -51,13 +49,9 @@ public class WeekDay {
 
   private int daysSinceEpoch(int day, int month, int year) {
     int days = (year - 1900) * 365;
-    this.puts("days: %d", days);
     days += (year - 1900) / 4;
-    this.puts("days: %d", days);
     if (isLeapYear(year) && (month == 1 || month == 2)) days -= 1;
-    this.puts("days: %d", days);
     days += daysThisYearUpTo(day, month);
-    this.puts("days: %d", days);
     return days;
   }
 
@@ -67,10 +61,7 @@ public class WeekDay {
 
   private int daysThisYearUpTo(int day, int month) {
     int x = 0;
-    for (int i = 1; i < month; i++) {
-      this.puts("days in month: %d is %d", month, daysInMonth(month));
-      x += daysInMonth(i);
-    }
+    for (int i = 1; i < month; i++) x += daysInMonth(i);
     return x + day;
   }
 
@@ -105,10 +96,6 @@ public class WeekDay {
     }
   }
 
-  private void puts(String format, Object... args) {
-    System.out.println(String.format(format, args));
-  }
-
   public static void main(String[] args) {
     Scanner in = new Scanner(System.in);