Question: python 3.8 SAMPLE TEST QUESTION 3 10 marks (a) Write a series of classes that satisfy the following specification. * A To Do List

python 3.8

""" SAMPLE TEST QUESTION 3

10 marks

(a)

Write a series of classes that satisfy the following specification.

* A To Do List has a name (an arbitrary string), and zero or more tasks, which is provided when the list is created.

* New tasks can be added to the To-Do List, but the total number of tasks in the list must be 50 or less. Attempting to have more than 50 tasks in a list should cause a TaskOverloadError.

* Each task has a day, month, and year, provided when the task is created. The day must be an integer between 1 and 31, the month must be an integer between 1 and 12, and the year must be greater than or equal to 2021. An invalid day, month or year should cause an InvalidDateError.

* A task also has details about itself in a string (e.g. "date with Jane") provided when the task is created. """

# TODO Write your classes code

"""

(b)

Write code in the __main__ block below to perform the following:

* Create a To-Do List named `School` with an empty list of tasks.

* Prompt the user for a day (reminder: use the builtin input function).

* Prompt the user for a month.

* Create a task with the detail `Ace CSC569 test` using the given day and month, and the year 2021. Add this task to the To Do List that was created earlier. ** If this raises an InvalidDateError, print `invalid date` ** If this raises a TaskOverloadError, print `too many tasks` """

if __name__ == '__main__':

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!