Question: C++ Program Provide the appropriate methods to set and get data for each of these class variables. For example setScheduleDate(string scheduleDate) and string getScheduleDate(). The
C++ Program
Provide the appropriate methods to set and get data for each of these class variables. For example setScheduleDate(string scheduleDate) and string getScheduleDate().
The main program must provide the following functionality:
1. When the program is first started, it must read a data file called schedule.dat. The program will not prompt the user for the name of the data file. The name of the file must be hard-coded in the program. If the file exists, the program will load the data for each schedule into the global linked list. If the file does not exist, the program will start with an empty linked list.
2. The program will provide a simple text-based user interface that manages the all of the train schedules within a linked list. Each schedule must be placed in the linked list as an object that holds all of the attributes associated with it as mentioned above. The user interface will allow the user to perform the following:
. (a) EnterSchedule allows the user to enter all of the fields associated with a given train schedule, except for the scheduleId, which will be automatically generated by the program as previously mentioned. After the fields are entered, the program will place the schedule object in the global linked list.
. (b) DisplayAllSchedules displays all of the schedules within the linked list along with their associated fields. In addition, this option must print the total number of schedules in the linked list.
. (c) SearchforSchedule allows the user to find a schedule by its schedule identifier. The program will prompt the user to enter the scheduleId and will display all of the fields associated with the given schedule, if it is found. The program must display an error message if the schedule is not found in the linked list.
. (d) EditSchedule allows the user to edit the fields for a given schedule that is in the linked list. The program must prompt the user to enter the scheduleId as the key to find the schedule to edit. Print a message if the schedule is not found in the linked list. For simplicity, the program may re-prompt the user to re-enter all of the fields associated with the given schedule; however, it must reuse the scheduleId value.
. (e) DeleteScheduleallows the user to delete a schedule from the linked list using the scheduleId as the key. The program must display a message if the provided scheduleId does not find an associated schedule in the linked list.
. (f) ExitSystem before the program exits, it must save all of the data in the linked list to the data file. I recommend using a standard text file with one field in the object per line. At this point, if the file does not exist, the program will create it.
**UPDATE** The data file is basically a text file that contains the following information for each train:

An integer variable to hold the schedule identifier. This must be a randomly generated 10-digit number. The scheduleId is aunique identifier for each train schedule in the linked list and repeats are not allowed scheduleId - A string variable to hold the date that the schedule will take effect. The date must be in the form mm/dd/yyyy. Where mm is the two digit month, dd is the two-digit day, and yyyy is a four-digit year Input Validation Required: The program must re-prompt the user to re-enter the date if it is not the valid format provided above. scheduleDate - An integer variable to hold the number of days that the schedule will be valid Input Validation Required: The program must re-prompt the user to re-enter the number if it is not greater than 0. . scheduleDays - trainNumber- An integer variable to hold the train number. A string variable to hold the name of the station of origin. Note that spaces must be allowed in the string . originStation - A string variable that will hold the time that the train will depart from the station of origin. This variable must be in the form HHMM, where HH is a number from 00-23 and MM is a number from 00- 59 Input Validation Required: The program must re-prompt the user to re-enter the time if it is not the valid format provided above . origDepartureTime - A string variable to hold the name of the destination station, Note that spaces must be allowed in the string destinationStation - A string variable that will hold the time that the train will arrive that the destination station. Input validation is recommended but is not required. This variable should be in the form HHMM arrivalTime - A string variable that will hold the time that the train will depart from the station. Again, input validation is recommended but not required here. This variable should be in the form HHMM departureTime
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
