summaryrefslogtreecommitdiff
path: root/src/Q6/WeekDay.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/Q6/WeekDay.java')
-rw-r--r--src/Q6/WeekDay.java8
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);