Question: Focus on: Linked Lists, Dynamic Memory Allocation, and Object Oriented Programming Task: Assume the Blue - Sky airlines use a linked list to maintain records
Focus on: Linked Lists, Dynamic Memory Allocation, and Object Oriented Programming
Task: Assume the BlueSky airlines use a linked list to maintain records for all passengers on its one and only flight. This list has a node for each passenger and passengers records are maintained in the alphabetical order by passengers last name. Each passenger node may contains the passenger first name, last name, address, passenger ID reservation No telephone number, seat number, and menu preference. Possible transactions may include but not limit to:
Function Name functionality
Main menu Show transaction choices
Make a Reservation Add a passenger to the list
Cancel a Reservation Delete a passenger from the list
Search for a Passenger Search for a special passenger by ID If the passenger is found, then shows passengers information otherwise prints Not found
Change Reservation seat change seat number. NOTE: No any seat numbers can be used more than once.
Changing Reservation food Change food
Print Passengers list Prints all passengers information
Produce reports Produces a food report and checkin report
Exit Quits the program
REQUIREMENTS:
You must use a single linear linked list to store your costumers information.
You must develop a design document pseudo codedata flow diagram
Your program must produce a correct result if input is correct, otherwise an error message should be given.
You must comment your program properly including proper comments and program synopsis You may suffer up to percent penalty if you failed to do so
You must put your functions and variables together to form a classreservation
You need to have two classes: linked list and reservation.
You should turn your project on time; otherwise you will suffer deduction per day.
This is a team project. Each team only need to turn in one complete project.
Your reservation class may look like:
#ifndef RESERVATIONH
#define RESERVATIONH
#include
#include to open database file
#include
using namespace std;
#include "linkedlist.h linkedlist class
class reservation
public:
reservation;
constructor initializes data to database
char menu;
reservation system menu
void start;
starts user input
void search;
allows user to display specific passenger info
void insert;
allows user to make a new passenger reservation
void remove;
allows user to cancel a reservation
void print;
prints list of all passengers
void changeFood;
user can change food preference of passenger
void changeSeat;
user can change seat of passenger if available
void copyDatabase;
linkedlist is initialized to database
private:
linkedlist mine;
declare an object of the linked list class
int id;
stores id for search functions
;
#include "reservation.cpp implementation for class
#endif
Your menu function may look like:
char reservation::menu
This is the menu for the user. The menu displays the choices the user has. The user will enter a character, and that character will be returned to be used in the start function of the reservation class.
string choice;
cout
ttMenu
;
cout t tEnter a reservation
;
cout t tCancel a reservation
;
cout t tPrint a passenger list
;
cout t tSearch for a passenger
;
cout t tChange Reservation Seat
;
cout t tChange Reservation Food
;
cout t tEXIT
;
cout
Enter your choice: ;
cin choice; user input
return choice; returns user input
Your start function may look like:
void reservation::start
once this function is called, a loop will be created that allows the user to input how they want the list to be manipulated. Functions include insert, remove, print,search, changeSeat, and changeFood. If user enters then the loop will terminate.
bool done false; done boolean
do
char choice menu; get the choice from the user
switchchoice
this switch compares the choice entered
by the user to determine which function
to call.
case : insert; break;
case : remove; break;
case : print; break;
case : search; break;
case : changeSeat; break;
case : changeFood; break;
case : done true; break;
default: cout "INVALID INPUT" endl;
whiledone; if done, then quit, else continue
cout
Thank you for using my simulation." endl;
Your main function may like the following:
int main
reservation bluesky;
bluesky.start;
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
