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

  Analyze problem develop a solution

Analyze each problem, develop a solution and implement your solution. Copy and paste your program and a sample output below each problem.

  Create useful and well-designed programs

Create useful and well-designed programs that use subroutines, functions, menus, dialog boxes, and other related form objects to solve practical business problems.

  Write program to enter current value of car

Write a program that asks the user to enter the current value of a car. For a new car, it is the selling price of the car. The program should display the number of years it takes for the car's trade-in value to be below $1000.

  A local department store hires you to write down an

a local department store hires you to write an automated checkout program to expedite customers in a hurry. the

  Calculate the total number of jobs

Write a function that takes the name of a report file as its argument and returns the percentage value from the bottom table in the report - create a data frame with the year-month for each report in one column and the percentage values in another c..

  Create a application using the mvc architecture

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

  Write a phonenumber class

Write a PhoneNumber class that gets initialized with a 10-digit phone number. In the call PhoneNumber.new(ph), the input ph take any of these possible formats:

  Dishtinguish antigone and what you know of theban saga

How would you dishtinguish Antigone, and what you know of Theban saga, to Oresteia, and what you know of story of Mycenaean saga?

  Create nested menus interface for a check-in hotel

Create a nested menus interface for a check-in and check-out hotel reservation system that can be used internationally. Use numbers to select a menu item.

  Create program to counts number of bytes located in memory

Create the program which Counts the number of bytes located in memory from DS:1000h to DS:1200h which are greater than 77h. Put the count on register CX.

  Write pseudo algorithm to input age

Write a pseudo algorithm that inputs Age, displays "Yes, you can vote" if Age is 18 or older and displays "You are too young to vote" if Age is less than 18.

  Discuss inheritance from class bicycle from other closely

Show a class hierarchy in which the class bicycle inherits from other classes, which, in turn, can aslo be inherited from yet other classes; Discuss inheritance from class bicycle from other closely related derived classes.

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