Question: objectives This assignment requires you to write a program in Java that calculates the day of week and the week of month for a given

 objectives This assignment requires you to write a program in Javathat calculates the day of week and the week of month fora given date, as well as to print the calendar of the

objectives This assignment requires you to write a program in Java that calculates the day of week and the week of month for a given date, as well as to print the calendar of the month where the given date exists Background 2017 MAY UNIVERSITY OF For a given date, we can use the Gregorian calendar to find the comesponding the day of the week, and the week of the month. For example, May 272017 is a Saturday and locates in the fourth week 2017. In general, we can use the following formula (Zeller's congruence to calculate the day of a week for any given date after October 15 1582. K+ where his the day of the week (0- Saturday, 1 Sunday, 2-Monday, 3 Tuesday, 4 Wednesday, 5 Thursday, 6-Friday g is the day of the month m is the month (3-March, 4-April, 5-May, 6 June, 7 July, 8 August, 9 September, 10 October, 11 November, 12 December, 13 January, 14- February) Kis the year of the century lyear mod 100). year 1000. For example, the zero-based centuries for 1995 and 2000 are 19 and 20 respectively. For example, For 1 January 2000, the date would be treated as the 13th month of 1999, so the values would be: q-1, m-13, K-99, J-19, so the formula is (1+[182/5]+99+199/4] [19/4]+95) mod 7 (1+136.4]+99+124.75] (4.75) 95) mod 7 -(1+36+99+24+4+95) mod 7 Saturday However, for 1 March 2000, the date is treated as the 3rd month of 2000, so the values become q 1, m 3, K-00, J-20, so the formula is

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!