Question
A leap year is defined as any calendar year which meets the following criteria: If the year is not divisible by 4, it is a
A
leap year
is defined as any calendar year which meets the following criteria:
If the year is not divisible by 4, it is a common year
If the year is not divisible by 100, it is a leap year
If the year is not divisible by 400, it is a common year
Otherwise it is a leap year
For your program you will take in three integers from the user:
A four digit year
The day of the month (between 1 and 31)
The month (between 1 and 12, 1 representing January and 12 representing December)
Your program will output whether or not the date entered is a valid calendar date.
Be sure to divide your program into functions which perform each major task.
Hint
: There are 30 days in September, April, June and November. If the year is a leap year, there are
29 days in February. If the year is a common year there are 28 days in February. All other months
have 31 days.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started