Enter year: 1960 Enter month: 12 Enter day: 12 That day was Monday.
Your program will check the following:
This algorithm was developed by Rev. Zeller. Let us define the quantities a, b, c, and d as follows:
Important: In our calendar, the year begins in January and ends in December. In the calendar, used in the algorithm, the year begins in March and ends in February. Your program should internally make the adjustment and not expect the user to know this. For example, if in our calendar we have January 2009 (month = 1 and year = 2009), the program will make the adjustment so that month = 11 and year = 2008. If you do not make the adjustment you will not get the right result.
For example, 31 July 1929, gives a = 5, b = 31, c = 29, and d = 19. Similarly, 3 January 1988, gives a = 11, b = 3, c = 87, and d = 19.
Now compute the following quantities:
r gives the day of the week. r = 0 represents Sunday, r = 1 represents Monday, and so on.
The class that you will be writing will be called Day. We will be looking at good documentation, design, and adherence to the coding convention mentioned below. You may use the same variable names used in the problem statement or come up with your own. You must use Scanner for your input. If the day is in the future the tense of the verb should be changed accordingly. Your file Day.java will have the following header:
/* File: Day.java Description: Student Name: Student UT EID: Course Name: CS 312 Unique Number: Date Created: Date Last Modified: */
You will follow the standard Java Coding Conventions. You can either view the HTML page or download the PDF or Postscript and print it out. There is a modification that I would like to make to the standard coding conventions. Please align the opening and closing braces vertically so that you can easily make out the blocks of code. For example:
Do this: if ( x > 5 ) { a = b + c; } Not this: if ( x > 5 ) { a = b + c; }
Use the turnin program to submit your .java file. The proctor should receive your work by 11 PM on Wednesday 03 July 2013. There will be substantial penalties if you do not adhere to the guidelines.