Question: . In this chapter, the class dateType was designed to implement the date in a program, but the member function setDate and the constructor do
. In this chapter, 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 data members. Rewrite the definitions of the function setDate and the con- structor so that the values for the month, day, and year are checked before storing the date into the data members. Add a function member, isLeapYear, to check whether a year is a leap year. Moreover, write a test program to test your class.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
