Question: A years Doomsday is given by the equation: Doomsday = (((yr // 12) + (yr % 12) + (yr % 12) // 4) % 7

A years Doomsday is given by the equation: Doomsday = (((yr // 12) + (yr % 12) + (yr % 12) // 4) % 7 + anchor) % 7 (1) where yr is the last two digits of the year and the anchor day is an integer between 0 and 7 with 0 corresponding to Sunday and 7 to Saturday. Write a program to calculate a years Doomsday. Prompt a user for the last two digits of the year and for the anchor day as an integer. Print out the Doomsday. Include the following:

A function calc doom() that calculates the doomsday that takes two parameters yr and anchor and returns the doomsday

A docstring in the function (i.e., right under the def line of the function surrounded by three single or double quotes) that explains the purpose of the function 2 Anchor days for 2000-2099 are Tuesday (=2) and for 1900-1999 Wednesday (=3). Example results are shown below.

1 Enter the last two digits of the year: 05

2 Enter the anchor day as an integer [0=Sunday, 7=Saturday]: 2

3

4 Doomsday = 1

5

6 Enter the last two digits of the year: 18

7 Enter the anchor day as an integer [0=Sunday, 7=Saturday]: 2 8 9 Doomsday = 3

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!