Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

For C++ Additonal Notes: :No Linear Programming(Function Protoypes) -Main Just S

ID: 3726730 • Letter: F

Question

For C++

Additonal Notes:

:No Linear Programming(Function Protoypes)

-Main Just Starts the engine/program

Thanks in advance for the help

Airline Reservation System

Overview

This program is to support the client-side of an airline reservation system for airline reservation agents. The program does not manage user accounts, it only shows status of the flights. It allows the reservation agent to perform basic functions such as book and cancel reservations, display information such as boarding passes and seat assignments on the flight.

NOTE: All data for flights, passengers, etc. should be read from a file at the start of the program. The program should only save data back to file when given a command by the user and when the program is exiting.

Detailed Description

The system should allow a user to perform the following functions:

Book a new reservation

Cancel a reservation

Display boarding pass for a passenger

Display flight schedule (sorted by any field)

Display available cities (sorted by name or code)

List passengers on a given flight and seat assignments (sorted by name or seat)

The airline has two types of aircraft. The type A plane irst has 5 rows. Each row has seats A, B, C, and D arranged as the following (The aisle is indicated with an X):

X

The second ptype of plane has 5 rows with seats A, B, and C in the following configuration:

The airline flies between the following cities:

The flight schedule is the same every day of the week. The following table contains the flight information to be used for reservations:

Frequent Flyer points

Your system must make sure that a flight is not overbook, and if a flight is booked it should suggest other flights to the same destination. The boarding pass should include the flight details including the seat number and the number of frequent flyer miles that can be earned.

Input

The input is all done via interactive data entry. You may use menus, commands, etc. The interface is your choice.

Output

Output is done to the screen, but the program should also save all data between execution using one or more files. This means that when the system restarts, the reservations that have been made should reload.

1A 1B

X

1C 1D 2A 2B X 2C 2D 3A 3B X 3C 3D 4A 4B X 4C 4D 5A 5B X 5C 5D

Explanation / Answer

include<iostream>
#include<iomanip>
#include<conio.h>
#include<string>
#include<windows.h>
#include<fstream>
using namespace std;

char destination[5][20]={"Atlanta","Orlando","Dallas/Fort Worth","New York City","Hawaii","Chicago","Los Angeles"}; char f_destination[5][20]={"Atlanta","Orlando","Dallas/Fort Worth","New York City","Hawaii","Chicago","Los Angeles"};

class void display()
{
if(choose==1)
{
cout<<"| " <<endl;
cout<<"|flight mytime 11 AM "<<endl;
cout<<"|_________________________________________________________________________"<<endl;
cout<<" GOOD BYE AND HAVE A SAFE JOURNEY "<<endl;

//here we use txt file
ofstream outfile;
outfile.open("E:\E_ticket.txt",ios::app);
outfile<<"| "<<endl<<
   "|flight mytime 11 AM "<<endl<<
"|_________________________________________________________________________"<<endl<<
" GOOD BYE AND HAVE A SAFE JOURNEY "<<endl;
}time
{
protected:
int choose;
public:
void getdata()
{
cout<<"ON WHICH TIME YOU WANT TO TRAVEL"<<endl;
cout<<"PRESS 1 FOR 11 AM"<<endl;
cout<<"PRESS 2 FOR 10 AM"<<endl;
cout<<"PRESS 3 FOR 9 AM"<<endl;
cin>>choose;
}

if(choose==2)
{
cout<<"| "<<endl;
cout<<"|flight mytime 10 AM "<<endl;
cout<<"|_________________________________________________________________________"<<endl;
cout<<" GOOD BYE AND HAVE A SAFE JOURNEY "<<endl;
ofstream outfile;
outfile.open("E:\E_ticket.txt",ios::app);
outfile<<"| "<<endl<<
   "|flight mytime 10 AM "<<endl<<
"|_________________________________________________________________________"<<endl<<
" GOOD BYE AND HAVE A SAFE JOURNEY "<<endl;
}
if(choose==3)
{
cout<<"| "<<endl;
cout<<"|flight mytime 9 AM "<<endl;
cout<<"|_________________________________________________________________________"<<endl;
cout<<" GOOD BYE AND HAVE A SAFE JOURNEY "<<endl;
ofstream outfile;
outfile.open("E:\E_ticket.txt",ios::app);
outfile<<"| "<<endl<<
   "|flight time 9 Am "<<endl<< "|_________________________________________________________________________"<<endl<<
" GOOD BYE AND HAVE A SAFE JOURNEY "<<endl;
}
}
};

class passenger
{
public:
virtual void getdata()
{
}
virtual void display()
{
}
};
class booking:public passenger
{
protected:
int num;
char ch;
char firstname[60];
char lastname[60];
char address[60];
char c_loc[30];
char dest[30];
char reservation_no[60];
int option;
public:

void getdata()
{
cout<<setw(40)<<" ::Please enter the required information for passenger number::"<<endl;  
cout<<" Enter the firstname of passenger: ";
cin.getline(firstname,60);
cout<<endl;
cout<<"Enter the lastname of passenger: ";
cin.getline(lastname,60);
cout<<endl<<endl;
cout<<"Enter address of passenger: ";
cin.getline(address,60);
cout<<endl<<endl;
cout<<"Enter the Resevation No. of Ticket"<<endl;
cin.getline(reservation_no,60);
cout<<endl;
cout<<"Enter the current location of passenger(IN CAPITAL LETTERS ONLY): ";
cin.getline(c_loc,60);
cout<<endl<<endl;
cout<<"Enter the destination of passenger(IN CAPITAL LETTERS ONLY): ";
cin.getline(dest,60);
cout<<endl<<endl;
system("CLS");
}

void display()
{
cout<<setw(40)<<"Your E-Ticket is :"<<endl;
int t=1;
int r=12345;
cout<<" AIRLINE TICKET "<<endl;
cout<<"|Ticket No."<<t<<" Reference No."<<r<<" "<<endl;
cout<<"|_________________________________________________________________________"<<endl;
cout<<"|Resevation No. :"<<reservation_no<<" "<<endl;
cout<<"|__________________________________________________________________________"<<endl;
cout<<"|Passenger Information : "<<endl;
cout<<"|Name :"<<lastname<<"/"<<firstname<<" "<<endl;
cout<<"| "<<endl;
cout<<"|Address :"<<address<<" "<<endl;
cout<<"|_________________________________________________________________________"<<endl;
   cout<<"|flight Information : "<<endl;
cout<<"|9march "<<endl;
cout<<"|BOING 747 "<<endl;
cout<<"|_________________________________________________________________________"<<endl;
cout<<"|Depart :"<<c_loc<<" "<<endl;
cout<<"|Arrive :"<<dest<<" "<<endl;
ofstream outfile("E:\E_ticket.txt");
outfile<<" AIRLINE TICKET "<<endl<<
"|Ticket No."<<t<<" Reference No."<<r<<" "<<endl<<
   "|_________________________________________________________________________"<<endl<<
"|Resevation No. :"<<reservation_no<<" "<<endl<<
"|__________________________________________________________________________"<<endl<<
   "|Passenger Information : "<<endl<<
   "|Name :"<<lastname<<"/"<<firstname<<" "<<endl<<
   "| "<<endl<<


   "|Address :"<<address<<" "<<endl<<
  "|flight Information : "<<endl<<
   "|Depart :"<<c_loc<<" "<<endl<<
   "|Arrive :"<<dest<<" "<<endl<<

t=t+1;
r=r+1;

}
};

class search
{
public:
void searching()
{
cout<<"FOLLOWING ARE THE INTERNATIONAL FLIGHTS AVAILABLE"<<endl;

for(int i=0;i<5;i++)

{

for(int j=0;j<10;j++)

{

cout<<"FLIGHT FROM "<< destination[i]<<" TO "<<f_destination[j]<<endl;
}
}
}
};

class local: public booking
{
protected:
int b_seat;
int e_seat;
int ch;
int k;
int p;
int option;
mytime t1;
public:
void getdata()
{
k=0;
p=0;
cout<<"In which AIRLINE you want to travel"<<endl<<endl;
cout<<"1)JET AIRWAYS"<<endl;
cout<<"2)AIR BLUE"<<endl;
cout<<"3)ARAB EMIRATES"<<endl;
cout<<"4)QATAR AIRWAYS"<<endl;
cout<<"enter your choice"<<endl;;
cin>>option;
system ("cls");
switch(option)

switch(option)
{
case 1:
if (option==1)
cout<<setw(40)<<" weLCOME TO PIA"<<endl;
break;
case 2:
if(option==2)
cout<<setw(40)<<" WELCOME TO AIRBLUE"<<endl;
break;
case 3:
if(option==3)
cout<<setw(40)<<" WELCOME TO ARAB EMIRATES"<<endl;
break;
case 4:
if(option==4)
cout<<setw(40)<<" WELCOME TO QATAR AIRWAYS"<<endl;
break;
}
cout<<setw(40)<<" THESE ARE THE LOCAL PLACES AVAILABLE "<<endl;
cin.ignore();

for(int i=0;i<5;i++)
{
cout<<f_destination[i]<<endl;
}
booking::getdata();
for(int j=0;j<5;j++)
{
if(strcmp(l_destination[j],c_loc)==0)
{
k++;
}

}
for( int i=0;i<5;i++)

{
if(strcmp(l_destination[i],c_loc)==0)

{

p++;

}

}
if(k==1&&p==1)

{

cout<<" FLIGHT AVAILABLE ON THIS ROUTE"<<endl;

b_seat=30;

e_seat=40;

cout<<"In which class you want to travel?"<<endl;

cout<<"Make your choice"<<endl<<endl;
  
cout<<" ";

cout<<setw(60)<<"*************************************"<<endl;
cout<<setw(60)<<endl;
cout<<setw(60)"<<endl;
cout<<setw(60);

cout<<"Enter your choice"<<endl;

cin>>ch;
  
cout<<endl;

switch(ch)

{

case 1:

b_seat--;

if(b_seat<=0)

cout<<"SORRY NO SEAT AVAILABLE"<<endl;

else

cout<<"SEAT AVAILABLE"<<endl;

break;

case 2:

e_seat--;

if(e_seat<=0)

cout<<"SORRY NO SEAT AVAILABLE"<<endl;

else

cout<<"SEAT AVAILABLE"<<endl;

break;

}
t1.getdata();

system("CLS");
booking::display();
if(ch==1)

{
cout<<"|Ticket Information: "<<endl;
cout<<"|BUISNESS CLASS "<<endl;

ofstream outfile;
outfile.open("E:\E_ticket.txt",ios::app);
outfile<<"| "<<endl<<
   "|Ticket Information "<<endl;
   "|BUISNESS CLASS "<<endl;
}
if(ch==2)
{
cout<<"|Ticket Information: "<<endl;
cout<<"|ECONOMY CLASS "<<endl;

ofstream outfile;
outfile.open("E:\E_ticket.txt",ios::app);
outfile<<"| "<<endl<<
   "|Ticket Information: "<<endl<<
   "|ECONOMY CLASS "<<endl;
}

cout<<"|Status: confirmed "<<endl;

ofstream outfile;
outfile.open("E:\E_ticket.txt",ios::app);
outfile<<"|Status: confirmed "<<endl;
t1.show();
}
else

{

cout<<"flight is not available;

}
}
};

class main1

{
private:

char f;

int menu_choice;

char a;
  
public:


void getdata()
{
m:
cout<<" ";
cout<<setw(60)<<"*************************************"<<endl;
cout<<setw(60)<<"* AIRWAYS RESERVATION *"<<endl;
cout<<setw(60)<<"* MAIN MENU *"<<endl;
cout<<setw(60)<<"* ENTER YOUR CHOICE *"<<endl;
cout<<setw(60)<<"* PRESS 1 FOR LOCAL BOOKING *"<<endl;
cout<<setw(60)<<"* PRESS 2 FOR INTERNATIONAL BOOKING *"<<endl;
cout<<setw(60)<<"* PRESS 3 FOR SEARCH OF FLIGHTS *"<<endl;
cout<<setw(60)<<"* NOW ENTER YOUR CHOICE: *"<<endl;
cout<<setw(60)<<"*************************************"<<endl;
  cin>>menu_choice;
  
system("cls");
  
passenger* p1;
  
booking b1;
  
international i1;
  
local l1;
  
char back;

  
switch(menu_choice)
  
{
  
case 1:


   p1=&l1;

   p1->getdata();

   cout<<"To Go To Main Menu Press b"<<endl;

   cin>>back;



   system("CLS");

   if (back=='b')

{

   goto m;

   }

   else

   {

   cout<<" ";

   cout<<setw(40)<<"BYE FROM AIR RESERVATION SYSTEM";

   }


   break;
  
case 2:


   p1=&i1;

   p1->getdata();

   cout<<"To Go To Main Menu Press b"<<endl;

   cin>>back;

if (back=='b')

   {

   goto m;

   }

   else

   {

   cout<<" ";

   cout<<setw(40)<<"BYE FROM AIR RESERVATION SYSTEM";

   }

   break;
  
case 3:

   search s1;

   s1.searching();

   cout<<"To Go To Main Menu Press b"<<endl;

   cin>>back;



   system("CLS");

   if (back=='b')

  {

   goto m;

   }

   else

   {

   cout<<" ";

   cout<<setw(40)<<"BYE FROM AIR RESERVATION SYSTEM";

   }

   break;
  
}
}
};
void main()
{

SetConsoleTitle(L"AIRWAYS RESERVATION");
system("color 5f");
cout<<" WELCOME TO AIRWAYS RESERVATION SYSTEM";
Sleep(2500);
system ("cls");
cout<<" Developed by :";
Sleep(500);
cout<<" Jehanzeb";
Sleep(500);
cout<<" Ahmad Khan";

system("cls");
main1 m1;
m1.getdata();

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote