diff options
| author | mo <mo.khan@gmail.com> | 2019-07-13 15:37:58 -0600 |
|---|---|---|
| committer | mo <mo.khan@gmail.com> | 2019-07-13 15:37:58 -0600 |
| commit | 2db187f5ad9600d529a7fe66bac061a226d37a0c (patch) | |
| tree | efb2463180b946374b67ab64130d1cf44cf9233e /src/Q6 | |
| parent | d8225981240996fdaf6cc42dcea6005a7e9d99c6 (diff) | |
remove debugging code
Diffstat (limited to 'src/Q6')
| -rw-r--r-- | src/Q6/WeekDay.java | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/src/Q6/WeekDay.java b/src/Q6/WeekDay.java index 9b322c8..09cc1ba 100644 --- a/src/Q6/WeekDay.java +++ b/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); |
