diff --git a/Part 2/6. Operator overloading/Exercises/Exercise 3 - Date.txt b/Part 2/6. Operator overloading/Exercises/Exercise 3 - Date.txt index 7c2126a68d440a3bae5807dc279bd885496dcd48..5771f684e75d8e1df9d78620bc3b8a78406506f4 100644 --- a/Part 2/6. Operator overloading/Exercises/Exercise 3 - Date.txt +++ b/Part 2/6. Operator overloading/Exercises/Exercise 3 - Date.txt @@ -1 +1,16 @@ -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