Eagle Airlines has contracted you to implement a basic airline ticketing system for passengers. Your program will allow the application’s user to enter the information associated with each passenger. The ticketing system will be managed using a single linked list in memory (this can be a global variable). The program must use the “list” API in the C++ standard template library (STL).
All of the attributes associated with each passenger’s ticket will be stored as a single object within the linked list. The program must implement at least one class that will hold the following variables (input validation is only required where indicated):
2 recordLocator — A string variable that holds an automatically randomly generated eight character string. For example: XHJYQASY, AHJYQARE,·
etc. Duplicates are not allowed.
firstName — A string variable that holds the passenger’s first name.·
lastName — A string variable that holds the passenger’s last name.·
departureDate - A string variable in the form mm/dd/yyyy. The program must re-prompt the user to re-enter the date if it is not a valid form or·
if it is not a valid date.
arrivalDate - A string variable in the form mm/dd/yyyy.·
seatNumber — A string variable in the form NNL, where N is a number between 0 and 9 and L is a letter between A and F. The program must reprompt the user to re-enter the seat number if it is not a valid.·
numberOfLuggage — An integer variable that holds the number of luggage being checked.·
ticketCost — A double variable that holds the cost associated with the ticket.·
Provide the appropriate methods to set and get the data for each of these class variables. For example setTicketCost(double cost) and double getTicketCode(). The BookInventory provides an example on how this can be done. In addition, the main program must provide the following functionality:
1. When the program is first started, it must read a data file called tickets.dat. The program should not prompt the user for the name of the data file. If the file exists, the program will load the data for each ticket into the global linked list. If the file does not exist, the program will start with an empty linked list.
2. The program should provide a simple text-based user interface that manages the all of the tickets within the linked list. Each ticket must be placed in linked list as an object that holds all of the information associated with it. The user interface will allow the user to perform the following:
(a) Display Tickets – displays all of the tickets that are in the linked list along with their associated fields. In addition, this option must print the total number of tickets in the linked list and the total cost of all of the tickets in the linked list.
(b) Enter Ticket – allows the user to enter all of the fields associated with a given ticket, except for the recordLocator, which will be automatically generated by the program as previously mentioned. After the data fields are entered, the program will place the ticket object into the global linked list.
(c) Cancel Ticket – allows the user to delete a ticket from the linked list using the recordLocator as the key. The program must display a message if the ticket is not found in the linked list.
(d) Search for Ticket – allows the user to find a ticket. The program will prompt the user to enter the recordLocator and will display all of the fields associated with the ticket if it is found. The program must display a message if the ticket is not found in the linked list.
(e) Edit Ticket – allows the user to edit the fields for a given ticket that is in the linked list (except for the recordLocator). The program must use the recordLocator as the key to find the ticket to edit. For simplicity, the program may re-prompt the user to re-enter all of the fields associated with the given ticket; but it again must reuse the recordLocator value. Display a message if the ticket is not found in the linked list.
(f) Exit System – 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 per line. At this point, if the file does not exist, the program will create it.