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 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.

Respuesta :

First and last names are kept in the class personType. Let's say we wish to maintain track of a person's date of birth and personal identification number (like a Social Security number).

Create a new class named personalInfo with a member object of type personType since each person has a unique Identification and birthdate. Add more members to the class personalInfo to store the member ID and birthdate. To start, create a different class called dateType that solely stores a person's birthdate. After that, combine the classes personType and dateType to create the class personalInfo. You can show how to define a new class by combining two existing classes in this manner.

Learn more about identification here-

https://brainly.com/question/4922594

#SPJ4