Final answer:
The Date class should have attributes for day, month, and year, as well as methods to set the date and return a string representation. The Event class should have attributes for event date, name, start hour, and end hour, along with a method to return a string representation. Lastly, the main function can create a list of Event objects and provide options to add, cancel, or view events.
Step-by-step explanation:
Date Class
The Date class should have the following attributes: day, month, and year. It should also have a set_date method that sets the day, month, and year attributes of the object.
This method should not allow negative values, day to be greater than 31, and month to be greater than 12. The class should also have a __str__ method that returns a string representation of the date's information in the form "dd/mm/yyyy". Lastly, the class should have properties and setters for the attributes.
Event Class
The Event class should have the following attributes: event_date (which should be a Date object), event_name, start_hour, and end_hour.
The start_hour and end_hour should be values between 0 and 23, representing the hours in a 24-hour clock.
The class should also have a __str__ method that returns a string representation of all important information about the event. Lastly, the class should have properties and setters for the attributes.
In the main function, you can create a list that holds Event objects. You can continually give the user choices to add an event to the list, cancel an event, view all events, or quit the program.