#C14829. ToDo List Manager
ToDo List Manager
ToDo List Manager
You are required to implement a ToDo List manager that supports adding tasks, marking tasks as completed, and retrieving tasks based on their completion status. Each task consists of a title, a description, and a completion status. The manager will process a series of commands read from stdin. The commands are as follows:
• add TITLE DESCRIPTION: Adds a new task with the given TITLE and DESCRIPTION. The task is initially not completed.
• complete TITLE: Marks the task with the given TITLE as completed. If no task with that title exists, the program should raise an error.
• get_all: Outputs all tasks.
• get_completed: Outputs only the tasks that have been completed.
• get_not_completed: Outputs only the tasks that have not been completed.
When processing a get command, tasks must be output in the order they were added. Each task should be printed in the format TITLE,DESCRIPTION,(completed), where completed is either True or False. Multiple tasks in the same output should be separated by a semicolon and a space. If no tasks match the criteria, output "None".
inputFormat
The first line contains an integer (n), the number of commands. Each of the following (n) lines contains one command. The commands are formatted as below:
• add TITLE DESCRIPTION • complete TITLE • get_all • get_completed • get_not_completed
Note: TITLE and DESCRIPTION are strings without spaces (underscores may be used in place of spaces).
outputFormat
For every get command (get_all, get_completed, get_not_completed), print a single line on stdout containing the matching tasks. Each task should be printed as:
TITLE,DESCRIPTION,completed
(with completed being either True or False), and tasks should be separated by a semicolon and a space. If there are no matching tasks, print "None".## sample
5
add Buy_groceries Milk_Eggs_Bread
add Call_the_bank Inquiry_about_charges
get_all
complete Buy_groceries
get_completed
Buy_groceries,Milk_Eggs_Bread,False; Call_the_bank,Inquiry_about_charges,False
Buy_groceries,Milk_Eggs_Bread,True
</p>