Commit 9395e6d

mo <mo.khan@gmail.com>
2019-07-13 20:04:09
start work on Q6
1 parent a76b31a
Changed files (2)
src/Q6/README.md
@@ -0,0 +1,32 @@
+Learning Profile for Assignment #2, And Question #6
+
+Name: Mo Khan
+Student ID: 3431709
+
+1. Problem Statement:
+
+```text
+Implement a Java method that prints out the day of the week for a given:
+
+* day (1...31),
+* month (1...12) and
+* year in the range of March 1900 to February 2100.
+
+Calculate the day of the week for the dates between
+March 1900 and February 2100 as follows:
+
+1. Calculate the total number of days from 1900/1/1 to the given date (see below for details).
+1. Divide this number by 7 with an integer remainder: This now is the day of the week, with 0 as Sunday, 1 as Monday, and so on.
+
+To calculate the total number of days, you have to implement the following steps:
+
+1. Subtract 1900 from the given year, and multiply the result by 365
+1. Add the missing leap years by adding (year − 1900) / 4.
+1. If the year itself is a leap year and the month is January or February, you have to subtract 1 from the previous result.
+1. Now add all the days of the months of the given year to the result (in the case of February, it is always 28 because the additional day for a leap year has already been added in the calculation).
+```
+
+1. Description of the Code:
+1. Errors and Warnings:
+1. Sample Input and Output:
+1. Discussion:
src/Q6/WeekDay.java
@@ -0,0 +1,29 @@
+package Q6;
+
+public class WeekDay {
+  private int numberOfDays;
+  public static final int JANUARY = 0;
+  public static final int FEBRUARY = 0;
+  public static final int MARCH = 0;
+  public static final int APRIL = 0;
+  public static final int MAY = 0;
+  public static final int JUNE = 0;
+  public static final int JULY = 0;
+  public static final int AUGUST = 0;
+  public static final int SEPTEMBER = 0;
+  public static final int OCTOBER = 0;
+  public static final int NOVEMBER = 0;
+  public static final int DECEMBER = 0;
+
+  public static final int SUNDAY = 0;
+  public static final int MONDAY = 0;
+  public static final int TUESDAY = 0;
+  public static final int WEDNESDAY = 0;
+  public static final int THURSDAY = 0;
+  public static final int FRIDAY = 0;
+  public static final int SATURDAY = 0;
+
+  public String getWeekDay(int day, int month, int year) {
+    return "";
+  }
+}