Write this program with Python. Ask the user to enter a month with Zeller’s Algorithm, in text (e.g. “March”). The algorithm needs the number for the month, where March is 3, April is 4, … December is 12, January is 13, and February is 14. Call this number A. You must check that the user has entered a valid month name, and convert it to the appropriate number. If the user has not entered a valid month, ask them to try again, until they do enter a valid month. This algorithm uses January & February as months 13 and 14 of the preceding year, meaning that for those months you will need to subtract 1 from the year the user enters below. Ask the user to enter the day of the month (e.g. 4). Call this number B. Confirm that the day is valid for the month that was previously entered (e.g. do not accept 30 for February). Ask the user to try again if necessary. Ask the user to enter a year. Zeller’s algorithm has limitations but let’s assume it works for any four-digit year (1000 to 9999). Ask the user to try again if they do not enter a four-digit year. The year should be broken into C, the year within the century (e.g. 14 for 2014), and D the century (e.g. 20 for 2014).
Write this
month, where March is 3, April is 4, … December is 12, January is 13, and February is 14. Call
this number A. You must check that the user has entered a valid month name, and convert it to the
appropriate number. If the user has not entered a valid month, ask them to try again, until they do
enter a valid month.
This algorithm uses January & February as months 13 and 14 of the preceding year, meaning that
for those months you will need to subtract 1 from the year the user enters below.
Ask the user to enter the day of the month (e.g. 4). Call this number B. Confirm that the day is
valid for the month that was previously entered (e.g. do not accept 30 for February). Ask the user
to try again if necessary.
Ask the user to enter a year. Zeller’s algorithm has limitations but let’s assume it works for any
four-digit year (1000 to 9999). Ask the user to try again if they do not enter a four-digit year.
The year should be broken into C, the year within the century (e.g. 14 for 2014), and D the century
(e.g. 20 for 2014).
Your program should convert dates as long as the user wants. Ask the user if they would like to
enter another date, and repeat the above, until the user indicates they want to stop.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps