Question: Write a function called maxDate that takes in two arguments (I won't tell you what they are, but the notes below should cue you in
Write a function called maxDate that takes in two arguments (I won't tell you what they are, but the notes below should cue you in as to what they would be). That function should return an integer that declares the maximum number of days that month can have as an integer. Think about what would be the easiest thing for this type of function to receive from another part of the program.
Notes:
1. Different months have different numbers of available days
2. Certain months in certain years have a different number of available days. Those years are predictable. If it is divisible by 4, it is a leap year with a somewhat tricky exception: if it is divisible by 100 and not by 400, it is not a leap year. So 2000 is a leap year, but 1900 is not.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
