Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3.5 Doomsday Algorithm II In Lab #2 you wrote a program to calculate a year's Doomsday One of the input items was the last two

image text in transcribed
3.5 Doomsday Algorithm II In Lab #2 you wrote a program to calculate a year's Doomsday One of the input items was the last two digits of the year. For example, for 2017 a user would enter 17 In this program you'll modify the input so that a user will input the full year, e.g. 2017, and your program will have to extract the last two digits to find a year's Doomsday Extraction can be done using the divmod() function. Recall that the equation for the Doomsday is given by Doomsday-(((yr // 12) + (yr % 12) + (yr % 12) // 4) % 7 + anchor) % 7 where yr is the last two digits of the year and anchor is an intege between 0 and 7 with 0 corresponding to Sunday and 7 to Saturday. The anchor dey for 1900-1999 is Wednesday (3) and the anchor day for 2000-2099 is Tuesday (-2), Write a program that calculates a years Doomsday Prompt the user for the four-digit year and for the anchor day as an integer. An example follows Enter the year in four digits: 2005 Enter the anchor day as an integer [0-Sunday, 7-Saturday]: 2 Doomsday1 ACTINIY 3.51. Doomsday Algorithm I 0/15 zypa2py

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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