Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CS 241: Advanced Object-Oriented Programming using C++ Spring 2021 Homework 5 A new domestic charter airline company is asking you to develop a Flight Information

image text in transcribedimage text in transcribed

CS 241: Advanced Object-Oriented Programming using C++ Spring 2021 Homework 5 A new domestic charter airline company is asking you to develop a Flight Information System to manage their charter flights service. The program should allow the user to: add new flight information display flight information - edit existing flight information - delete a flight The system should store the following data items for each flight: flightNo: It is an integer number that uniquely identifies the flight. origin: A three-letters string used to store the code for the city of departure of the flight. For example, HOU for Houston, LAX for Los Angeles, SEA for Seattle, etc. destination: A three-letters string used to store the code for the flight destination city. For example, HOU for Houston, LAX for Los Angeles, SEA for Seattle, etc. departure: A five-letters string that holds the departure time of the flight. The format of this string is HH:MM where HH is the departure hour and MM is the minutes part of the time. The hour part should be in the 24 hours format, i.e. there is no am or pm in the time string. For example, 10:35 is used for 10:35am in the morning and 16:50 is used for 4:50pm. arrival: A five-letters string that holds the arrival time of the flight. The format of this string should be similar to the departure time string. Your program should display a menu with the available options and ask the user to select an option. The following is an example of how the menu should look like. Flight Information System 1. Display Flight Information 2. Add New Flight 3. Edit Flight Information 4. Delete Flight 0. End Program Please enter your choice (o to exit): Programming Guidelines: Use a structure to hold the data items of the flight information. The data type and size for each member of the structure should be according to the specifications given above for the flight data elements. Call this structure flightInfo. Use an array of the flightInfo structure to store the flight information up to 20 flights. If the user enters a selection that is not in the menu, the program should display "Invalid Selection. Please tray again...." and waits for a valid selection. In the above menu example, only 1, 2, 3, 4, and 0 are the valid selections. Anything other than that is invalid and should be rejected by the program. Use the switch - case statement to implement the processing of the meu selection. The program should keep track of the current number of flights in the system. If the user tries to add a new flight when the system has the maximum number of flights (20), it should display a message saying that the maximum capacity has been reached. Each time a flight is deleted from the inventory, the current number of flights in the systems should be reduced to reflect this transaction. For the menu options for display flight; edit flight; and delete flight, the program should ask the user to enter the flight number for the flight needed to be displayed, edited, or deleted respectively. If the flight number entered by the user is not found in the system, it should display a message saying that this is an invalid flight number and waits for a valid flight number. When the user is entering the flight number, you should provide a way of aborting this step and going back to the main menu. For example: Please Enter the Flight Number or -1 to return back to the main menu. Design your program to be modular by having functions that perform each selection from the menu. For example, you can have a function called addFlight to implement the task of adding a new flight. Similarly, you should have a function for the other options of the menu. Do not use global variables. Each function should use its local variables and the arguments passed to it from main. Part of your grade will be for the programming style used. Here are some guidelines: Each program should begin with a comment section giving the name of the file, the author's name, the date the file was last modified, and a description of its purpose. In addition, it is also considered good programming practice to include any assumptions you have made and any error-checking that has been provided. For example

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

9th Edition

ISBN: B01JXPZ7AK, 9780805360479

More Books

Students also viewed these Databases questions

Question

What are some of the possible scenes from our future?

Answered: 1 week ago