Question: C++ Write a function, named isDate(), that takes three integer arguments representing a calendar date as month, day, and year. The function returns a bool

C++

Write a function, named isDate(), that takes three integer arguments representing a calendar date as month, day, and year. The function returns a bool true if the date is valid and returns false if the date is invalid. The function does not read any input or write any output.

The date is valid if the year is between 1600 and 2400, inclusive, the month is between 1 and 12, inclusive, and the day is within the appropriate range for the month. The isDate() function must call the daysInMonth() function to determine the number of days in a month. The function, isDate(), does not have any input or output statements in it.

Write a main() function to input a date (as three integers, month, day, and year), call the

isDate() function and write the output.

Sample Output:

Input Date: 02-09-1995

VALID!

Input Date: 06-31-1993

INVALID DATE!

Input Date: 10-01-2000

VALID!

Input Date: 13-15-1999

INVALID DATE!

Always print two digits for the month and day, and separate the month, day, and year with

hyphens. If the date is invalid, write INVALID DATE on the same line after the date, but if the date is valid, write "VALID!".

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!