This needs to be written in c# Create an initial GUI for an airline flight reser
ID: 3808315 • Letter: T
Question
This needs to be written in c#
Create an initial GUI for an airline flight reservation system that will have minimal functionality. Please see the picture for an example of what the GUI should look like. You may also look at the airline reservation system example program I gave you on Canvas. There will be two different flights the user may choose from. Each flight will have a different seating arrangement. Two flights will need to be graphically created, each with a different seating arrangement. How you do this is up to you. Some ideas on how to do each flight would be to use a panel or user control filled with labels or buttons to represent the seats. The "Choose Flight" combo box should be filled up with the two different flights that are extracted from the database Flight table. When the form first loads, the flights should be extracted from the database and inserted into the combo box. All other controls on the form should be disabled at this point. When the user selects a flight from the "Choose Flight" combo box two things should happen. The first is that the appropriate flight should be displayed on the left of the program, and the second is that the "Choose Passenger" combo box should be enabled and loaded with the passengers on the selected flight from the database. The "Change Seat" and "Delete Passenger" buttons will not have any functionality for the first part of this assignment. When the user clicks the "Add Passenger" button another form should be displayed. This form needs to be created for this part of the assignment. The other form is where the new passenger's information will be entered. This form should allow the user to enter the passenger's first name and last name. It should also have a "Save" and "Cancel" button on it. For the first part of this assignment both of these buttons will do nothing but close this form. Microsoft Access should be used to store the data. All methods need to have exception handling. Top level methods need to handle the exception and alert the user to the exception, and lower level called methods need to raise the exception up to calling methods. See example "Chapter 13 Exceptions". Make sure all business logic is in separate classes and not behind the UI.Explanation / Answer
CODE:
#consist of<iostream>
#include<iomanip>
#include<conio.h>
#encompass<string>
#encompass<windows.h>
#include<fstream>
the usage of namespace std;
char l_destination[5][20]="LAHORE","ISLAMABAD","KARACHI","PESHAWAR","QUETTA";
char i_destination[10][20]="LONDON","BERLIN","DUBAI","new york","BEIJING","PARIS","CAPE town","TOKYO","l. a.","MUMBAI" ;
magnificence mytime
included:
int select;
public:
void getdata()
cout<<"ON which era YOU need TO travel"<<endl;
cout<<"PRESS 1 FOR eleven AM"<<endl;
cout<<"PRESS 2 FOR 10 AM"<<endl;
cout<<"PRESS 3 FOR nine AM"<<endl;
cin>>pick out;
void display()
if(choose==1)
flight mytime eleven_________________________________________________________________________"<<endl;
cout<<" right BYE and feature A safe journey "<<endl<<
"11_________________________________________________________________________"<<endl<<
" properly BYE and have A safe journey "<<endl;
if(pick out==2)
"<<endl;
cout<<"accurate BYE and have A safe adventure "<<endl<<
"correct BYE and have A safe adventure "<<endl;
if(pick==three)
"<<endl;
cout<<"9 AM "<<endl;
cout<<"accurate BYE and feature A safe adventure "<<endl;
ofstream outfile;
outfile.open("E:E_ticket.txt",ios::app);
outfile<<"nine_________________________________________________________________________"<<endl<<
" desirable BYE and have A secure journey "<<endl;
;
magnificence passenger
public:
digital void getdata()
virtual void display()
;
magnificence booking:public passenger
covered:
int num;
char ch;
char firstname[60];
char lastname[60];
char deal with[60];
char c_loc[30];
char dest[30];
char reservation_no[60];
int option;
public:
void getdata()
cout<<setw(40)<<"nn ::Please input the required data for passenger wide variety::"<<endl;
cout<<"nnnEnter 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(cope with,60);
cout<<endl<<endl;
cout<<"input the Resevation No. of price ticket"<<endl;
cin.getline(reservation_no,60);
cout<<endl;
cout<<"input the contemporary area of passenger(IN CAPITAL LETTERS best): ";
cin.getline(c_loc,60);
cout<<endl<<endl;
cout<<"enter the vacation spot of passenger(IN CAPITAL LETTERS best): ";
cin.getline(dest,60);
cout<<endl<<endl;
system("CLS");
void display()
cout<<setw(40)<<"Your E-price ticket is :"<<endl;
int t=1;
int r=12345;
cout<<" AIRLINE price ticketprice ticket_________________________________________________________________________"<<endl;
cout<<"informationcall :"<<lastname<<"/"<<firstname<<" "<<endl;
cout<<"cope with :"<<deal with<<" "<<endl;
cout<<"recordsBOING 747 "<<endl;
cout<<"leave :"<<c_loc<<" "<<endl;
cout<<"bags allowed forty kilos "<<endl;
cout<<"contact Airline to verify luggage allowance "<<endl;
cout<<"ticket "<<endl<<
"ticket_________________________________________________________________________"<<endl<<
"records : "<<endl<<
"name "<<endl<<
"cope with :"<<deal withflight statistics : "<<endl<<
"departArrive :"<<dest<<" "<<endl<<
"luggage allowed 40 pounds*contact Airline to verify luggage allowance "<<endl<<
"
;
class seek
public:
void searching()
cout<<"FOLLOWING ARE THE global FLIGHTS to be had"<<endl;
for(int i=0;i<five;i++)
for(int j=zero;j<10;j++)
cout<<"FLIGHT FROM "<<l_destination[i]<<" TO "<<i_destination[j]<<endl;
;
magnificence neighborhood: public reserving
covered:
int b_seat;
int e_seat;
int ch;
int ok;
int p;
int option;
mytime t1;
public:
void getdata()
k=zero;
p=0;
cout<<"in which AIRLINE you want to travel"<<endl<<endl;
cout<<"1)PIA"<<endl;
cout<<"2)AIR BLUE"<<endl;
cout<<"3)ARAB EMIRATES"<<endl;
cout<<"four)QATAR airways"<<endl;
cout<<"input your preference"<<endl;;
cin>>choice;
gadget ("cls");
switch(choice)
case 1:
if (alternative==1)
cout<<setw(forty)<<"nnn WELCOME TO PIA"<<endl;
spoil;
case 2:
if(alternative==2)
cout<<setw(40)<<"nnn WELCOME TO AIRBLUE"<<endl;
break;
case 3:
if(choice==3)
cout<<setw(40)<<"nnn WELCOME TO ARAB EMIRATES"<<endl;
destroy;
case 4:
if(alternative==four)
cout<<setw(forty)<<"nnn WELCOME TO QATAR airlines"<<endl;
smash;
cout<<setw(forty)<<"nTHESE ARE THE neighborhood places AVAILABLEnnn"<<endl;
cin.forget about();
for(int i=zero;i<5;i++)
cout<<l_destination[i]<<endl;
booking::getdata();
for(int j=zero;j<5;j++)
if(strcmp(l_destination[j],c_loc)==0)
ok++;
for( int i=zero;i<five;i++)
if(strcmp(l_destination[i],c_loc)==zero)
p++;
if(k==1&&p==1)
cout<<" FLIGHT available in this direction"<<endl;
b_seat=30;
e_seat=40;
cout<<"in which elegance you need to journey?"<<endl;
cout<<"Make your choice"<<endl<<endl;
cout<<"nnnnnn";
cout<<setw(60)<<"*************************************"<<endl;
cout<<setw(60)<<"* Press 1 for buisness class *"<<endl;
cout<<setw(60)<<"* Press 2 for financial system elegance *"<<endl;
cout<<setw(60)<<"*************************************"<<endl<<endl<<endl<<endl;
cout<<"enter your choice"<<endl;
cin>>ch;
cout<<endl;
switch(ch)
case 1:
b_seat--;
if(b_seat<=zero)
cout<<"SORRY NO SEAT available"<<endl;
else
cout<<"SEAT to be had"<<endl;
damage;
case 2:
e_seat--;
if(e_seat<=0)
cout<<"SORRY NO SEAT to be had"<<endl;
else
cout<<"SEAT available"<<endl;
spoil;
t1.getdata();
device("CLS");
reserving::show();
if(ch==1)
price tag recordsBUISNESS classprice tag facts: "<<endl<<
"magnificence "<<endl;
if(ch==2)
price ticket information: "<<endl;
cout<<"economy class "<<endl<<
"price tag data: "<<endl<<
"economy elegance "<<endl;
status: showed "<<endl;
ofstream outfile;
outfile.open("E:E_ticket.txt",ios::app);
outfile<<"popularity: confirmed "<<endl;
t1.display();
else
cout<<"__________________________________________________________________________"<<endl;
cout<<"to be had in this path right NOW "<<endl;
cout<<"__________________________________________________________________________"<<endl;
;
elegance international:public booking
included:
int b1_seat;
int e1_seat;
int preference;
int c;
int b;
int v;
char g;
mytime t1;
public:
void getdata()
b=0;
v=0;
cout<<"in which AIRLINE you want to travel"<<endl<<endl;
cout<<"1)PIA"<<endl;
cout<<"2)AIR BLUE"<<endl;
cout<<"3)ARAB EMIRATES"<<endl;
cout<<"four)QATAR airways"<<endl;
cout<<"enter your preference"<<endl;;
cin>>alternative;
device ("cls");
switch(alternative)
case 1:
if (alternative==1)
cout<<setw(40)<<"nnn WELCOME TO PIA"<<endl;
ruin;
case 2:
if(alternative==2)
cout<<setw(40)<<"nnn WELCOME TO AIRBLUE"<<endl;
break;
case 3:
if(option==3)
cout<<setw(40)<<"nnn WELCOME TO ARAB EMIRATES"<<endl;
ruin;
case four:
if(choice==4)
cout<<setw(40)<<"nnn WELCOME TO QATAR airways"<<endl;
spoil;
cout<<"nnTHESE ARE THE global locations available"<<endl<<endl;
cin.forget about();
for(int i=zero;i<10;i++)
cout<<i_destination[i]<<endl;
reserving::getdata();
for(int j=zero;j<10;j++)
if(strcmp(i_destination[j],dest)==zero)
v++;
for( int i=zero;i<five;i++)
if(strcmp(l_destination[i],c_loc)==0)
b++;
if(b==1&&v==1)
cout<<" FLIGHT available on this course"<<endl;
b1_seat=30;
e1_seat=forty;
cout<<"wherein magnificence you need to travel?"<<endl;
cout<<"Make your preference"<<endl<<endl;
cout<<"nnnnnn";
cout<<setw(60)<<"*************************************"<<endl;
cout<<setw(60)<<"* Press 1 for buisness elegance *"<<endl;
cout<<setw(60)<<"* Press 2 for economic system magnificence *"<<endl;
cout<<setw(60)<<"*************************************"<<endl<<endl<<endl<<endl;
cout<<"input your desire"<<endl;
cin>>preference;
cout<<endl;
switch(preference)
case 1:
b1_seat--;
if(b1_seat<=0)
cout<<"SORRY NO SEAT to be had"<<endl;
else
cout<<"SEAT available"<<endl;
ruin;
case 2:
e1_seat--;
if(e1_seat<=zero)
cout<<"SORRY NO SEAT to be had"<<endl;
else
cout<<"SEAT to be had"<<endl;
spoil;
t1.getdata();
device("CLS");
booking::display();
if(desire==1)
"<<endl;
cout<<"price tag statistics: "<<endl;
cout<<"class "<<endl;
ofstream outfile;
outfile.open("E:E_ticket.txt",ios::app);
outfile<<"price ticket dataenterprise elegance "<<endl;
if(desire==2)
cout<<"ticket statistics: "<<endl;
cout<<"economic system class "<<endl;
ofstream outfile;
outfile.open("E:E_ticket.txt",ios::app);
outfile<<"price tag information: "<<endl<<
"financial system class "<<endl;
cout<<"repute: confirmedpopularity: confirmed "<<endl;
t1.show();
else
SORRY NO FLIGHT to be had on this route proper NOW "<<endl;
cout<<"__________________________________________________________________________"<<endl;
;
class main1
private:
char f;
int menu_choice;
char a;
public:
void getdata()
m:
cout<<"nnnnnn";
cout<<setw(60)<<"*************************************"<<endl;
cout<<setw(60)<<"* airways RESERVATION *"<<endl;
cout<<setw(60)<<"* most important MENU *"<<endl;
cout<<setw(60)<<"* input YOUR preference *"<<endl;
cout<<setw(60)<<"* PRESS 1 FOR local reserving *"<<endl;
cout<<setw(60)<<"* PRESS 2 FOR global reserving *"<<endl;
cout<<setw(60)<<"* PRESS three FOR search OF FLIGHTS *"<<endl;
cout<<setw(60)<<"* NOW enter YOUR desire: *"<<endl;
cout<<setw(60)<<"*************************************"<<endl;
cin>>menu_choice;
device("cls");
passenger* p1;
reserving b1;
international i1;
nearby l1;
char lower back;
transfer(menu_choice)
case 1:
p1=&l1;
p1->getdata();
cout<<"To go to principal Menu Press b"<<endl;
cin>>back;
gadget("CLS");
if (lower back=='b')
goto m;
else
cout<<"nnnnnn";
cout<<setw(forty)<<"BYE FROM AIR RESERVATION SYSTEM";
break;
case 2:
p1=&i1;
p1->getdata();
cout<<"To visit main Menu Press b"<<endl;
cin>>again;
system("CLS");
if (lower back=='b')
goto m;
else
cout<<"nnnnnn";
cout<<setw(40)<<"BYE FROM AIR RESERVATION system";
destroy;
case three:
search s1;
s1.searching();
cout<<"To go to most important Menu Press b"<<endl;
cin>>returned;
gadget("CLS");
if (back=='b')
goto m;
else
cout<<"nnnnnn";
cout<<setw(40)<<"BYE FROM AIR RESERVATION system";
smash;
;
void foremost()
SetConsoleTitle(L"airlines RESERVATION");
machine("color 5f");
cout<<"nnnnnnnnnntt WELCOME TO airways RESERVATION system";
Sleep(2500);
machine ("cls");
cout<<"nnnnnnntt advanced by :";
Sleep(500);
cout<<" Rana Jehanzeb";
Sleep(500);
cout<<"nnntt Afraz Ahmad Khan";
Sleep(3000);
system("cls");
main1 m1;
m1.getdata();
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.