Question: 4. Zeller's Congruence Name: Exercise 6 4.java A formula called Zeller's Congruence can be used to determine the day of the week on which a

 4. Zeller's Congruence Name: Exercise 6 4.java A formula called Zeller's

4. Zeller's Congruence Name: Exercise 6 4.java A formula called Zeller's Congruence can be used to determine the day of the week on which a particular date occurs. The formula is: h (q+13(m + 1) +K+K+'-2) mod 7 - h is the day of the week (Saturday - 0, Sunday 1, Monday- 2, Tuesday -3, Wednesday 4, Thursday 5, and Friday 6) . q is the day of the month . m is the month (March 3, April-4, May 5, June - 6, July 7, August 8, September 9, October 10, November 11, December 12, January 13, and February -1 K is the year of the century (Le-Year % 100) .J is the century (i.e., year / 100) . number for January However, the formula has a couple quirks. In particular, in the formula, the is 13 and the number for February is 14. Also, when must be decremented by one for the formula to work correctly. Note that the user wi 1 for January and 2 for February, but your program correct numbers for the formula as well as decrementing the year in the case of those two months. Also note that all the division in the formula is integer division. the month is January or February, the year ll still enter will need to change them over to the Write a program that gets the day of the month, the month, and the year, computes the day of the week for that date and displays that day of the week. Sample Runs: Enter day of month (1 -31): 4 Enter month (112): 7 Enter year: 1776 Day of the week: Thursday Enter day of month (1 31): 29 Enter month (1 12): 9 Enter year: 2017 Day of the week: Friday Enter day of month (1-31): 1 Enter month (1 -12): 1 Enter year: 2017 Day of the week: Sunday

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!