Skip to content

Commit

Permalink
Update APCalendar.java
Browse files Browse the repository at this point in the history
  • Loading branch information
chyeung1 authored Apr 30, 2024
1 parent 97d8a45 commit a6f0a60
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/APCalendar.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit a6f0a60

Please sign in to comment.