Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

this needs no be in python format btw In Lab #2 you wrote a program to calculate a year's Doomsday. One of the input items

image text in transcribed

this needs no be in python format btw

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 integer between O and 7 with O corresponding to Sunday and 7 to Saturday. The anchor day 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 Doomsday 1

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

Oracle Solaris 11.2 System Administration (oracle Press)

Authors: Harry Foxwell

1st Edition

007184421X, 9780071844215

More Books

Students also viewed these Databases questions