Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using Python 3 : Compose a program dayofweek that accepts a date as input and writes the day of the week on which that date

Using Python 3 : Compose a program dayofweek that accepts a date as input and writes the day of the week on which that date falls.

Your program should as the user for three values: m(month), d (day), and y(year). For m use 1 for January, 2 for february, and so forth. For output write 0 for sunday, 1 for Monday, 2 for Tuesday, and so forth. Note: You can assume that the user is entering a valid date.

Use the following formulas, for the gregorian calendar:

y0=y-(14-m)/12

x=y0+y0 / 4-y0 / 100+y0 / 400

m0=m+12 * ((14-m)/12)-2

d0=(d+x+(31*m0) / 12) %7

Also note that all divisions in the formulas are integer divisions. They represent the quotient part of the division between the two operands.

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_2

Step: 3

blur-text-image_3

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

Advances In Databases And Information Systems 22nd European Conference Adbis 2018 Budapest Hungary September 2 5 2018 Proceedings Lncs 11019

Authors: Andras Benczur ,Bernhard Thalheim ,Tomas Horvath

1st Edition

3319983970, 978-3319983974

More Books

Students also viewed these Databases questions

Question

Question What is the doughnut hole in HSA coverage?

Answered: 1 week ago