Question: the class dateType was designed to implement the date in a program, but the member function setDate and the constructor do not check whether the
the class dateType was designed to implement the date in a program, but the member function setDate and the constructor do not check whether the date is valid before storing the date in the member variables. Rewrite the definitions of the function setDate and the constructor so that the values for the month, day, and year are checked before storing the date into the member variables. Add a member function, isLeapYear, to check whether a year is a leap year. Moreover, write a test program to test your class. Also check for a valid date and if a leap year. Use valid and invalid data and test a leap year and a year that is not a leap year.
Step by Step Solution
There are 3 Steps involved in it
To address the task youve outlined we will create a dateType class and implement methods to validate dates check for leap years and ensure that user i... View full answer
Get step-by-step solutions from verified subject matter experts
