Question: IN C++ Write a function that takes the month, day and year of a date and an array of integers that contains the number of
IN C++ Write a function that takes the month, day and year of a date and an array of integers that contains the number of days in each of the 12 months and returns true if the date is a valid date and false if it's not. The month of February has either 28 or 29 days, depending on whether it's in a leap year or not. A year is a leap year if it's either divisible by 400 or by 4 but not by 100. Write the main program where you read a date from the user in month/day/year format and pass the month, day, year and the array of days to the function and print the validation result. The days array which is used to validate the day of the month has the following number of days: 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 which are the number of days in each month from January to December. Example: Enter a day in month/day/year format: 11/31/2017 11/31/2017 is an invalid date. Press any key to continue.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
