Create a class ÒDateÒ which has the data members Day, Month and Year.
Overload the input operator. Fill the three data members via the keyboard.
Check the following:
- The value for the month must be between 1 and 12
- The value for the day must be greater than or equal to 1
- The maximum value of the day depends on the month:
- January, March, May, July, August, October, December have a max. of 31 days
- April, June, September, November have a max. of 30 days
- February has a max. of 28 days (leap year is not checked)
- The year must not be negative
The input is to be made until a correct value has been entered.
Overload the output operator. Output the date in the following form: DD.MM.YYYYY
\ No newline at end of file
Create a class "Date" which has the data members Day, Month and Year.
Overload the input operator. Fill the three data members via the keyboard.
Check the following:
- The value for the month must be between 1 and 12
- The value for the day must be greater than or equal to 1
- The maximum value of the day depends on the month:
- January, March, May, July, August, October, December have a max. of 31 days
- April, June, September, November have a max. of 30 days
- February has a max. of 28 days (leap year is not checked)
- The year must not be negative
The input is to be made until a correct value has been entered.
Overload the output operator. Output the date in the following form: DD.MM.YYYYY