Homework Questions? Ask a Tutor for Answers ASAP
For ATLProg only
Create a simple electronic runner’s journal that allows a user to log a list of runs. Your program must use the “list” API in the C++ standard template library (STL). Your program must keep track of a list of attributes associated with each run in a global linked list data structure. The program must implement at least one class, which will hold the following class variables: • An integer variable to hold an identification number associated with the log entry. This must be a randomly generated number that contains exactly eight digits. For example, 12896123. Duplicate entries are not allowed. • A string variable to hold the date of the log entry. The entered date must be in the form mm/dd/yyyy. If the user enters an invalid date format, the program must print an error and reprompt the user to enter the date in the correct format. • A string variable to hold the time of day of the log entry (i.e. the time that the run will start). The entered date must be in the form hh:mm am or hh:mm pm. Again, if the user enters an invalidtime format, the program must print an error and re-prompt the user to enter the time in the correct format.• A string variable to hold the users goal. • A string variable to hold the current weather (e.g. rainy, cloudy, sunny, hot, cold, etc.). • A string variable to hold the name of the route. • A double variable to hold the distance of the run (in miles) • A string variable to hold the running time in the format hh:mm:ss. Provide the appropriate accessor methods to set and get the data for each of these class variables. For example getRoute() and setRoute(string route). The main program must provide the following functionality: 1. When the program is first started, it must read a data file called log.dat. If the file exists, the program will load the data for each log entry into the global linked list data structure. If the file does not exist, the program will start with an empty linked list. 2. Provide a simple text-based user interface that displays the name of your runner’s log and allows the user to operate on the global linked list of log entries. Each log entry must be placed in this global linked list as an object that will hold all of the information associated with each run. The program interface will allow the user to do the following: (a) Enter a run – allows the user to enter all of the fields for log entry associated for a given run, except for the identification field, which will be an automatically generated eight digit random number. After the data fields are entered, the program will place the log entry in the global linked list data structure. (b) Search for a run – allows the user to search for a log entry in the linked list based on a given date. The program should prompt the user to enter a data in the form mm/dd/yyyy. Display a message if there are no entries not found in the linked list for a given date. If there are multiple entries for a given date, the program should display all of the entries associated with that date. (c) Modify a run – allows the user to modify any of the fields for a log entry (except for the log identification number) in the linked list. Use the eight digit identification number as the key to find the entry to modify. Display a message if the log entry is not found in the linked list. (d) Delete a run – allows the user to delete a log entry from the linked list using the eight digit identification number as the key. Display a message if the item is not found in the linked list. (e) Display the log – displays all of the entries in the linked list. The feature will display all of the fields associated with the each log entry. It should also print the total number of miles for all of the entries in the linked list. (f) Exit program – before the program exits, it must save all of the data for each log entry that is contained within the linked list into the log.dat data file. At this point, if the file does not exist, the program will create it.