Question: USING PYTHON NOTE: Dont use any really sofisticated since it is only the second homework. IF is the topic covered but I cant figure out
USING PYTHON
NOTE: Dont use any really sofisticated since it is only the second homework. IF is the topic covered but I cant figure out how to do it correctly
Dont be intimidated by the Math for this question! The process of calculation is simple. We dont need to know anything about the Zillers rule to write this program. Mr. Ziller developed a formula to calculate the day of the week. You tell the formula what it needs, it comes back with the day of the week. Make sure the prompts are very descriptive.
H = (q + 26(m+1)/10 + k + k/4 + j/4 + 5j) % 7
H is the calculated day of the week. 0: Saturday, 1: Sunday, ... 6: Friday. Your programshould output the name of the day and not the number.
q is the day of the month (1-31)
m is the month number (3: March, 4: April, ..., 12: December). January and February are counted as month 13 and 14 of previous year.MAJOR HINT: For January, your code must convert the user input to 13 and for February, your code must convert the user input to 14 and change the year to the previous year in both cases. I see a couple of nice and short if statements here.
j is the century (year / 100)
k is the year of the century (year % 100)
Note that the division in the formula should be integer division. Otherwise, the formula wont
Ask the user to enter a year, month number (m), and day of the month (q). Make sure to ask for the values in the given order.
f the month number is not a valid number between 1 and 12, issue an error message and do no not report the day of the week.
If the day of the month is not a valid number between 1 and 31, issue an error message and do no not report the day of the week.
Calculate and display the name of the day of the week.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
