Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3 Calculate the Weekday for Any Date [ 5 0 points ] Zeller s congruence ( source:Click _ here _ for _ more ) is

3 Calculate the Weekday for Any Date [50 points]
Zellers congruence (source:Click_here_for_more) is an algorithm devised by Christian Zeller to calculate
the day of the week for any calendar date. For todays Gregorian calendar, Zellers congruence is
G =(q +(m +1)13
5+ U + U
4+ V
42 V ) mod 7(1)
where G is the day of the week (0 means Saturday, 1 means Sunday, 2 means Monday, ...), q is the day of
the month (1<= q <=31), m is the month (1<= m <=12), and y is the year of the calendar date (1582<= y <=2099).
Further, the above equation distinguishes V as the century (that is, V = y
100), and U as the year of
the century (that is, U = y mod 100).
Finally, there is an exception in Zellers congruence for the months of January and February which need to
be counted as month 13 and 14, respectively, of the previous year. Thus, if m =1 or m =2, then we need to
add 12 months to the value of m, and subtract 1 year from y before we feed the values into the above equation.
Your weekday calculation program should contain the following sections:

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts Of Database Management

Authors: Joy L. Starks, Philip J. Pratt, Mary Z. Last

9th Edition

1337093424, 978-1337093422

More Books

Students also viewed these Databases questions