diff options
| author | mo khan <mo@mokhan.ca> | 2019-08-11 17:27:40 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2019-08-11 17:27:40 -0600 |
| commit | cebbb584d3ec256dea468e73cec5d8a30d3151d9 (patch) | |
| tree | e8b533e17cd0fb26463182498bf05dec0303e273 /src/Q6 | |
| parent | 34434b1616d46ea638b373927320bc592e8e09fe (diff) | |
update program profile
Diffstat (limited to 'src/Q6')
| -rw-r--r-- | src/Q6/WeekDay.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Q6/WeekDay.java b/src/Q6/WeekDay.java index 7c79e8b..db77c17 100644 --- a/src/Q6/WeekDay.java +++ b/src/Q6/WeekDay.java @@ -15,6 +15,13 @@ public class WeekDay { new String[] {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}; private static final int[] MONTHS = new int[] {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; + /** + * Returns the day of the week that a certain date falls on. + * + * @param day the day of the month + * @param month the month of the year + * @param year the year + */ public String getWeekDay(int day, int month, int year) { this.ensureValidDate(year, month, day); return DAYS[daysSinceEpoch(day, month, year) % 7]; @@ -46,6 +53,7 @@ public class WeekDay { throw new IllegalArgumentException(); } + /** The entry point to the console application. */ public static void main(String[] args) { Scanner in = new Scanner(System.in); |
