Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Python program to find out number of days in a month. Your program will ask user to enter month and year and display

Write a Python program to find out number of days in a month. Your program will ask user to enter month and year and display number of days of that month.

1. Need to figure out whether the years is a leap year or not.

2. Depends on the result of the step 1, number of days for Feb. will be different.

Use functions (finding leap year, finding days in a month).

After producing the output, ask users whether to repeat it or not. If user wants to repeat, ask year and month again and produce the output. Repeat it until user wants to stop. Also, if user enters the wrong month, your program needs to inform the user of the invalid input and ask for a valid month input.

Leap year calculation: If the year is divisible by 4, it is a leap year. But if it is divisible by 100, it is not a leap year. Also, if the year is divisible by 400, it is a leap year.

Your program's output should be exactly same or very close to the sample output provided. Output should be formatted to match the sample output provided or points will be deducted (up to 8 points).

Make sure you have comments in your program.

Grading Policy:

If it doesn't run (any error): at least 50% point deduction.

Improper code formatting or lack of appropriate comments: 10% to 30% point deduction.

If it doesn't produce the required result: at least 30% point deduction.

If your source code file contains the topics that haven't been discussed in class, you will loose at least 30% of points.

Late submission will get 20% to 40% point deduction.

======================================

Sample output

======================================

Please enter the 4 digit year: 1969 Please enter the month: 2 Year 1969 Month 2 has 28 days in a month Do you want to repeat? (Y/N)y

Please enter the 4 digit year: 2020 Please enter the month: 2 Year 2020 Month 2 has 29 days in a month Do you want to repeat? (Y/N)n

Thank you for playing! >>>

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

More Books

Students also viewed these Databases questions

Question

Apply your own composing style to personalize your messages.

Answered: 1 week ago

Question

Format memos and e-mail properly.

Answered: 1 week ago