Question
Read in a set of text files that contains the convenient times to start a class for each student (this project came about when we
Read in a set of text files that contains the convenient times to start a class for each student (this project came about when we were trying to find the best time to hold an online synchronous class during Covid). You will write code that:
Prompts the user to enter a name of a text file that has a list of the corresponding students preferred class time. The format of this file is described in detail below.
Once a file name is entered, your program needs to read in the file its entirety. The program should warn the user if the file cannot be opened or if the file contains improperly formatted data.
Each preferred start time provided in the files must be stored in a linked list, but you can use an array of pointers, one index for each day of the week.
Your code should not assume the times (or days in the week) in the file are in any particular order.
You should create a new node for every time found in any of the student schedule files. When you encounter multiple students selecting the same time, you should increment a counter in the corresponding node and maintain a list of all the students that chose the time for the given node. Recall each students schedule file will be named with their first name, so your program will know the student name to save in the name list associated with each node.
After all the student files have been read, your program should ask for the minimum number matches to display. Finally, your program should traverse all the linked list and show all the times that have the minimum number of matches, along with the list of students who matched.
Student preferred times file format
1) The file name of the text file matches the students first name
2) Each line of the file starts with <day>:
3)
4) times must be in military / 24 hour format with 30 minute granularity. Use .5 to represent starting the class at 30 minutes after the hour. For example 2:30pm would be represented with 14.5
5) Times are not in sequential order. example of .txt student file mon:9,9.5,10,11,12,13,14,15,15.5,16,16.5,17 tue:9,9.5,10,11,12 wed:9,9.5,10,11,12,13,14,15,15.5,16,16.5,17 thu:9,9.5,10,11,12 fri:9,9.5,10,11,12,13,14,15,15.5,16,16.5,17 sat:13,14,15,16,17 sun:13,14,15,16,17
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started