Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with this programming question A years Doomsday is given by the equation: Doomsday = (((yr // 12) + (yr % 12) +

I need help with this programming question

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

where yr is the last two digits of the year and the anchor day is an integer between 0 and 6 with 0 corresponding to Sunday and 6 to Saturday.

Write a non-void function get day() that takes as its parameter the doomsday calculated by calc doom(), determines which day of the week it represents (0=Sunday), and returns this day to main(). Use the if-elif-else construct. write a main() function that it prompts the user for a four-digit integer year, extracts the first two and last two digits of the year, calls set anchor which returns the anchor, calls calc_doom() which returns the doomsday, and finally calls get_day() to determine the day of the week which it then prints as the Doomsday. Anchor days for 2000-2099 are Tuesday (=2) and for 1900-1999 Wednesday (=3). Example results are shown below. 1 Enter the year in four digits: 1966 2 Doomsday: Monday 3 4 Enter the year in four digits: 2019 5 Doomsday: Thursday

in python format please

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

Students also viewed these Databases questions

Question

What is oversampling?

Answered: 1 week ago

Question

c. What groups were least represented? Why do you think this is so?

Answered: 1 week ago