Question: Your program should do the following: Part 1 : Open the file tasks.txt . zip Download tasks.txt . zipin read mode and get the tasks

Your program should do the following:
Part 1: Open the file tasks.txt.zip Download tasks.txt.zipin read mode and get the tasks
Download the linked tasks.txt.zip file above and unzip it. The .txt file contains the information about some tasks. Each line is for one task and it follows the format "id,description,project,date". You need to open the file in the read mode, process each line as we did before, and store the information.
Note:
Your program does not need to ask the user for the filename. You may hardcode the filename in the program. (But of course, you are not supposed to hardcode the data in the file.)
It's best to decide what datatype you want to use to store one task (list, dictionary, or class), and what datatype to use to store all tasks (list or dictionary). This will make the next part easier to work with.
Don't forget to unzip the txt file and put it in the folder as your Python program.
Part 2: Ask the user for the operation
Your program should support the following operations:
1. view all tasks
2. view tasks by date
3. view tasks by project
4. add a task
5. save tasks and quit
Your program needs to ask the user which operation they'd like to perform. If they enter an invalid operation, then your program should ask again. If they enter a valid operation, then your program should perform the operation (Part 3) and ask again until they choose the "quit" operation.
Note:
For simplicity, you can ask the user to enter numbers 1-5 for the corresponding operation instead of actually type the operation description.
This part will end up being a very big while loop.
Don't write the code for the actual operation yet. That's for part 3. You can simply print the task name for now. Test your code and make sure this part is working before moving on.
Part 3: Perform the selected operation
---Check Monday 04/22 lecture recording (to be uploaded) for running examples---
The first three operations--view all tasks, view tasks by date, and view tasks by project--are easier to work with. Remember to print the tasks nicely for readability. The fourth operation--add a task--would depend on what datatype you used in Part 1 to store each task and to store all the tasks.
Operation 1: view all tasks
If the user selects this operation, your program should print all of the tasks nicely.
Operation 2: view tasks by date
If the user selects this operation, your program should ask the user for the date they want to see and then print the tasks due that date nicely. You may choose the format of the user input for the date. A simple string e.g."04/20/2024" is sufficient and you can compare it directly with the date information of each tasks.
Operation 3: view tasks by project
If the user selects this operation, your program should ask the user for the project they want to see and then print the tasks of the chosen project nicely.
Operation 4: add a task
If the user selects this operation, your program should ask the user for the details of the task: the ID, the description, the due date, and the project it belongs to, then add the task to all the tasks. By now, you should have a variable called tasks or all_tasks from Part 1 that stores all the tasks.
The IDs of the tasks should be unique. So when testing your program, make sure to add a tasks with an ID that hasn't been used yet. For simplicity, your program does NOT need to generate a unique ID automatically.
And no need to check if the date the user enters is valid.
Operation 5: save tasks and quit
If the user selects this operation, your program should write all the tasks to a file called new_tasks.txt, then say goodbye and terminate.
If the user didn't add any new tasks, the content of new_tasks.txt is the same as tasks.txt. If the user added task, new_tasks.txt should contain the information about the added tasks in the "id,description,project,date" form as well.
Note:
The user should be able to choose any of the operations 1-4 in any order and for as many times as they want. And if the user adds a task (Operation 4) and then views all tasks (Operation 1), your program should print all of the tasks, including the added ones.
Requirements
Your code should be well organized using functions, i.e.
Everything should be inside some function. No global variables.
Define at least three functions other than the main() function. So there should be at least four functions in your program.
Do not import any module except for csv. We didn't learn about the csv module in class. It is not necessary for the project and it doesn't make the coding much easier. It just eliminates the split-by-comma process.
All the outputs from your program should be printed nicely and readable.

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 Programming Questions!