diff --git a/src/main/java/APCalendar.java b/src/main/java/APCalendar.java index 021022a..2b1e930 100644 --- a/src/main/java/APCalendar.java +++ b/src/main/java/APCalendar.java @@ -56,6 +56,7 @@ private static int dayOfYear(int month, int day, int year) public static int dayOfWeek(int month, int day, int year) { /* to be implemented in part (b) */ - return this.firstDayofYear(year) + this.dayOfYear(month, day, year) % 7; + int days = dayOfYear(month, day, year) - 1; + return (firstDayOfYear(year) + days) % 7); } }