Question: python ( this is an introduction course) In this homework, you will plan your courses for the spring semester by using the offered courses list.

python ( this is an introduction course)  python ( this is an introduction course) In this homework, you
will plan your courses for the spring semester by using the offered
courses list. You are given the courses.txt file which consists of a

In this homework, you will plan your courses for the spring semester by using the offered courses list. You are given the courses.txt file which consists of a course list that has course code, course day (first two letters), and time (like 10.00). Your program should do the following (please make sure you have read all the pdf before coding): 1. First, it should open the courses.txt file and initialize the courses dictionary using the method initialize_dicto. Courses dictionary's keys will be the course codes. You are supposed to implement the values of this dictionary. You can figure out our implementation from the output. However, you are free to use other implementations as well. In the end, this dictionary should contain all the info in courses.txt. Note: initialize_dict( takes no parameters and returns a dictionary. 2- The program should check if there is a course_plan.txt file. If this file exists, you should read it and initialize my plan. If the file does not exist, then you should create an empty dictionary for my plan. In this dictionary, the day abbreviations ("Mo', Tu'. 'We', 'Th', 'Fr') should be the keys. For each day, the values should contain inner (nested) dictionaries. 3. Then, your program should ask the user what to do. User can add a course to their plan, remove a course from their plan or exit the program. 4- If the user chooses to add a course to their plan, your program should call add_course which does the following This method takes two parameters, courses dictionary which has the info about the courses offered, and my plan, which is the dictionary for the user's course program. It returns the updated version of my Iplan. b. Then, it asks the user which course they want to add. After getting the course code, you should its day and time from the courses 'dictionary. By using this info, program should add the course to the user's plan and return it. However, you should check 3 things before doing that i. If course code is not in the offered courses list, a message about it should appear and plan must remain unchanged. ii. If that course is already in the user's plan, a message about it should appear and plan must remain unchanged. iii. If there is another course in the plan at the same day and time, a message about it with the conflicting course code should appear and plan must remain unchanged. 5. If the user chooses to remove a course from their plan, your program should call remove_course from the main function which does the following: a. This method takes two parameters; courses dictionary which has the info about the courses offered, and my plan, which is the dictionary for the user's course program. It returns the updated version of my plan. b. It asks the user which course they want to remove. After getting the course code, you should find its day and time from the courses dictionary. Your function should remove the course to the user's plan and return my plan. However, you should check the following: i. If course code is not in the offered courses list, a message about it should appear and plan must remain unchanged. ii. If that course is not in the user's plan, a message about it should appear and plan must remain unchanged. 6. If the user chooses to exit your program should call one last method, write_plan_to_AY. a. This method takes one parameter, user's plan and does not return anything. b. You should write user's plan to the course_plan.txt file. File format is as shown in the sample on the last page. I c. You can write the list without sorting. 7. You are given helper functions in the starter file along with the methods you need to implement. You do not have to use these helper methods, but they might come in handy. Read their comments and implement and use them if you will. You can also add your own functions and do not use these at all. COMP100 Mo 10.00 UNIV199 We 12.00 COMP341 Th 12.00 MECH204 Mo 10.00 COMP 442 Mo 16.00 ENGR421 Mo 08.00 PSYC100 Fr 12.00 HUMS120 Th 10.00 MAVA104 We 16.00 ECON201 We 12.00 MKTG201 Fr 10.00 PHYS102 Tu 14.00 ETHC113 Tu 08.00 INDR2 61 We 14.00 PSYC206 Fr 08.00 HIST300 Th 14.00 MATH102 Th 08.00 MBGE200 Fr 12.00 ELEC491 Tu 16.00 h

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!