Displays all of the tickets that are in the linked list

Assignment Help Programming Languages
Reference no: EM131321719

Assignment

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.

Reference no: EM131321719

Questions Cloud

Develop a disaster plan for the lab : Based on your plan in (4) above, develop a rescue plan for the lab by developing a list of tools needed by the lab for disaster recovery, when needed.
Demographic trends that underlie the social changes : In a report of 4-5 pages, discuss the following: Demographic trends that underlie the social changes of the past quarter-century and How these demographic trends affect health care in the United States
Money will be in account after you made last payment : You plan to buy a house in 8 years. You want to save money for a down payment on the new house. You are able to place $407 every month at the end of the month into a savings account at an annual rate of 12.17 percent, compounded monthly. How much mon..
Identify three proposals for its capital budget : Compute the net present value of the new machine using the tables in Exhibits 26-3 and 26-4 - What nonfinancial factors should EnterTech consider?
Displays all of the tickets that are in the linked list : 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.
Constant velocity after the collision : A 1000-kg aircraft going 25 m/s collides with a 1500-kg aircraft that is parked. They stick together after the collision and are moving at 10 m/s. If they skid for 9.7 seconds before stopping, how far (in meters) did they skid? Hint: Are the aircr..
Difference in sound level : The normal human ear can distinguish a difference in sound level of about 0.6 dB at a given frequency. What is the percentage of power increase required to raise the sound level 0.6 dB?
Separate market risk from unique asset risk : Why is it important to separate market risk from unique asset risk? Can market risk be segmented and measured differently than just looking at index benchmarks?
Filled with methane gas at a concentration : A large tank is filled with methane gas at a concentration of 0.740 kg/m3. The valve of a 1.70-m pipe connecting the tank to the atmosphere is inadvertantly left open for 16.0 hours.

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd