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 Blue-Sky 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 check-in report
Exit Quits the program
REQUIREMENTS:
1. You must use a single linear linked list to store your costumers information.
2. You must develop a design document (pseudo code/data flow diagram)
3. Your program must produce a correct result if input is correct, otherwise an error message should be given.
4. You must comment your program properly (including proper comments and program synopsis). You may suffer up to 20% percent penalty if you failed to do so.
5. You must put your functions and variables together to form a classreservation.
6. You need to have two classes: linked list and reservation.
7. You should turn your project on time; otherwise you will suffer 10% deduction per day.
8. This is a team project. Each team only need to turn in one complete project.
Your reservation class may look like:
#ifndef RESERVATION_H_
#define RESERVATION_H_
#include
#include // to open database file
#include
using namespace std;
#include "linked_list.h"// linked_list 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();
// linked_list is initialized to database
private:
linked_list 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 <<"
\t\tMenu
";
cout <<"\t 1\tEnter a reservation
";
cout <<"\t 2\tCancel a reservation
";
cout <<"\t 3\tPrint a passenger list
";
cout <<"\t 4\tSearch for a passenger
";
cout <<"\t 5\tChange Reservation Seat
";
cout <<"\t 6\tChange Reservation Food
";
cout <<"\t 0\tEXIT
";
cout <<"
Enter your choice: ";
cin >> choice; // user input
return choice[0]; // 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 '0', then the loop will terminate.*/
{
bool done = false; // done boolean
do{
char choice = menu(); //get the choice from the user
switch(choice)
/*this switch compares the choice entered
by the user to determine which function
to call.
*/
{
case '1': insert(); break;
case '2': remove(); break;
case '3': print(); break;
case '4': search(); break;
case '5': changeSeat(); break;
case '6': changeFood(); break;
case '0': done = true; break;
default: cout << "INVALID INPUT" << endl;
}
} while(!done); // 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 0;
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!