Computer science Python program

Project Specifications
Registration Department is the responsible department to plan the schedule for the final tests. In this take-home test, you will behave like a specialist from the Registration department, and you will implement a Python program that will generate a sorted table of a student’s final tests. You will be given two input files. The first file will contain the student IDs and the courses that each student is enrolled in, while the second file will contain the final test schedule. Your program will read the information from these files and take a student number as an input. Thereafter, your program will generate the final test schedule for the given student structured as sorted with respect to the date and time of the tests for the courses that the student is enrolled in. The list of tests in the schedule to be displayed will contain the CRN numbers of the courses, the course names, the final test dates and the final test times. The details of the input files and format are given below.
Inputs
There are two input files, the details of which are explained below.
Student-Courses File
The first input file (courses.txt) contains the student-course information, which includes the student ID numbers and the CRN numbers of the courses for which the students are enrolled in. Each line of this file has one student ID and all the courses that this student is enrolled in.
This file has the following structure:
StudentID1 CourseCRN1 CourseCRN5 CourseCRN7 CourseCRN9
StudentID2 CourseCRN3 CourseCRN4 CourseCRN5
StudentID1 CourseCRN3 CourseCRN4 CourseCRN2

Here, StudentIDxis the ID of a particular student and CourseCRNyis the CRN of a particular course.
Each student ID and course CRN are separated with a space character (” “). Note that you cannot make any assumptions about the lengths of student IDs or CRN numbers, these numbers can have any length.
A student can be enrolled in several courses, which means that there can be several CRNs on the same line. You cannot make any assumptions on the number of courses in one line, but you can assume that a student will be enrolled in at least one course.
Also, it is not guaranteed that a student ID will occur only once in this file. In other words, student IDs in each line may not be unique. When there is a student ID occurring more than once, it means that a student was enrolled in some other courses later and that particular student should see the final test schedule for all of his enrolled courses only for once. You may assume that no duplicate CRN numbers will be listed in a particular student’s courses list.
There is no specific order of students and/or courses in this file, which means that you cannot assume that the records of this input file are ordered according to any data attribute.
This file can contain any number of students, which means you cannot make any assumptions on the number of lines of this file.
For a sample input file, you may check out the courses.txt provided with this assignment.
Add/Delete inStudent-Courses File
A user should be able to add to the courses file (courses.txt) by entering in the program student ID and their courses. A user should be able to delete a student’s record by supplying the program with a student ID.
Final Schedule File
The second input file (finals.txt) contains the final test schedule. For each final test, there are four pieces of information on the same line, each separated by a single tab character (“\t”).
Each line of this file has the following structure:
CourseCRN CourseName Date Time
CourseCRNis the ID of the course, which is also used in the first input file. As mentioned before, you cannot make any assumptions on the lengths of these CRN numbers.
CourseNameis the name of the course (i.e. EE100), which can contain letters and numbers. You cannot make any assumptions on the length of a course name.
Date is the date of the final test of that course; it will be in the form of “YYYY.MM.DD”.
Time is the time that the final test will take place; it will be in the form of “HH:MM-HH:MM”.
There is no specific order of finals in this file, which means that you cannot assume that the records of this input file are ordered according to any data attribute.
The file can contain any number of courses, which means you cannot make any assumptions on the number of lines in this file.
For a sample input file, you may check out the finals.txt and finals2.txt provided with this assignment.
You do not need to perform any checks on the contents of the input files.
User Inputs
The names of the input files will be a keyboard input. In other words, your program will prompt for the names of these input files. You may assume that the user will enter the file names correctly. Your program will process these input files and ask for a student ID. It will keep asking for a student ID until the user enters a correct ID, which exists in the student IDs in the first file.
Please note that we will use some other file names while grading your project.
Processing and Output
Your program will read the files and store the data in dictionaries. Then, it will print the final schedule of the student who has the student ID from the last input. The schedule should be sorted according to the dates and times of the final tests. First, you need to sort them according to the date; if two tests are on the same day, then you should sort those tests according to their time. You can assume that a particular student will not have two tests scheduled exactly at the same date and time.
As the first line of the output, your program should print the following line:
Final test schedule of student with ID studentID:
Then, at each other line of the output, your program should display 3 pieces of information: (1) course name, (2) test date and (3) test time. There should be a tab character (“\t”) between each piece of information. Therefore, each line of the output, except for the first line, will have the following format:
courseName1 date1 time1
Then, your program will print the CRN numbers of the courses for which there are no final tests, in the order of they exist in the courses.txt file. The format of this output part will be as follows:
Courses without a final test: courseCRN1, courseCRN2, …, courseCRNN
If all courses of the student have a final test, the program will not print the above line.
Hint: You can use the sort() method on list objects
If you accumulate the date and time information of the tests to be displayed in a list variable appropriately, then you can use the sort() method on that list, which will sort the string elements alphabetically in ascending order. You may see a simple testple below.
myList = [“Salem”, “Abdullah”, “Rashid”]
myList.sort()
print(myList) # output: [‘Abdullah’, ‘Rashid’, ‘Salem’]
Must use functions.
We highly recommend the use of dictionaries.
We are very aware that this take-home test can also be done by:
1) Using multiple lists instead of a dictionary, which makes the implementation much more complicated.
2) Using files only by parsing several times, which is very inefficient.
We would like to remind that dictionaries would be an important part of the project.
3) Global variables are not allowed. Students should learn how to pass parameters to functions and receive results.
Sample Runs
Below, we provide some sample runs of the program that you will develop. The italic and bold phrases are inputs taken from the user. You have to display the required information in the same order and with the same words and characters as below.
Sample Run 1
Please enter filename for the courses list: courses.txt
Please enter filename for the finals list: finals.txt
Please enter a student ID: 9568
Final test schedule of student with ID 9568:
CS306 2019.05.23 09:00-12:00
EE202 2019.05.23 16:00-19:00
CS201 2019.05.24 12:30-15:30
CS300 2019.05.24 16:00-19:00
CS210 2019.05.28 16:00-19:00
Courses without a final test: 20110, 20111, 201115
Sample Run 2
Please enter filename for the courses list: courses.txt
Please enter filename for the finals list: finals2.txt
Please enter a student ID: 11530
Final test schedule of student with ID 11530:
HIST191 2019.12.23 09:00-12:00
IF100 2019.12.24 09:00-12:00
MATH102 2019.12.28 09:00-12:00
ECON204 2019.12.30 12:30-15.30
NS213 2020.01.03 16:00-19:00
Courses without a final test: 10300, 10111
Sample Run 3
Please enter filename for the courses list: courses.txt
Please enter filename for the finals list: finals2.txt
Please enter a student ID: 9712
There is no student with ID 9712
Please enter a student ID: 11111
There is no student with ID 11111
Please enter a student ID: 9713
Final test schedule of student with ID 9713:
CS300 2019.12.30 09:00-12:00
ECON204 2019.12.30 12:30-15.30
ENS202 2020.01.04 09:00-12:00
HUM203 2020.01.04 16:00-19:00