Question: PYTHON Write a program that prompts the user to enter a year, month, and day, and computes its immediate successor. For example: if the user

PYTHON

Write a program that prompts the user to enter a year, month, and day, and computes its immediate successor. For example:

if the user enters September 19, 2018, your program should print out September 20, 2018.

if the user enters September 30, 2018, your program should print out October 1, 2018.

if the user enters December 31, 2018, your program should print out January 1, 2019.

Input:

Your program should ask the user for the year (an integer), the month (a string), and the day (an integer), in that order.

Your program does not need to validate the input; that is, you can assume that the user has entered valid values for the year, month, and day.

Your program DOES need to check for leap years! If the user enters a date of February 28 and the year is a leap year, the next day should be February 29. If the year is not a leap year, the next day is March 1. Use the code in section 4.12 of the textbook to help you determine if a year is a leap year.

Expected output:

Format your output so that, if the user were to enter September 19, 2018, your output would look exactly like the following:

Please enter the year: 2018 Please enter the month: September Please enter the day: 19 The next day is September 20, 2018.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!