Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Step: 3

blur-text-image

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

Database Basics Computer EngineeringInformation Warehouse Basics From Science

Authors: Odiljon Jakbarov ,Anvarkhan Majidov

1st Edition

620675183X, 978-6206751830

More Books

Students also viewed these Databases questions

Question

4. How is culture a contested site?

Answered: 1 week ago