Skip to content
Snippets Groups Projects
Commit ec7af872 authored by Rudi Buss's avatar Rudi Buss
Browse files

Update Exercise 3 - Date.txt

parent 5cf3786e
No related branches found
No related tags found
No related merge requests found
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment