Jump to content

Recommended Posts

:confused:please help me out...i was working on a c++ programming on air ticket reservation but its not working properly...please tell me where im wrong and how to make it better..

 

 

#include <string>

#include <iostream>

 

int main()

{

int c, s[10];

int i, j;

string name;

 

 

 

cout << "Welcome to Airline Reservations System!\n";

cout << "Please enter your name: ";

getline(cin,name);

 

cout << "Choose a class: ";

cin >> c;

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

switch©

{

case 1:

cout << "First class" << endl;

cout << "Seats available are 1,2,3,4,5.\n";

do {

cout << "Pick a seat: ";

cin >> s[j];

for (i=0; i<j; i++) if (s[j]==s) {cout << "Seat taken. ";

break;}

} while (i!=j);

if(s[j] <= 5)

{

 

cout << "\n";

cout << "--------------------------\n";

cout << "Name: " << name << endl;

cout << "Class: " << "First class" << endl;

cout << "Seat no.: " << s << endl;

cout << "--------------------------\n";

 

}

else

cout << "Wrong number! No seat for you!\n";

break;

case 2:

cout << "Economic class\n";

cout << "Seats available are 6,7,8,9,10.\n";

do {

cout << "Pick a seat number: ";

cin >> s[j];

for (i=0; i<j; i++) if (s[j]==s) {cout << "Seat taken. ";

break;}

} while (i!=j);

if(s[j] >= 6)

{

cout << "\n";

cout << "--------------------------\n";

cout << "Name: " << name << endl;

cout << "Class: " << "Economic class" << endl;

cout << "Seat no.: " << s[j] << endl;

cout << "--------------------------\n";

}

else

cout << "Wrong number! No seat for you!\n";

break;

}

 

 

system("pause");

return 0;

}

 

even now it anint working...

#include <string>

#include <iostream>

using namespace std;

int main()

{

int c, s[10];

int i, j;

string name;

 

 

 

cout << "Welcome to Airline Reservations System!\n";

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

{

cout << "Please enter your name: ";

getline(cin,name);

 

cout << "Choose a class: ";

cin >> c;

 

switch©

{

case 1:

cout << "First class" << endl;

cout << "Seats available are 1,2,3,4,5.\n";

do {

cout << "Pick a seat: ";

cin >> s[j];

for (i=0; i<j; i++) if (s[j]==s) {cout << "Seat taken. ";

break;}

} while (i!=j);

if(s[j] <= 5)

{

 

cout << "\n";

cout << "--------------------------\n";

cout << "Name: " << name << endl;

cout << "Class: " << "First class" << endl;

cout << "Seat no.: " << s << endl;

cout << "--------------------------\n";

 

}

else

cout << "Wrong number! No seat for you!\n";

break;

case 2:

cout << "Economic class\n";

cout << "Seats available are 6,7,8,9,10.\n";

do {

cout << "Pick a seat number: ";

cin >> s[j];

for (i=0; i<j; i++) if (s[j]==s) {cout << "Seat taken. ";

break;}

} while (i!=j);

if(s[j] >= 6)

{

cout << "\n";

cout << "--------------------------\n";

cout << "Name: " << name << endl;

cout << "Class: " << "Economic class" << endl;

cout << "Seat no.: " << s[j] << endl;

cout << "--------------------------\n";

}

else

cout << "Wrong number! No seat for you!\n";

break;

default:

break;

}

}

 

 

system("pause");

return 0;

Link to post
Share on other sites

There are code tags ( [ code ] and [/ code] (without the spaces)) which you might find useful.

 

Firstly, you either need to specify the namespaces you are using explicitly on use or overall the namespaces you are using within the file. Your compiler may be ignoring this but you should probably realise it is a problem, as it will come up if you move to others.

 

Secondly, the second version is almost certainly necessary, as otherwise you'll only ever be able to book one class of ticket.

 

Thirdly, given that you didn't actually specify what your problem was or what you expected this thing to do, I assume your problem was something akin to the problem I encountered while running this code, which was an issue whereby cin leaves a newline character on stdin, and that then gets picked up when you call getline a second time (after a previous cin call) and so you have to tell cin to ignore the character before calling getline.

 

If that's not the problem you had, perhaps you could elaborate further.

 

Here is your code, edited and working as far as I can see (given I don't know exactly what you want -

 

#include <string>
#include <iostream>

using namespace std;

int main()
{
   int c, s[10];
   int i, j;
   string name;




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

       cout << "Welcome to Airline Reservations System!\n";
       cout << "Please enter your name: ";

       cin.ignore();
       getline(cin,name);

       cout << "Choose a class: ";
       cin >> c;

       switch(c) {
           case 1:
               cout << "First class" << endl;
               cout << "Seats available are 1,2,3,4,5.\n";
               do {
                   cout << "Pick a seat: ";
                   cin >> s[j];
                   for (i=0; i<j; i++) if (s[j]==s[i]) {
                       cout << "Seat taken. ";
                       break;
                   }
               } while (i!=j);

               if(s[j] <= 5) {

                   cout << "\n";
                   cout << "--------------------------\n";
                   cout << "Name: " << name << endl;
                   cout << "Class: " << "First class" << endl;
                   cout << "Seat no.: " << s << endl;
                   cout << "--------------------------\n";

               } else cout << "Wrong number! No seat for you!\n";
               break;
           case 2:
               cout << "Economic class\n";
               cout << "Seats available are 6,7,8,9,10.\n";
               do {
                   cout << "Pick a seat number: ";
                   cin >> s[j];
                   for (i=0; i<j; i++) if (s[j]==s[i]) {
                       cout << "Seat taken. ";
                       break;
                   }
               } while (i!=j);
               if(s[j] >= 6)
               {
                   cout << "\n";
                   cout << "--------------------------\n";
                   cout << "Name: " << name << endl;
                   cout << "Class: " << "Economic class" << endl;
                   cout << "Seat no.: " << s[j] << endl;
                   cout << "--------------------------\n";
               }
               else cout << "Wrong number! No seat for you!\n";
               break;
       }
   }


   system("pause");
   return 0;
}

 

You may also want to look into initialising your array (I'm not entirely sure on the C++ standard but in C, uninitialised content could be anything) and you may want to check that cin etc actually return something properly (remember I can press ctrl+d).

 

Also, you may want to read Things to Avoid in C/C++ -- system("pause").

 

I'll probably comment more fully after my exams tomorrow.

Edited by Aeternus
Link to post
Share on other sites

Heap variables are initialized to 0, stack variables contain garbage.

The unwritten rules of c++ say that a variable should be declared just prior to its first use, so most of the time, you should initialize variables.

 

You can just post your entire code and say "fix it." You need to say which parts are giving you trouble. If you're getting compiler errors, post them. If you have bugs, say what you expect vs. what you're getting. If there's something you don't understand, post a small example.

Link to post
Share on other sites

when i book any ticket say ticket no. 1 from first class, then i want that next time when user runs the program, ticket no. 1 should not be dispayed as unreserved. i'm really not getting how to do that. please help me to fix this problem.

 

can you also tell me that how to insert graphics in c++??? please give the procedure.

Edited by chitrangda
multiple post merged
Link to post
Share on other sites

Its been quite a while since ive done any programming, so take this with a grain of salt.

 

you say 'the next time they run the program' to me that means closing the application and opening it back up again. as far as i can see, assuming i remember my programming, you dont ever save the data anywhere. it just goes into memory and thus gets deleted whenever you close the program. if thats not what you meant, or if im a tard and dont remember how to program ill take a look at it again and see if i can pull more code out of the dark scary recesses of my mind.

Link to post
Share on other sites

In short: You have to save that information to the disk.

@Graphics: What kind of graphics? The best way is to download a package that offers you the functionality you need.

Link to post
Share on other sites
  • 2 weeks later...

remade my program but still not working..:doh:

#include<iostream.h>

#include<conio.h>

#include<stdio.h>

#include<process.h>

class airline

{

char flightname[30];

int flightno[30];

 

public:

void inter();

void domes();

void inter_print();

void domes_print();

void air_cancel();

};

 

struct date

{

int day_no;

char month[30];

int year;

char day[30];

}d1;

 

 

 

void airline::inter()

{

int a,n,i,j,ch,ad,age[30],a1,a2,b;

char name[30];

char monday,tuesday,wednesday,thursday,friday,saturday,sunday;

cout<<"\n";

cout<<"International Ticket Booking\n";

 

cout<<"Available International Destinations\n";

cout<<"1 : INDIA TO BANGKOK\n";

cout<<"2 : INDIA TO DUBAI\n";

cout<<"3 : BANGKOK TO INDIA\n";

cout<<"4 : MALAYSIA TO INDIA\n";

cout<<"5 : INDIA TO NEW YORK\n";

cout<<"6 : DUBAI TO INDIA\n";

cout<<"7 : SINGAPORE TO INDIA\n";

cout<<"8 : INDIA TO MALAYSIA\n";

cout<<"9 : LONDON TO INDIA\n";

cout<<"10: INDIA TO SINGAPORE\n";

cout<<"11: INDIA TO LONDON\n";

cout<<"12: NEW YORK TO INDIA\n";

cout<<"Please enter your choice\n";

cin>>a2;

switch(a2)

{

case 1:

 

cout<<"Flights available from INDIA to BANGKOK\n";

 

cout<<"Flight Name" <<"\t"<<"Flight No."<<"\t"<<"Origin" <<"\t"<<"Arrival "<<"\t"<<"Departure"<<"\t"<<"Days of operation"<<"\n";

cout<<"1: Air India" <<"\t"<<"AI 1235" <<"\t\t"<<"Mumbai" <<"\t\t"<<"00:05" <<"\t"<<"21:34" <<"\t"<<"Mon,Thurs" <<"\n";

cout<<"2: Kingfisher" <<"\t"<<"KF 5436" <<"\t\t"<<"Chennai"<<"\t\t"<<"10:45" <<"\t"<<"20:23" <<"\t"<<"Wed,Sat,Sun" <<"\n";

cout<<"3: Jet Airways"<<"\t"<<"JA 4523" <<"\t\t"<<"Delhi" <<"\t"<<"11:20" <<"\t"<<"22:54" <<"\t"<<"Fri,Sun" <<"\n";

cout<<"\n";

 

cout<<"Please enter your choice\n";

cin>>a;

 

cout<<"Do you want to book the seat(s) in\n";

cout<<"1: First Class\n";

cout<<"2: Economy Class\n";

cout<<"3: Executive Class\n";

cout<<"Please enter your choice\n";

cin>>b;

switch(b)

{

 

case 1:

 

cout<<"Please enter the no. of person(s) boarding the plane\n";

cin>>a1;

if(a1<=45)

{

cout<<" Please enter the no. of adults (above 12)\n";

cin>>ad;

if(a1>ad)

{

cout<<"Please enter the no. of children (below 12)\n";

cin>>ch;

}

cout<<"Please enter the date and day you are boarding the plane\n";

cout<<"Date\n";

 

cin>>d1.day_no;

cout<<"month\n";

gets(d1.month);

 

cout<<"Year\n";

cin>>d1.year;

cout<<"day(monday\thursday)";

gets(d1.day);

cout<<"\n";

if(d1.day!=monday||thursday)

{

 

cout<<"Flight not in operation on"<<d1.day<<". please enter valid day only!\n";

}

else

{

cout<<"Please enter the name and age of the person(s) boarding\n";

cout<<"Name"<<"\t"<<"\t"<<"\t"<<"Age"<<"\n";

for(j=0;j<a1;j++)

{

gets(name);

cout<<"\t"<<"\t";

cin>>age;

cout<<"\n";

}

 

if(a==1)

{

 

cout<<"Total Cost="<<"\n";

cout<<"Basic Fare=Rs 9000\n";

cout<<"Fuel charges=Rs 8000\n";

cout<<"Travelling charges= Rs 10000\n";

unsigned long total=9000+8000+10000+(5000*ad)+(2000*ch);

cout<<total;

}

else if(a==2)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 9000\n";

cout<<"Fuel charges=Rs 6000\n";

cout<<"Travelling charges=Rs 8000\n";

unsigned long total=9000+6000+8000+(3000*ad)+(1000*ch);

cout<<total;

}

else

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 8000\n";

cout<<"Fuel Charges=Rs 4000\n";

cout<<"Travelling Charges=Rs 6000\n";

unsigned long total=8000+4000+6000+(3500*ad)+(1200*ch);

cout<<total;

}

}

else

{

cout<<"Sorry!seats are not available"<<"\n";

cout<<"Please book in other classes";

}

break;

}

 

 

 

case 2:

cout<<"Please enter the no. of person(s) boarding the plane\n";

cin>>a1;

if(a1<=34)

{

cout<<" Please enter the no. of adults (above 12)\n";

cin>>ad;

cout<<"Please enter the no. of children (below 12)\n";

cin>>ch;

cout<<"Please enter the date and day you are boarding the plane\n";

cout<<"Date\n";

 

cin>>d1.day_no;

cout<<"month\n";

gets(d1.month);

 

cout<<"Year\n";

cin>>d1.year;

cout<<"day(monday\thursday)";

gets(d1.day);

cout<<"\n";

if(d1.day!=monday||thursday)

{

 

cout<<"Flight not in operation on"<<d1.day<<". Please enter valid day only!\n";

}

else

{

 

cout<<"Please enter the name and age of the person(s) boarding\n";

cout<<"Name"<<"\t"<<"\t"<<"\t"<<"Age"<<"\n";

for(j=0;j<a1;j++)

{

gets(name);

cout<<"\t"<<"\t";

cin>>age;

cout<<"\n";

}

 

if(a==1)

{

 

cout<<"Total Cost="<<"\n";

cout<<"Basic Fare=Rs 10000\n";

cout<<"Fuel charges=Rs 9000\n";

cout<<"Travelling charges= Rs 10000\n";

unsigned long total=10000+9000+10000+(4000*ad)+(2000*ch);

cout<<total;

}

else if(a==2)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 9000\n";

cout<<"Fuel charges=Rs 7000\n";

cout<<"Travelling charges=Rs 8000\n";

unsigned long total=9000+7000+8000+(3000*ad)+(1000*ch);

cout<<total;

}

else

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 8000\n";

cout<<"Fuel Charges=Rs 5000\n";

cout<<"Travelling Charges=Rs 6000\n";

unsigned long total=8000+5000+6000+(3000*ad)+(1200*ch);

cout<<total;

}

}

else

{

cout<<"Sorry!seats are not available"<<"\n";

cout<<"Please book in other classes";

}

break;

}

 

 

case 3:

cout<<"Please enter the no. of person(s) boarding the plane\n";

cin>>a1;

if(a1<=23)

{

cout<<" Please enter the no. of adults (above 12)\n";

cin>>ad;

cout<<"Please enter the no. of children (below 12)\n";

cin>>ch;

cout<<"Please enter the date and day you are boarding the plane\n";

cout<<"Date\n";

 

cin>>d1.day_no;

cout<<"month\n";

gets(d1.month);

 

cout<<"Year\n";

cin>>d1.year;

cout<<"day(monday\thursday)";

gets(d1.day);

cout<<"\n";

if(d1.day!=monday||thursday)

{

 

cout<<"Flight not in operation on"<<d1.day<<". please enter valid day only!\n";

}

else

{

 

cout<<"Please enter the name and age of the person(s) boarding\n";

cout<<"Name"<<"\t"<<"\t"<<"\t"<<"Age"<<"\n";

for(j=0;j<a1;j++)

{

gets(name);

cout<<"\t"<<"\t";

cin>>age;

cout<<"\n";

}

 

if(a==1)

{

 

cout<<"Total Cost="<<"\n";

cout<<"Basic Fare=Rs 11000\n";

cout<<"Fuel charges=Rs 9000\n";

cout<<"Travelling charges= Rs 10000\n";

unsigned long total=11000+9000+10000+(5000*ad)+(2000*ch);

cout<<total;

}

else if(a==2)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 10000\n";

cout<<"Fuel charges=Rs 8000\n";

cout<<"Travelling charges=Rs 9000\n";

unsigned long total=10000+8000+9000+(4000*ad)+(2500*ch);

cout<<total;

}

else

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 9000\n";

cout<<"Fuel Charges=Rs 6000\n";

cout<<"Travelling Charges=Rs 8000\n";

unsigned long total=9000+6000+8000+(3300*ad)+(1500*ch);

cout<<total;

}

}

else

{

cout<<"Sorry!seats are not available"<<"\n";

cout<<"Please book in other classes";

}

}

break;

}

 

 

case 2:

 

cout<<"Flights available from INDIA to DUBAI\n";

 

cout<<"Flight Name" <<"\t"<<"Flitght No."<<"\t"<<"Origin" <<"\t"<<"Arrival"<<"\t"<<"Departure"<<"\t"<<"Days of operation"<<"\n";

cout<<"1: Air India" <<"\t"<<"AI 4325" <<"\t"<<"Mumbai" <<"\t"<<"11:05" <<"\t"<<"18:34" <<"\t"<<"Wed,Thurs" <<"\n";

cout<<"2: Kingfisher" <<"\t"<<"KF 9856" <<"\t"<<"Chennai"<<"\t"<<"00:45" <<"\t"<<"21:33" <<"\t"<<"Wed,Fri,Sun" <<"\n";

cout<<"3: Jet Airways"<<"\t"<<"JA 7645" <<"\t"<<"Delhi" <<"\t"<<"13:30" <<"\t"<<"22:54" <<"\t"<<"Sat,Sun" <<"\n";

cout<<"4: Kingfisher" <<"\t"<<"KF 7856" <<"\t"<<"Kolkata"<<"\t"<<"9:23" <<"\t"<<"17:56" <<"\t"<<"Tues,Wed,Sat" <<"\n";

cout<<"\n";

 

cout<<"Please enter your choice\n";

cin>>a;

 

cout<<"Do you want to book the seat(s) in\n";

cout<<"1: First Class\n";

cout<<"2: Economy Class\n";

cout<<"3: Executive Class\n";

cout<<"Please enter your choice\n";

cin>>b;

switch(b)

{

 

case 1:

 

cout<<"Please enter the no. of person(s) boarding the plane\n";

cin>>a1;

if(a1<=32)

{

cout<<" Please enter the no. of adults (above 12)\n";

cin>>ad;

cout<<"Please enter the no. of children (below 12)\n";

cin>>ch;

cout<<"Please enter the date and day you are boarding the plane\n";

cout<<"Date\n";

 

cin>>d1.day_no;

cout<<"month\n";

gets(d1.month);

 

cout<<"Year\n";

cin>>d1.year;

cout<<"day(monday\thursday)";

gets(d1.day);

cout<<"\n";

if(d1.day!=monday||thursday)

{

 

cout<<"Flight not in operation on"<<d1.day<<". please enter valid day only!\n";

}

else

{

cout<<"Please enter the name and age of the person(s) boarding\n";

cout<<"Name"<<"\t"<<"\t"<<"\t"<<"Age"<<"\n";

for(j=0;j<a1;j++)

{

gets(name);

cout<<"\t"<<"\t";

cin>>age;

cout<<"\n";

}

 

if(a==1)

{

 

cout<<"Total Cost="<<"\n";

cout<<"Basic Fare=Rs 7000\n";

cout<<"Fuel charges=Rs 8000\n";

cout<<"Travelling charges= Rs 9000\n";

unsigned long total=7000+8000+9000+(4000*ad)+(1000*ch);

cout<<total;

}

else if(a==2)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 6000\n";

cout<<"Fuel charges=Rs 7000\n";

cout<<"Travelling charges=Rs 8000\n";

unsigned long total=6000+7000+8000+(3000*ad)+(1100*ch);

cout<<total;

}

else if(a==3)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 7000\n";

cout<<"Fuel Charges=Rs 4000\n";

cout<<"Travelling Charges=Rs 6000\n";

unsigned long total=7000+4000+6000+(2800*ad)+(1000*ch);

cout<<total;

}

else

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 7000\n";

cout<<"Fuel Charges=Rs 5000\n";

cout<<"Travelling Charges=Rs 6000\n";

unsigned long total=7000+5000+6000+(3400*ad)+(1300*ch);

cout<<total;

}

}

else

{

cout<<"Sorry!seats are not available"<<"\n";

cout<<"Please book in other classes";

}

break;

}

 

 

case 2:

cout<<"Please enter the no. of person(s) boarding the plane\n";

cin>>a1;

if(a1<=14)

{

cout<<" Please enter the no. of adults (above 12)\n";

cin>>ad;

cout<<"Please enter the no. of children (below 12)\n";

cin>>ch;

cout<<"Please enter the date and day you are boarding the plane\n";

cout<<"Date\n";

 

cin>>d1.day_no;

cout<<"month\n";

gets(d1.month);

 

cout<<"Year\n";

cin>>d1.year;

cout<<"day(monday\thursday)";

gets(d1.day);

cout<<"\n";

if(d1.day!=monday||thursday)

{

 

cout<<"Flight not in operation on"<<d1.day<<". please enter valid day only!\n";

}

else

{

 

cout<<"Please enter the name and age of the person(s) boarding\n";

cout<<"Name"<<"\t"<<"\t"<<"\t"<<"Age"<<"\n";

for(j=0;j<a1;j++)

{

gets(name);

cout<<"\t"<<"\t";

cin>>age;

cout<<"\n";

}

 

if(a==1)

{

 

cout<<"Total Cost="<<"\n";

cout<<"Basic Fare=Rs 8000\n";

cout<<"Fuel charges=Rs 7000\n";

cout<<"Travelling charges= Rs 7000\n";

unsigned long total=8000+7000+7000+(3600*ad)+(2000*ch);

cout<<total;

}

else if(a==2)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 6000\n";

cout<<"Fuel charges=Rs 5000\n";

cout<<"Travelling charges=Rs 6000\n";

unsigned long total=6000+5000+6000+(3200*ad)+(1100*ch);

cout<<total;

}

else if(a==3)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 7500\n";

cout<<"Fuel Charges=Rs 5000\n";

cout<<"Travelling Charges=Rs 6000\n";

unsigned long total=7500+5000+6000+(2500*ad)+(1000*ch);

cout<<total;

}

else

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 6500\n";

cout<<"Fuel Charges=Rs 5200\n";

cout<<"Travelling Charges=Rs 6000\n";

unsigned long total=6500+5200+6000+(4000*ad)+(2000*ch);

cout<<total;

}

}

else

{

cout<<"Sorry!seats are not available"<<"\n";

cout<<"Please book in other classes";

}

break;

}

 

 

case 3:

cout<<"Please enter the no. of person(s) boarding the plane\n";

cin>>a1;

if(a1<=10)

{

cout<<" Please enter the no. of adults (above 12)\n";

cin>>ad;

cout<<"Please enter the no. of children (below 12)\n";

cin>>ch;

cout<<"Please enter the date and day you are boarding the plane\n";

cout<<"Date\n";

 

cin>>d1.day_no;

cout<<"month\n";

gets(d1.month);

 

cout<<"Year\n";

cin>>d1.year;

cout<<"day(monday\thursday)";

gets(d1.day);

cout<<"\n";

if(d1.day!=monday||thursday)

{

 

cout<<"Flight not in operation on"<<d1.day<<". please enter valid day only!\n";

}

else

{

 

cout<<"Please enter the name and age of the person(s) boarding\n";

cout<<"Name"<<"\t"<<"\t"<<"\t"<<"Age"<<"\n";

for(j=0;j<a1;j++)

{

gets(name);

cout<<"\t"<<"\t";

cin>>age;

cout<<"\n";

}

 

if(a==1)

{

 

cout<<"Total Cost="<<"\n";

cout<<"Basic Fare=Rs 9900\n";

cout<<"Fuel charges=Rs 8000\n";

cout<<"Travelling charges= Rs 7000\n";

unsigned long total=9900+8000+7000+(4500*ad)+(2000*ch);

cout<<total;

}

else if(a==2)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 8000\n";

cout<<"Fuel charges=Rs 6000\n";

cout<<"Travelling charges=Rs 5600\n";

unsigned long total=8000+6000+5600+(3500*ad)+(1500*ch);

cout<<total;

}

else if(a==3)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 7200\n";

cout<<"Fuel Charges=Rs 6500\n";

cout<<"Travelling Charges=Rs 4800\n";

unsigned long total=7200+6500+4800+(3100*ad)+(1100*ch);

cout<<total;

}

else

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 7500\n";

cout<<"Fuel Charges=Rs 5500\n";

cout<<"Travelling Charges=Rs 4500\n";

unsigned long total=7500+5500+4500+(2900*ad)+(1200*ch);

cout<<total;

}

}

else

{

cout<<"Sorry!seats are not available"<<"\n";

cout<<"Please book in other classes";

}

}

break;

}

 

 

case 3:

 

cout<<"Flights available from BANGKOK to INDIA\n";

 

cout<<"Flight Name" <<"\t"<<"Flitght No."<<"\t"<<"Origin" <<"\t"<<"Arrival"<<"\t"<<"Departure"<<"\t"<<"Days of operation"<<"\n";

cout<<"1: Air India" <<"\t"<<"AI 1235" <<"\t"<<"Mumbai" <<"\t"<<"00:05" <<"\t"<<"21:34" <<"\t"<<"Mon,Thurs" <<"\n";

cout<<"2: Kingfisher" <<"\t"<<"KF 5436" <<"\t"<<"Chennai"<<"\t"<<"10:45" <<"\t"<<"20:23" <<"\t"<<"Wed,Sat,Sun" <<"\n";

cout<<"3: Jet Airways"<<"\t"<<"JA 4523" <<"\t"<<"Delhi" <<"\t"<<"11:20" <<"\t"<<"22:54" <<"\t"<<"Fri,Sun" <<"\n";

cout<<"\n";

 

cout<<"Please enter your choice\n";

cin>>a;

 

cout<<"Do you want to book the seat(s) in\n";

cout<<"1: First Class\n";

cout<<"2: Economy Class\n";

cout<<"3: Executive Class\n";

cout<<"Please enter your choice\n";

cin>>b;

switch(b)

{

 

case 1:

 

cout<<"Please enter the no. of person(s) boarding the plane\n";

cin>>a1;

if(a1<=45)

{

cout<<" Please enter the no. of adults (above 12)\n";

cin>>ad;

cout<<"Please enter the no. of children (below 12)\n";

cin>>ch;

cout<<"Please enter the date and day you are boarding the plane\n";

cout<<"Date\n";

 

cin>>d1.day_no;

cout<<"month\n";

gets(d1.month);

 

cout<<"Year\n";

cin>>d1.year;

cout<<"day(monday\thursday)";

gets(d1.day);

cout<<"\n";

if(d1.day!=monday||thursday)

{

 

cout<<"Flight not in operation on"<<d1.day<<". please enter valid day only!\n";

}

else

{

 

cout<<"Please enter the name and age of the person(s) boarding\n";

cout<<"Name"<<"\t"<<"\t"<<"\t"<<"Age"<<"\n";

for(j=0;j<a1;j++)

{

gets(name);

cout<<"\t"<<"\t";

cin>>age;

cout<<"\n";

}

 

if(a==1)

{

 

cout<<"Total Cost="<<"\n";

cout<<"Basic Fare=Rs 9000\n";

cout<<"Fuel charges=Rs 8000\n";

cout<<"Travelling charges= Rs 10000\n";

unsigned long total=9000+8000+10000+(5000*ad)+(2000*ch);

cout<<total;

}

else if(a==2)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 9000\n";

cout<<"Fuel charges=Rs 6000\n";

cout<<"Travelling charges=Rs 8000\n";

unsigned long total=9000+6000+8000+(3000*ad)+(1000*ch);

cout<<total;

}

else

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 8000\n";

cout<<"Fuel Charges=Rs 4000\n";

cout<<"Travelling Charges=Rs 6000\n";

unsigned long total=8000+4000+6000+(3500*ad)+(1200*ch);

cout<<total;

}

}

else

{

cout<<"Sorry!seats are not available"<<"\n";

cout<<"Please book in other classes";

}

break;

 

 

case 2:

cout<<"Please enter the no. of person(s) boarding the plane\n";

cin>>a1;

if(a1<=34)

{

cout<<" Please enter the no. of adults (above 12)\n";

cin>>ad;

cout<<"Please enter the no. of children (below 12)\n";

cin>>ch;

cout<<"Please enter the date and day you are boarding the plane\n";

cout<<"DD"<<"\t"<<"MM"<<"\t"<<"YY"<<"\t"<<"day"<<"\n";

 

cin>>d1.day_no;

cout<<"\t";

gets(d1.month);

cout<<"\t";

cin>>d1.year;

cout<<"\t";

gets(d1.day);

cout<<"\n";

 

cout<<"Please enter the name and age of the person(s) boarding\n";

cout<<"Name"<<"\t"<<"\t"<<"\t"<<"Age"<<"\n";

for(j=0;j<a1;j++)

{

gets(name);

cout<<"\t"<<"\t";

cin>>age;

cout<<"\n";

}

 

if(a==1)

{

 

cout<<"Total Cost="<<"\n";

cout<<"Basic Fare=Rs 10000\n";

cout<<"Fuel charges=Rs 9000\n";

cout<<"Travelling charges= Rs 10000\n";

unsigned long total=10000+9000+10000+(4000*ad)+(2000*ch);

cout<<total;

}

else if(a==2)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 9000\n";

cout<<"Fuel charges=Rs 7000\n";

cout<<"Travelling charges=Rs 8000\n";

unsigned long total=9000+7000+8000+(3000*ad)+(1000*ch);

cout<<total;

}

else

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 8000\n";

cout<<"Fuel Charges=Rs 5000\n";

cout<<"Travelling Charges=Rs 6000\n";

unsigned long total=8000+5000+6000+(3000*ad)+(1200*ch);

cout<<total;

}

}

else

{

cout<<"Sorry!seats are not available"<<"\n";

cout<<"Please book in other classes";

}

break;

}

 

 

case 3:

cout<<"Please enter the no. of person(s) boarding the plane\n";

cin>>a1;

if(a1<=23)

{

cout<<" Please enter the no. of adults (above 12)\n";

cin>>ad;

cout<<"Please enter the no. of children (below 12)\n";

cin>>ch;

cout<<"Please enter the date and day you are boarding the plane\n";

cout<<"Date\n";

 

cin>>d1.day_no;

cout<<"month\n";

gets(d1.month);

 

cout<<"Year\n";

cin>>d1.year;

cout<<"day(monday\thursday)";

gets(d1.day);

cout<<"\n";

if(d1.day!=monday||thursday)

{

 

cout<<"Flight not in operation on"<<d1.day<<". please enter valid day only!\n";

}

else

{

 

cout<<"Please enter the name and age of the person(s) boarding\n";

cout<<"Name"<<"\t"<<"\t"<<"\t"<<"Age"<<"\n";

for(j=0;j<a1;j++)

{

gets(name);

cout<<"\t"<<"\t";

cin>>age;

cout<<"\n";

}

 

if(a==1)

{

 

cout<<"Total Cost="<<"\n";

cout<<"Basic Fare=Rs 11000\n";

cout<<"Fuel charges=Rs 9000\n";

cout<<"Travelling charges= Rs 10000\n";

unsigned long total=11000+9000+10000+(5000*ad)+(2000*ch);

cout<<total;

}

else if(a==2)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 10000\n";

cout<<"Fuel charges=Rs 8000\n";

cout<<"Travelling charges=Rs 9000\n";

unsigned long total=10000+8000+9000+(4000*ad)+(2500*ch);

cout<<total;

}

else

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 9000\n";

cout<<"Fuel Charges=Rs 6000\n";

cout<<"Travelling Charges=Rs 8000\n";

unsigned long total=9000+6000+8000+(3300*ad)+(1500*ch);

cout<<total;

}

}

else

{

cout<<"Sorry!seats are not available"<<"\n";

cout<<"Please book in other classes";

}

}

break;

}

 

 

case 4:

cout<<"Flights available from MALAYSIA to INDIA\n";

 

cout<<"Flight Name" <<"\t"<<"Flitght No."<<"\t"<<"Origin" <<"\t"<<"Arrival"<<"\t"<<"Departure"<<"\t"<<"Days of operation"<<"\n";

cout<<"1: Air India" <<"\t"<<"AI 0067" <<"\t"<<"Hyderabad"<<"\t"<<"11:45" <<"\t"<<"21:30" <<"\t"<<"Fri,Sun" <<"\n";

cout<<"2: Kingfisher" <<"\t"<<"KF 3209" <<"\t"<<"Banglore" <<"\t"<<"00:10" <<"\t"<<"20:20" <<"\t"<<"Wed,Fri" <<"\n";

cout<<"3: Jet Airways"<<"\t"<<"JA 1200" <<"\t"<<"Delhi" <<"\t"<<"9:30" <<"\t"<<"18:45" <<"\t"<<"Mon,Thurs,Sat" <<"\n";

cout<<"4: Kingfisher" <<"\t"<<"KF 0342" <<"\t"<<"Mumbai" <<"\t"<<"10:20" <<"\t"<<"20:40" <<"\t"<<"Tues,Thurs" <<"\n";

cout<<"5: Jet Airways"<<"\t"<<"JA 0078" <<"\t"<<"Kolkata" <<"\t"<<"11:20" <<"\t"<<"19:56" <<"\t"<<"Mon,Sat" <<"\n";

 

cout<<"\n";

 

cout<<"Please enter your choice\n";

cin>>a;

 

cout<<"Do you want to book the seat(s) in\n";

cout<<"1: First Class\n";

cout<<"2: Economy Class\n";

cout<<"3: Executive Class\n";

cout<<"Please enter your choice\n";

cin>>b;

switch(b)

{

 

case 1:

 

cout<<"Please enter the no. of person(s) boarding the plane\n";

cin>>a1;

if(a1<=25)

{

cout<<" Please enter the no. of adults (above 12)\n";

cin>>ad;

cout<<"Please enter the no. of children (below 12)\n";

cin>>ch;

cout<<"Please enter the date and day you are boarding the plane\n";

cout<<"Date\n";

 

cin>>d1.day_no;

cout<<"month\n";

gets(d1.month);

 

cout<<"Year\n";

cin>>d1.year;

cout<<"day(monday\thursday)";

gets(d1.day);

cout<<"\n";

if(d1.day!=monday||thursday)

{

 

cout<<"Flight not in operation on"<<d1.day<<". please enter valid day only!\n";

}

else

{

 

cout<<"Please enter the name and age of the person(s) boarding\n";

cout<<"Name"<<"\t"<<"\t"<<"\t"<<"Age"<<"\n";

for(j=0;j<a1;j++)

{

gets(name);

cout<<"\t"<<"\t";

cin>>age;

cout<<"\n";

}

 

if(a==1)

{

 

cout<<"Total Cost="<<"\n";

cout<<"Basic Fare=Rs 7000\n";

cout<<"Fuel charges=Rs 6000\n";

cout<<"Travelling charges= Rs 5700\n";

unsigned long total=7000+6000+5700+(3000*ad)+(1200*ch);

cout<<total;

}

else if(a==2)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 6500\n";

cout<<"Fuel charges=Rs 5000\n";

cout<<"Travelling charges=Rs 4800\n";

unsigned long total=6500+5000+4800+(2800*ad)+(1000*ch);

cout<<total;

}

else if(a==3)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 6000\n";

cout<<"Fuel Charges=Rs 4700\n";

cout<<"Travelling Charges=Rs 4000\n";

unsigned long total=5400+4700+4000+(2400*ad)+(900*ch);

cout<<total;

}

else if(a==4)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 5500\n";

cout<<"Fuel Charges=Rs 4500\n";

cout<<"Travelling Charges=Rs 3500\n";

unsigned long total=5000+4200+3500+(2000*ad)+(820*ch);

cout<<total;

}

else

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 5000\n";

cout<<"Fuel Charges=Rs 4200\n";

cout<<"Travelling Charges=Rs 3000\n";

unsigned long total=5000+4200+3000+(1500*ad)+(800*ch);

cout<<total;

}

}

else

{

cout<<"Sorry!seats are not available"<<"\n";

cout<<"Please book in other classes";

}

break;

}

 

 

case 2:

cout<<"Please enter the no. of person(s) boarding the plane\n";

cin>>a1;

if(a1<=10)

{

cout<<" Please enter the no. of adults (above 12)\n";

cin>>ad;

cout<<"Please enter the no. of children (below 12)\n";

cin>>ch;

cout<<"Please enter the date and day you are boarding the plane\n";

cout<<"Date\n";

 

cin>>d1.day_no;

cout<<"month\n";

gets(d1.month);

 

cout<<"Year\n";

cin>>d1.year;

cout<<"day(monday\thursday)";

gets(d1.day);

cout<<"\n";

if(d1.day!=monday||thursday)

{

 

cout<<"Flight not in operation on"<<d1.day<<". please enter valid day only!\n";

}

else

{

 

cout<<"Please enter the name and age of the person(s) boarding\n";

cout<<"Name"<<"\t"<<"\t"<<"\t"<<"Age"<<"\n";

for(j=0;j<a1;j++)

{

gets(name);

cout<<"\t"<<"\t";

cin>>age;

cout<<"\n";

}

 

if(a==1)

{

 

cout<<"Total Cost="<<"\n";

cout<<"Basic Fare=Rs 8000\n";

cout<<"Fuel charges=Rs 7700\n";

cout<<"Travelling charges= Rs 7000\n";

unsigned long total=8000+7700+7000+(4000*ad)+(2000*ch);

cout<<total;

}

else if(a==2)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 7000\n";

cout<<"Fuel charges=Rs 7000\n";

cout<<"Travelling charges=Rs 6000\n";

unsigned long total=7000+7000+6000+(3500*ad)+(1500*ch);

cout<<total;

}

else if(a==3)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 6500\n";

cout<<"Fuel Charges=Rs 6000\n";

cout<<"Travelling Charges=Rs 6000\n";

unsigned long total=7500+6000+6000+(3200*ad)+(1200*ch);

cout<<total;

}

else if(a==4)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 6000\n";

cout<<"Fuel Charges=Rs 5500\n";

cout<<"Travelling Charges=Rs 5000\n";

unsigned long total=6000+5500+6000+(3000*ad)+(1100*ch);

cout<<total;

}

else

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 6000\n";

cout<<"Fuel Charges=Rs 5500\n";

cout<<"Travelling Charges=Rs 6000\n";

unsigned long total=6000+5500+6000+(3000*ad)+(1500*ch);

cout<<total;

}

}

else

{

cout<<"Sorry!seats are not available"<<"\n";

cout<<"Please book in other classes";

}

break;

}

 

 

case 3:

cout<<"Please enter the no. of person(s) boarding the plane\n";

cin>>a1;

if(a1<=15)

{

cout<<" Please enter the no. of adults (above 12)\n";

cin>>ad;

cout<<"Please enter the no. of children (below 12)\n";

cin>>ch;

cout<<"Please enter the date and day you are boarding the plane\n";

cout<<"Date\n";

 

cin>>d1.day_no;

cout<<"month\n";

gets(d1.month);

 

cout<<"Year\n";

cin>>d1.year;

cout<<"day(monday\thursday)";

gets(d1.day);

cout<<"\n";

if(d1.day!=monday||thursday)

{

 

cout<<"Flight not in operation on"<<d1.day<<". please enter valid day only!\n";

}

else

{

 

cout<<"Please enter the name and age of the person(s) boarding\n";

cout<<"Name"<<"\t"<<"\t"<<"\t"<<"Age"<<"\n";

for(j=0;j<a1;j++)

{

gets(name);

cout<<"\t"<<"\t";

cin>>age;

cout<<"\n";

}

 

if(a==1)

{

 

cout<<"Total Cost="<<"\n";

cout<<"Basic Fare=Rs 8000\n";

cout<<"Fuel charges=Rs 7700\n";

cout<<"Travelling charges= Rs 7000\n";

unsigned long total=8000+7700+7000+(4500*ad)+(2000*ch);

cout<<total;

}

else if(a==2)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 7200\n";

cout<<"Fuel charges=Rs 7000\n";

cout<<"Travelling charges=Rs 6000\n";

unsigned long total=7200+7000+6000+(4000*ad)+(1800*ch);

cout<<total;

}

else if(a==3)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 6800\n";

cout<<"Fuel Charges=Rs 6500\n";

cout<<"Travelling Charges=Rs 5500\n";

unsigned long total=6800+6500+5500+(3500*ad)+(1500*ch);

cout<<total;

}

else if(a==4)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 7000\n";

cout<<"Fuel Charges=Rs 6200\n";

cout<<"Travelling Charges=Rs 5800\n";

unsigned long total=7000+6200+5800+(3000*ad)+(1200*ch);

cout<<total;

}

else

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 6500\n";

cout<<"Fuel Charges=Rs 6000\n";

cout<<"Travelling Charges=Rs 5000\n";

unsigned long total=6500+6000+5000+(3000*ad)+(1000*ch);

cout<<total;

}

 

}

else

{

cout<<"Sorry!seats are not available"<<"\n";

cout<<"Please book in other classes";

}

}

break;

}

 

 

 

case 5:

cout<<"Flights available from INDIA to NEW YORK\n";

 

cout<<"Flight Name" <<"\t"<<"Flitght No."<<"\t"<<"Origin" <<"\t"<<"Arrival"<<"\t"<<"Departure"<<"\t"<<"Days of operation"<<"\n";

cout<<"1: Air India" <<"\t"<<"AI 2785" <<"\t"<<"Hyderabad"<<"\t"<<"00:50" <<"\t"<<"27:34" <<"\t"<<"Wed,Fri" <<"\n";

cout<<"2: Kingfisher" <<"\t"<<"KF 5623" <<"\t"<<"Chennai" <<"\t"<<"13:30" <<"\t"<<"29:30" <<"\t"<<"Wed,,Thurs" <<"\n";

cout<<"3: Jet Airways"<<"\t"<<"JA 0967" <<"\t"<<"Delhi" <<"\t"<<"10:56" <<"\t"<<"23:40" <<"\t"<<"Sat,Sun,Mon" <<"\n";

cout<<"4: Kingfisher" <<"\t"<<"KF 4980" <<"\t"<<"Delhi" <<"\t"<<"11:10" <<"\t"<<"24:50" <<"\t"<<"Tues,Wed,Sat" <<"\n";

cout<<"5: Jet Airways"<<"\t"<<"JA 4562" <<"\t"<<"Mumbai" <<"\t"<<"11:20" <<"\t"<<"27:45" <<"\t"<<"Mon,Sat" <<"\n";

cout<<"6: Air India" <<"\t"<<"AI 0079" <<"\t"<<"Amritsar" <<"\t"<<"00:20" <<"\t"<<"25:20" <<"\t"<<"Sun,Wed,Fri" <<"\n"; cout<<"\n";

cout<<"\n";

 

cout<<"Please enter your choice\n";

cin>>a;

 

cout<<"Do you want to book the seat(s) in\n";

cout<<"1: First Class\n";

cout<<"2: Economy Class\n";

cout<<"3: Executive Class\n";

cout<<"Please enter your choice\n";

cin>>b;

switch(b)

{

 

case 1:

 

cout<<"Please enter the no. of person(s) boarding the plane\n";

cin>>a1;

if(a1<=30)

{

cout<<" Please enter the no. of adults (above 12)\n";

cin>>ad;

cout<<"Please enter the no. of children (below 12)\n";

cin>>ch;

cout<<"Please enter the date and day you are boarding the plane\n";

cout<<"Date\n";

 

cin>>d1.day_no;

cout<<"month\n";

gets(d1.month);

 

cout<<"Year\n";

cin>>d1.year;

cout<<"day(monday\thursday)";

gets(d1.day);

cout<<"\n";

if(d1.day!=monday||thursday)

{

 

cout<<"Flight not in operation on"<<d1.day<<". please enter valid day only!\n";

}

else

{

 

cout<<"Please enter the name and age of the person(s) boarding\n";

cout<<"Name"<<"\t"<<"\t"<<"\t"<<"Age"<<"\n";

for(j=0;j<a1;j++)

{

gets(name);

cout<<"\t"<<"\t";

cin>>age;

cout<<"\n";

}

 

if(a==1)

{

 

cout<<"Total Cost="<<"\n";

cout<<"Basic Fare=Rs 9000\n";

cout<<"Fuel charges=Rs 8000\n";

cout<<"Travelling charges= Rs 9000\n";

unsigned long total=9000+8000+9000+(5000*ad)+(2000*ch);

cout<<total;

}

else if(a==2)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 9500\n";

cout<<"Fuel charges=Rs 7500\n";

cout<<"Travelling charges=Rs 8000\n";

unsigned long total=9500+7500+8000+(4500*ad)+(1500*ch);

cout<<total;

}

else if(a==3)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 8500\n";

cout<<"Fuel Charges=Rs 8000\n";

cout<<"Travelling Charges=Rs 7000\n";

unsigned long total=8500+8000+7000+(4000*ad)+(1800*ch);

cout<<total;

}

else if(a==4)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 7000\n";

cout<<"Fuel Charges=Rs 5000\n";

cout<<"Travelling Charges=Rs 6000\n";

unsigned long total=7000+5000+6000+(3400*ad)+(1300*ch);

cout<<total;

}

}

else

{

cout<<"Sorry!seats are not available"<<"\n";

cout<<"Please book in other classes";

}

break;

}

 

 

case 2:

cout<<"Please enter the no. of person(s) boarding the plane\n";

cin>>a1;

if(a1<=14)

{

cout<<" Please enter the no. of adults (above 12)\n";

cin>>ad;

cout<<"Please enter the no. of children (below 12)\n";

cin>>ch;

cout<<"Please enter the date and day you are boarding the plane\n";

cout<<"Date\n";

 

cin>>d1.day_no;

cout<<"month\n";

gets(d1.month);

 

cout<<"Year\n";

cin>>d1.year;

cout<<"day(monday\thursday)";

gets(d1.day);

cout<<"\n";

if(d1.day!=monday||thursday)

{

 

cout<<"Flight not in operation on"<<d1.day<<". please enter valid day only!\n";

}

else

{

 

cout<<"Please enter the name and age of the person(s) boarding\n";

cout<<"Name"<<"\t"<<"\t"<<"\t"<<"Age"<<"\n";

for(j=0;j<a1;j++)

{

gets(name);

cout<<"\t"<<"\t";

cin>>age;

cout<<"\n";

}

 

if(a==1)

{

 

cout<<"Total Cost="<<"\n";

cout<<"Basic Fare=Rs 8000\n";

cout<<"Fuel charges=Rs 7000\n";

cout<<"Travelling charges= Rs 7000\n";

unsigned long total=8000+7000+7000+(3600*ad)+(2000*ch);

cout<<total;

}

else if(a==2)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 6000\n";

cout<<"Fuel charges=Rs 5000\n";

cout<<"Travelling charges=Rs 6000\n";

unsigned long total=6000+5000+6000+(3200*ad)+(1100*ch);

cout<<total;

}

else if(a==3)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 7500\n";

cout<<"Fuel Charges=Rs 5000\n";

cout<<"Travelling Charges=Rs 6000\n";

unsigned long total=7500+5000+6000+(2500*ad)+(1000*ch);

cout<<total;

}

else

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 6500\n";

cout<<"Fuel Charges=Rs 5200\n";

cout<<"Travelling Charges=Rs 6000\n";

unsigned long total=6500+5200+6000+(4000*ad)+(2000*ch);

cout<<total;

}

}

else

{

cout<<"Sorry!seats are not available"<<"\n";

cout<<"Please book in other classes";

}

break;

}

 

 

case 3:

cout<<"Please enter the no. of person(s) boarding the plane\n";

cin>>a1;

if(a1<=10)

{

cout<<" Please enter the no. of adults (above 12)\n";

cin>>ad;

cout<<"Please enter the no. of children (below 12)\n";

cin>>ch;

cout<<"Please enter the date and day you are boarding the plane\n";

cout<<"Date\n";

 

cin>>d1.day_no;

cout<<"month\n";

gets(d1.month);

 

cout<<"Year\n";

cin>>d1.year;

cout<<"day(monday\thursday)";

gets(d1.day);

cout<<"\n";

if(d1.day!=monday||thursday)

{

 

cout<<"Flight not in operation on"<<d1.day<<". please enter valid day only!\n";

}

else

{

 

cout<<"Please enter the name and age of the person(s) boarding\n";

cout<<"Name"<<"\t"<<"\t"<<"\t"<<"Age"<<"\n";

for(j=0;j<a1;j++)

{

gets(name);

cout<<"\t"<<"\t";

cin>>age;

cout<<"\n";

}

 

if(a==1)

{

 

cout<<"Total Cost="<<"\n";

cout<<"Basic Fare=Rs 9900\n";

cout<<"Fuel charges=Rs 8000\n";

cout<<"Travelling charges= Rs 7000\n";

unsigned long total=9900+8000+7000+(4500*ad)+(2000*ch);

cout<<total;

}

else if(a==2)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 8000\n";

cout<<"Fuel charges=Rs 6000\n";

cout<<"Travelling charges=Rs 5600\n";

unsigned long total=8000+6000+5600+(3500*ad)+(1500*ch);

cout<<total;

}

else if(a==3)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 7200\n";

cout<<"Fuel Charges=Rs 6500\n";

cout<<"Travelling Charges=Rs 4800\n";

unsigned long total=7200+6500+4800+(3100*ad)+(1100*ch);

cout<<total;

}

else

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 7500\n";

cout<<"Fuel Charges=Rs 5500\n";

cout<<"Travelling Charges=Rs 4500\n";

unsigned long total=7500+5500+4500+(2900*ad)+(1200*ch);

cout<<total;

}

}

else

{

cout<<"Sorry!seats are not available"<<"\n";

cout<<"Please book in other classes";

}

}

break;

}

 

 

 

case 6:

 

cout<<"Flights available from DUBAI to INDIA\n";

 

cout<<"Flight Name" <<"\t"<<"Flitght No."<<"\t"<<"Origin" <<"\t"<<"Arrival"<<"\t"<<"Departure"<<"\t"<<"Days of operation"<<"\n";

cout<<"1: Air India" <<"\t"<<"AI 4325" <<"\t"<<"Mumbai" <<"\t"<<"11:05" <<"\t"<<"18:34" <<"\t"<<"Wed,Thurs" <<"\n";

cout<<"2: Kingfisher" <<"\t"<<"KF 9856" <<"\t"<<"Chennai"<<"\t"<<"00:45" <<"\t"<<"21:33" <<"\t"<<"Wed,Fri,Sun" <<"\n";

cout<<"3: Jet Airways"<<"\t"<<"JA 7645" <<"\t"<<"Delhi" <<"\t"<<"13:30" <<"\t"<<"22:54" <<"\t"<<"Sat,Sun" <<"\n";

cout<<"4: Kingfisher" <<"\t"<<"KF 7856" <<"\t"<<"Kolkata"<<"\t"<<"9:23" <<"\t"<<"17:56" <<"\t"<<"Tues,Wed,Sat" <<"\n";

cout<<"\n";

 

cout<<"Please enter your choice\n";

cin>>a;

 

cout<<"Do you want to book the seat(s) in\n";

cout<<"1: First Class\n";

cout<<"2: Economy Class\n";

cout<<"3: Executive Class\n";

cout<<"Please enter your choice\n";

cin>>b;

switch(b)

{

 

case 1:

 

cout<<"Please enter the no. of person(s) boarding the plane\n";

cin>>a1;

if(a1<=32)

{

cout<<" Please enter the no. of adults (above 12)\n";

cin>>ad;

cout<<"Please enter the no. of children (below 12)\n";

cin>>ch;

cout<<"Please enter the date and day you are boarding the plane\n";

cout<<"Date\n";

 

cin>>d1.day_no;

cout<<"month\n";

gets(d1.month);

 

cout<<"Year\n";

cin>>d1.year;

cout<<"day(monday\thursday)";

gets(d1.day);

cout<<"\n";

if(d1.day!=monday||thursday)

{

 

cout<<"Flight not in operation on"<<d1.day<<". please enter valid day only!\n";

}

else

{

cout<<"\n";

 

cout<<"Please enter the name and age of the person(s) boarding\n";

cout<<"Name"<<"\t"<<"\t"<<"\t"<<"Age"<<"\n";

for(j=0;j<a1;j++)

{

gets(name);

cout<<"\t"<<"\t";

cin>>age;

cout<<"\n";

}

 

if(a==1)

{

 

cout<<"Total Cost="<<"\n";

cout<<"Basic Fare=Rs 7000\n";

cout<<"Fuel charges=Rs 8000\n";

cout<<"Travelling charges= Rs 9000\n";

unsigned long total=7000+8000+9000+(4000*ad)+(1000*ch);

cout<<total;

}

else if(a==2)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 6000\n";

cout<<"Fuel charges=Rs 7000\n";

cout<<"Travelling charges=Rs 8000\n";

unsigned long total=6000+7000+8000+(3000*ad)+(1100*ch);

cout<<total;

}

else if(a==3)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 7000\n";

cout<<"Fuel Charges=Rs 4000\n";

cout<<"Travelling Charges=Rs 6000\n";

unsigned long total=7000+4000+6000+(2800*ad)+(1000*ch);

cout<<total;

}

else

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 7000\n";

cout<<"Fuel Charges=Rs 5000\n";

cout<<"Travelling Charges=Rs 6000\n";

unsigned long total=7000+5000+6000+(3400*ad)+(1300*ch);

cout<<total;

}

}

else

{

cout<<"Sorry!seats are not available"<<"\n";

cout<<"Please book in other classes";

}

break;

}

 

 

case 2:

cout<<"Please enter the no. of person(s) boarding the plane\n";

cin>>a1;

if(a1<=14)

{

cout<<" Please enter the no. of adults (above 12)\n";

cin>>ad;

cout<<"Please enter the no. of children (below 12)\n";

cin>>ch;

cout<<"Please enter the date and day you are boarding the plane\n";

cout<<"Date\n";

 

cin>>d1.day_no;

cout<<"month\n";

gets(d1.month);

 

cout<<"Year\n";

cin>>d1.year;

cout<<"day(monday\thursday)";

gets(d1.day);

cout<<"\n";

if(d1.day!=monday||thursday)

{

 

cout<<"Flight not in operation on"<<d1.day<<". please enter valid day only!\n";

}

else

{

 

cout<<"Please enter the name and age of the person(s) boarding\n";

cout<<"Name"<<"\t"<<"\t"<<"\t"<<"Age"<<"\n";

for(j=0;j<a1;j++)

{

gets(name);

cout<<"\t"<<"\t";

cin>>age;

cout<<"\n";

}

 

if(a==1)

{

 

cout<<"Total Cost="<<"\n";

cout<<"Basic Fare=Rs 8000\n";

cout<<"Fuel charges=Rs 7000\n";

cout<<"Travelling charges= Rs 7000\n";

unsigned long total=8000+7000+7000+(3600*ad)+(2000*ch);

cout<<total;

}

else if(a==2)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 6000\n";

cout<<"Fuel charges=Rs 5000\n";

cout<<"Travelling charges=Rs 6000\n";

unsigned long total=6000+5000+6000+(3200*ad)+(1100*ch);

cout<<total;

}

else if(a==3)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 7500\n";

cout<<"Fuel Charges=Rs 5000\n";

cout<<"Travelling Charges=Rs 6000\n";

unsigned long total=7500+5000+6000+(2500*ad)+(1000*ch);

cout<<total;

}

else

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 6500\n";

cout<<"Fuel Charges=Rs 5200\n";

cout<<"Travelling Charges=Rs 6000\n";

unsigned long total=6500+5200+6000+(4000*ad)+(2000*ch);

cout<<total;

}

}

else

{

cout<<"Sorry!seats are not available"<<"\n";

cout<<"Please book in other classes";

}

break;

}

 

case 3:

cout<<"Please enter the no. of person(s) boarding the plane\n";

cin>>a1;

if(a1<=10)

{

cout<<" Please enter the no. of adults (above 12)\n";

cin>>ad;

cout<<"Please enter the no. of children (below 12)\n";

cin>>ch;

cout<<"Please enter the date and day you are boarding the plane\n";

cout<<"Date\n";

 

cin>>d1.day_no;

cout<<"month\n";

gets(d1.month);

 

cout<<"Year\n";

cin>>d1.year;

cout<<"day(monday\thursday)";

gets(d1.day);

cout<<"\n";

if(d1.day!=monday||thursday)

{

 

cout<<"Flight not in operation on"<<d1.day<<". please enter valid day only!\n";

}

else

{

cout<<"\n";

 

cout<<"Please enter the name and age of the person(s) boarding\n";

cout<<"Name"<<"\t"<<"\t"<<"\t"<<"Age"<<"\n";

for(j=0;j<a1;j++)

{

gets(name);

cout<<"\t"<<"\t";

cin>>age;

cout<<"\n";

}

 

if(a==1)

{

 

cout<<"Total Cost="<<"\n";

cout<<"Basic Fare=Rs 9900\n";

cout<<"Fuel charges=Rs 8000\n";

cout<<"Travelling charges= Rs 7000\n";

unsigned long total=9900+8000+7000+(4500*ad)+(2000*ch);

cout<<total;

}

else if(a==2)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 8000\n";

cout<<"Fuel charges=Rs 6000\n";

cout<<"Travelling charges=Rs 5600\n";

unsigned long total=8000+6000+5600+(3500*ad)+(1500*ch);

cout<<total;

}

else if(a==3)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 7200\n";

cout<<"Fuel Charges=Rs 6500\n";

cout<<"Travelling Charges=Rs 4800\n";

unsigned long total=7200+6500+4800+(3100*ad)+(1100*ch);

cout<<total;

}

else

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 7500\n";

cout<<"Fuel Charges=Rs 5500\n";

cout<<"Travelling Charges=Rs 4500\n";

unsigned long total=7500+5500+4500+(2900*ad)+(1200*ch);

cout<<total;

}

}

else

{

cout<<"Sorry!seats are not available"<<"\n";

cout<<"Please book in other classes";

}

}

break;

}

 

 

 

case 7:

cout<<"Flights available from SINGAPORE to INDIA\n";

 

cout<<"Flight Name" <<"\t"<<"Flitght No."<<"\t"<<"Origin" <<"\t"<<"Arrival"<<"\t"<<"Departure"<<"\t"<<"Days of operation"<<"\n";

cout<<"1: Air India" <<"\t"<<"AI 0809 " <<"\t"<<"Mumbai" <<"\t"<<"00:20" <<"\t"<<"21:30" <<"\t"<<"Mon,Wed" <<"\n";

cout<<"2: Kingfisher" <<"\t"<<"KF 1427" <<"\t"<<"Mangalore"<<"\t"<<"10:45" <<"\t"<<"20:56" <<"\t"<<"Fri,Sun" <<"\n";

cout<<"3: Jet Airways"<<"\t"<<"JA 5874" <<"\t"<<"Delhi" <<"\t"<<"11:55" <<"\t"<<"19:23" <<"\t"<<"Tues,Thurs,Sat" <<"\n";

 

 

cout<<"\n";

 

cout<<"Please enter your choice\n";

cin>>a;

 

cout<<"Do you want to book the seat(s) in\n";

cout<<"1: First Class\n";

cout<<"2: Economy Class\n";

cout<<"3: Executive Class\n";

cout<<"Please enter your choice\n";

cin>>b;

switch(b)

{

 

case 1:

 

cout<<"Please enter the no. of person(s) boarding the plane\n";

cin>>a1;

if(a1<=15)

{

cout<<" Please enter the no. of adults (above 12)\n";

cin>>ad;

cout<<"Please enter the no. of children (below 12)\n";

cin>>ch;

cout<<"Please enter the date and day you are boarding the plane\n";

cout<<"Date\n";

 

cin>>d1.day_no;

cout<<"month\n";

gets(d1.month);

 

cout<<"Year\n";

cin>>d1.year;

cout<<"day(monday\thursday)";

gets(d1.day);

cout<<"\n";

if(d1.day!=monday||thursday)

{

 

cout<<"Flight not in operation on"<<d1.day<<". please enter valid day only!\n";

}

else

{

cout<<"Please enter the name and age of the person(s) boarding\n";

cout<<"Name"<<"\t"<<"\t"<<"\t"<<"Age"<<"\n";

for(j=0;j<a1;j++)

{

gets(name);

cout<<"\t"<<"\t";

cin>>age;

cout<<"\n";

}

 

if(a==1)

{

 

cout<<"Total Cost="<<"\n";

cout<<"Basic Fare=Rs 8000\n";

cout<<"Fuel charges=Rs 7000\n";

cout<<"Travelling charges= Rs 6000\n";

unsigned long total=8000+7000+6000+(4800*ad)+(2000*ch);

cout<<total;

}

else if(a==2)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 7500\n";

cout<<"Fuel charges=Rs 6800\n";

cout<<"Travelling charges=Rs 5500\n";

unsigned long total=7500+6800+4800+(4500*ad)+(1800*ch);

cout<<total;

}

else if(a==3)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 7000\n";

cout<<"Fuel Charges=Rs 6000\n";

cout<<"Travelling Charges=Rs 5000\n";

unsigned long total=7000+6000+5000+(4000*ad)+(1500*ch);

cout<<total;

}

}

 

else

{

cout<<"Sorry!seats are not available"<<"\n";

cout<<"Please book in other classes";

}

break;

}

 

 

case 2:

cout<<"Please enter the no. of person(s) boarding the plane\n";

cin>>a1;

if(a1<=28)

{

cout<<" Please enter the no. of adults (above 12)\n";

cin>>ad;

cout<<"Please enter the no. of children (below 12)\n";

cin>>ch;

cout<<"Please enter the date and day you are boarding the plane\n";

cout<<"Date\n";

 

cin>>d1.day_no;

cout<<"month\n";

gets(d1.month);

 

cout<<"Year\n";

cin>>d1.year;

cout<<"day(monday\thursday)";

gets(d1.day);

cout<<"\n";

if(d1.day!=monday||thursday)

{

 

cout<<"Flight not in operation on"<<d1.day<<". please enter valid day only!\n";

}

else

{

 

cout<<"Please enter the name and age of the person(s) boarding\n";

cout<<"Name"<<"\t"<<"\t"<<"\t"<<"Age"<<"\n";

for(j=0;j<a1;j++)

{

gets(name);

cout<<"\t"<<"\t";

cin>>age;

cout<<"\n";

}

 

if(a==1)

{

 

cout<<"Total Cost="<<"\n";

cout<<"Basic Fare=Rs 8000\n";

cout<<"Fuel charges=Rs 7500\n";

cout<<"Travelling charges= Rs 7000\n";

unsigned long total=8000+7500+7000+(5000*ad)+(2000*ch);

cout<<total;

}

else if(a==2)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 7600\n";

cout<<"Fuel charges=Rs 7050\n";

cout<<"Travelling charges=Rs 7005\n";

unsigned long total=7600+7050+7005+(4500*ad)+(1500*ch);

cout<<total;

}

else if(a==3)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 7000\n";

cout<<"Fuel Charges=Rs 6600\n";

cout<<"Travelling Charges=Rs 6200\n";

unsigned long total=7000+6600+6200+(4200*ad)+(1200*ch);

cout<<total;

}

}

else

{

cout<<"Sorry!seats are not available"<<"\n";

cout<<"Please book in other classes";

}

break;

}

 

 

case 3:

cout<<"Please enter the no. of person(s) boarding the plane\n";

cin>>a1;

if(a1<=18)

{

cout<<" Please enter the no. of adults (above 12)\n";

cin>>ad;

cout<<"Please enter the no. of children (below 12)\n";

cin>>ch;

cout<<"Please enter the date and day you are boarding the plane\n";

cout<<"Date\n";

 

cin>>d1.day_no;

cout<<"month\n";

gets(d1.month);

 

cout<<"Year\n";

cin>>d1.year;

cout<<"day(monday\thursday)";

gets(d1.day);

cout<<"\n";

if(d1.day!=monday||thursday)

{

 

cout<<"Flight not in operation on"<<d1.day<<". please enter valid day only!\n";

}

else

{

 

cout<<"Please enter the name and age of the person(s) boarding\n";

cout<<"Name"<<"\t"<<"\t"<<"\t"<<"Age"<<"\n";

for(j=0;j<a1;j++)

{

gets(name);

cout<<"\t"<<"\t";

cin>>age;

cout<<"\n";

}

 

if(a==1)

{

 

cout<<"Total Cost="<<"\n";

cout<<"Basic Fare=Rs 9000\n";

cout<<"Fuel charges=Rs 8000\n";

cout<<"Travelling charges= Rs 7000\n";

unsigned long total=9000+8000+7000+(5700*ad)+(2500*ch);

cout<<total;

}

else if(a==2)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 8500\n";

cout<<"Fuel charges=Rs 7500\n";

cout<<"Travelling charges=Rs 6500\n";

unsigned long total=8500+7500+6500+(5000*ad)+(2000*ch);

cout<<total;

}

else if(a==3)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 8000\n";

cout<<"Fuel Charges=Rs 7000\n";

cout<<"Travelling Charges=Rs 6000\n";

unsigned long total=8000+7000+6000+(4500*ad)+(1500*ch);

cout<<total;

}

}

else

{

cout<<"Sorry!seats are not available"<<"\n";

cout<<"Please book in other classes";

}

}

break;

}

 

 

 

 

case 8:

cout<<"Flights available from INDIA to MALAYSIA\n";

 

cout<<"Flight Name" <<"\t"<<"Flitght No."<<"\t"<<"Origin" <<"\t"<<"Arrival"<<"\t"<<"Departure"<<"\t"<<"Days of operation"<<"\n";

cout<<"1: Air India" <<"\t"<<"AI 0067" <<"\t"<<"Hyderabad"<<"\t"<<"11:45" <<"\t"<<"21:30" <<"\t"<<"Fri,Sun" <<"\n";

cout<<"2: Kingfisher" <<"\t"<<"KF 3209" <<"\t"<<"Banglore" <<"\t"<<"00:10" <<"\t"<<"20:20" <<"\t"<<"Wed,Fri" <<"\n";

cout<<"3: Jet Airways"<<"\t"<<"JA 1200" <<"\t"<<"Delhi" <<"\t"<<"9:30" <<"\t"<<"18:45" <<"\t"<<"Mon,Thurs,Sat" <<"\n";

cout<<"4: Kingfisher" <<"\t"<<"KF 0342" <<"\t"<<"Mumbai" <<"\t"<<"10:20" <<"\t"<<"20:40" <<"\t"<<"Tues,Thurs" <<"\n";

cout<<"5: Jet Airways"<<"\t"<<"JA 0078" <<"\t"<<"Kolkata" <<"\t"<<"11:20" <<"\t"<<"19:56" <<"\t"<<"Mon,Sat" <<"\n";

 

cout<<"\n";

 

cout<<"Please enter your choice\n";

cin>>a;

 

cout<<"Do you want to book the seat(s) in\n";

cout<<"1: First Class\n";

cout<<"2: Economy Class\n";

cout<<"3: Executive Class\n";

cout<<"Please enter your choice\n";

cin>>b;

switch(b)

{

 

case 1:

 

cout<<"Please enter the no. of person(s) boarding the plane\n";

cin>>a1;

if(a1<=25)

{

cout<<" Please enter the no. of adults (above 12)\n";

cin>>ad;

cout<<"Please enter the no. of children (below 12)\n";

cin>>ch;

cout<<"Please enter the date and day you are boarding the plane\n";

cout<<"Date\n";

 

cin>>d1.day_no;

cout<<"month\n";

gets(d1.month);

 

cout<<"Year\n";

cin>>d1.year;

cout<<"day(monday\thursday)";

gets(d1.day);

cout<<"\n";

if(d1.day!=monday||thursday)

{

 

cout<<"Flight not in operation on"<<d1.day<<". please enter valid day only!\n";

}

else

{

 

cout<<"Please enter the name and age of the person(s) boarding\n";

cout<<"Name"<<"\t"<<"\t"<<"\t"<<"Age"<<"\n";

for(j=0;j<a1;j++)

{

gets(name);

cout<<"\t"<<"\t";

cin>>age;

cout<<"\n";

}

 

if(a==1)

{

 

cout<<"Total Cost="<<"\n";

cout<<"Basic Fare=Rs 7000\n";

cout<<"Fuel charges=Rs 6000\n";

cout<<"Travelling charges= Rs 5700\n";

unsigned long total=7000+6000+5700+(3000*ad)+(1200*ch);

cout<<total;

}

else if(a==2)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 6500\n";

cout<<"Fuel charges=Rs 5000\n";

cout<<"Travelling charges=Rs 4800\n";

unsigned long total=6500+5000+4800+(2800*ad)+(1000*ch);

cout<<total;

}

else if(a==3)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 6000\n";

cout<<"Fuel Charges=Rs 4700\n";

cout<<"Travelling Charges=Rs 4000\n";

unsigned long total=5400+4700+4000+(2400*ad)+(900*ch);

cout<<total;

}

else if(a==4)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 5500\n";

cout<<"Fuel Charges=Rs 4500\n";

cout<<"Travelling Charges=Rs 3500\n";

unsigned long total=5000+4200+3500+(2000*ad)+(820*ch);

cout<<total;

}

else

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 5000\n";

cout<<"Fuel Charges=Rs 4200\n";

cout<<"Travelling Charges=Rs 3000\n";

unsigned long total=5000+4200+3000+(1500*ad)+(800*ch);

cout<<total;

}

}

else

{

cout<<"Sorry!seats are not available"<<"\n";

cout<<"Please book in other classes";

}

break;

}

 

 

case 2:

cout<<"Please enter the no. of person(s) boarding the plane\n";

cin>>a1;

if(a1<=10)

{

cout<<" Please enter the no. of adults (above 12)\n";

cin>>ad;

cout<<"Please enter the no. of children (below 12)\n";

cin>>ch;

cout<<"Please enter the date and day you are boarding the plane\n";

cout<<"Date\n";

 

cin>>d1.day_no;

cout<<"month\n";

gets(d1.month);

 

cout<<"Year\n";

cin>>d1.year;

cout<<"day(monday\thursday)";

gets(d1.day);

cout<<"\n";

if(d1.day!=monday||thursday)

{

 

cout<<"Flight not in operation on"<<d1.day<<". please enter valid day only!\n";

}

else

{

 

cout<<"Please enter the name and age of the person(s) boarding\n";

cout<<"Name"<<"\t"<<"\t"<<"\t"<<"Age"<<"\n";

for(j=0;j<a1;j++)

{

gets(name);

cout<<"\t"<<"\t";

cin>>age;

cout<<"\n";

}

 

if(a==1)

{

 

cout<<"Total Cost="<<"\n";

cout<<"Basic Fare=Rs 8000\n";

cout<<"Fuel charges=Rs 7700\n";

cout<<"Travelling charges= Rs 7000\n";

unsigned long total=8000+7700+7000+(4000*ad)+(2000*ch);

cout<<total;

}

else if(a==2)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 7000\n";

cout<<"Fuel charges=Rs 7000\n";

cout<<"Travelling charges=Rs 6000\n";

unsigned long total=7000+7000+6000+(3500*ad)+(1500*ch);

cout<<total;

}

else if(a==3)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 6500\n";

cout<<"Fuel Charges=Rs 6000\n";

cout<<"Travelling Charges=Rs 6000\n";

unsigned long total=7500+6000+6000+(3200*ad)+(1200*ch);

cout<<total;

}

else if(a==4)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 6000\n";

cout<<"Fuel Charges=Rs 5500\n";

cout<<"Travelling Charges=Rs 5000\n";

unsigned long total=6000+5500+6000+(3000*ad)+(1100*ch);

cout<<total;

}

else

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 6000\n";

cout<<"Fuel Charges=Rs 5500\n";

cout<<"Travelling Charges=Rs 6000\n";

unsigned long total=6000+5500+6000+(3000*ad)+(1500*ch);

cout<<total;

}

}

else

{

cout<<"Sorry!seats are not available"<<"\n";

cout<<"Please book in other classes";

}

break;

}

 

 

case 3:

cout<<"Please enter the no. of person(s) boarding the plane\n";

cin>>a1;

if(a1<=15)

{

cout<<" Please enter the no. of adults (above 12)\n";

cin>>ad;

cout<<"Please enter the no. of children (below 12)\n";

cin>>ch;

cout<<"Please enter the date and day you are boarding the plane\n";

cout<<"Date\n";

 

cin>>d1.day_no;

cout<<"month\n";

gets(d1.month);

 

cout<<"Year\n";

cin>>d1.year;

cout<<"day(monday\thursday)";

gets(d1.day);

cout<<"\n";

if(d1.day!=monday||thursday)

{

 

cout<<"Flight not in operation on"<<d1.day<<". please enter valid day only!\n";

}

else

{

 

cout<<"Please enter the name and age of the person(s) boarding\n";

cout<<"Name"<<"\t"<<"\t"<<"\t"<<"Age"<<"\n";

for(j=0;j<a1;j++)

{

gets(name);

cout<<"\t"<<"\t";

cin>>age;

cout<<"\n";

}

 

if(a==1)

{

 

cout<<"Total Cost="<<"\n";

cout<<"Basic Fare=Rs 8000\n";

cout<<"Fuel charges=Rs 7700\n";

cout<<"Travelling charges= Rs 7000\n";

unsigned long total=8000+7700+7000+(4500*ad)+(2000*ch);

cout<<total;

}

else if(a==2)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 7200\n";

cout<<"Fuel charges=Rs 7000\n";

cout<<"Travelling charges=Rs 6000\n";

unsigned long total=7200+7000+6000+(4000*ad)+(1800*ch);

cout<<total;

}

else if(a==3)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 6800\n";

cout<<"Fuel Charges=Rs 6500\n";

cout<<"Travelling Charges=Rs 5500\n";

unsigned long total=6800+6500+5500+(3500*ad)+(1500*ch);

cout<<total;

}

else if(a==4)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 7000\n";

cout<<"Fuel Charges=Rs 6200\n";

cout<<"Travelling Charges=Rs 5800\n";

unsigned long total=7000+6200+5800+(3000*ad)+(1200*ch);

cout<<total;

}

else

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 6500\n";

cout<<"Fuel Charges=Rs 6000\n";

cout<<"Travelling Charges=Rs 5000\n";

unsigned long total=6500+6000+5000+(3000*ad)+(1000*ch);

cout<<total;

}

 

}

else

{

cout<<"Sorry!seats are not available"<<"\n";

cout<<"Please book in other classes";

}

}

break;

}

 

 

 

case 10:

cout<<"Flights available from INDIA to SINGAPORE\n";

 

cout<<"Flight Name" <<"\t"<<"Flitght No."<<"\t"<<"Origin" <<"\t"<<"Arrival"<<"\t"<<"Departure"<<"\t"<<"Days of operation"<<"\n";

cout<<"1: Air India" <<"\t"<<"AI 0809 " <<"\t"<<"Mumbai" <<"\t"<<"00:20" <<"\t"<<"21:30" <<"\t"<<"Mon,Wed" <<"\n";

cout<<"2: Kingfisher" <<"\t"<<"KF 1427" <<"\t"<<"Mangalore"<<"\t"<<"10:45" <<"\t"<<"20:56" <<"\t"<<"Fri,Sun" <<"\n";

cout<<"3: Jet Airways"<<"\t"<<"JA 5874" <<"\t"<<"Delhi" <<"\t"<<"11:55" <<"\t"<<"19:23" <<"\t"<<"Tues,Thurs,Sat" <<"\n";

 

 

cout<<"\n";

 

cout<<"Please enter your choice\n";

cin>>a;

 

cout<<"Do you want to book the seat(s) in\n";

cout<<"1: First Class\n";

cout<<"2: Economy Class\n";

cout<<"3: Executive Class\n";

cout<<"Please enter your choice\n";

cin>>b;

switch(b)

{

 

case 1:

 

cout<<"Please enter the no. of person(s) boarding the plane\n";

cin>>a1;

if(a1<=15)

{

cout<<" Please enter the no. of adults (above 12)\n";

cin>>ad;

cout<<"Please enter the no. of children (below 12)\n";

cin>>ch;

cout<<"Please enter the date and day you are boarding the plane\n";

cout<<"Date\n";

 

cin>>d1.day_no;

cout<<"month\n";

gets(d1.month);

 

cout<<"Year\n";

cin>>d1.year;

cout<<"day(monday\thursday)";

gets(d1.day);

cout<<"\n";

if(d1.day!=monday||thursday)

{

 

cout<<"Flight not in operation on"<<d1.day<<". please enter valid day only!\n";

}

else

{

 

cout<<"Please enter the name and age of the person(s) boarding\n";

cout<<"Name"<<"\t"<<"\t"<<"\t"<<"Age"<<"\n";

for(j=0;j<a1;j++)

{

gets(name);

cout<<"\t"<<"\t";

cin>>age;

cout<<"\n";

}

 

if(a==1)

{

 

cout<<"Total Cost="<<"\n";

cout<<"Basic Fare=Rs 8000\n";

cout<<"Fuel charges=Rs 7000\n";

cout<<"Travelling charges= Rs 6000\n";

unsigned long total=8000+7000+6000+(4800*ad)+(2000*ch);

cout<<total;

}

else if(a==2)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 7500\n";

cout<<"Fuel charges=Rs 6800\n";

 

unsigned long total=7500+6800+4800+(4500*ad)+(1800*ch);

cout<<total;

}

else if(a==3)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 7000\n";

cout<<"Fuel Charges=Rs 6000\n";

cout<<"Travelling Charges=Rs 5000\n";

unsigned long total=7000+6000+5000+(4000*ad)+(1500*ch);

cout<<total;

}

}

 

else

{

cout<<"Sorry!seats are not available"<<"\n";

cout<<"Please book in other classes";

}

break;

}

 

 

case 2:

cout<<"Please enter the no. of person(s) boarding the plane\n";

cin>>a1;

if(a1<=28)

{

cout<<" Please enter the no. of adults (above 12)\n";

cin>>ad;

cout<<"Please enter the no. of children (below 12)\n";

cin>>ch;

cout<<"Please enter the date and day you are boarding the plane\n";

cout<<"Date\n";

 

cin>>d1.day_no;

cout<<"month\n";

gets(d1.month);

 

cout<<"Year\n";

cin>>d1.year;

cout<<"day(monday\thursday)";

gets(d1.day);

cout<<"\n";

if(d1.day!=monday||thursday)

{

 

cout<<"Flight not in operation on"<<d1.day<<". please enter valid day only!\n";

}

else

{

 

cout<<"Please enter the name and age of the person(s) boarding\n";

cout<<"Name"<<"\t"<<"\t"<<"\t"<<"Age"<<"\n";

for(j=0;j<a1;j++)

{

gets(name);

cout<<"\t"<<"\t";

cin>>age;

cout<<"\n";

}

 

if(a==1)

{

 

cout<<"Total Cost="<<"\n";

cout<<"Basic Fare=Rs 8000\n";

cout<<"Fuel charges=Rs 7500\n";

cout<<"Travelling charges= Rs 7000\n";

unsigned long total=8000+7500+7000+(5000*ad)+(2000*ch);

cout<<total;

}

else if(a==2)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 7600\n";

cout<<"Fuel charges=Rs 7050\n";

cout<<"Travelling charges=Rs 7005\n";

unsigned long total=7600+7050+7005+(4500*ad)+(1500*ch);

cout<<total;

}

else if(a==3)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 7000\n";

cout<<"Fuel Charges=Rs 6600\n";

cout<<"Travelling Charges=Rs 6200\n";

unsigned long total=7000+6600+6200+(4200*ad)+(1200*ch);

cout<<total;

}

}

else

{

cout<<"Sorry!seats are not available"<<"\n";

cout<<"Please book in other classes";

}

break;

}

 

 

case 3:

cout<<"Please enter the no. of person(s) boarding the plane\n";

cin>>a1;

if(a1<=18)

{

cout<<" Please enter the no. of adults (above 12)\n";

cin>>ad;

cout<<"Please enter the no. of children (below 12)\n";

cin>>ch;

cout<<"Please enter the date and day you are boarding the plane\n";

cout<<"Date\n";

 

cin>>d1.day_no;

cout<<"month\n";

gets(d1.month);

 

cout<<"Year\n";

cin>>d1.year;

cout<<"day(monday\thursday)";

gets(d1.day);

cout<<"\n";

if(d1.day!=monday||thursday)

{

 

cout<<"Flight not in operation on"<<d1.day<<". please enter valid day only!\n";

}

else

{

 

cout<<"Please enter the name and age of the person(s) boarding\n";

cout<<"Name"<<"\t"<<"\t"<<"\t"<<"Age"<<"\n";

for(j=0;j<a1;j++)

{

gets(name);

cout<<"\t"<<"\t";

cin>>age;

cout<<"\n";

}

 

if(a==1)

{

 

cout<<"Total Cost="<<"\n";

cout<<"Basic Fare=Rs 9000\n";

cout<<"Fuel charges=Rs 8000\n";

cout<<"Travelling charges= Rs 7000\n";

unsigned long total=9000+8000+7000+(5700*ad)+(2500*ch);

cout<<total;

}

else if(a==2)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 8500\n";

cout<<"Fuel charges=Rs 7500\n";

cout<<"Travelling charges=Rs 6500\n";

unsigned long total=8500+7500+6500+(5000*ad)+(2000*ch);

cout<<total;

}

else if(a==3)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 8000\n";

cout<<"Fuel Charges=Rs 7000\n";

cout<<"Travelling Charges=Rs 6000\n";

unsigned long total=8000+7000+6000+(4500*ad)+(1500*ch);

cout<<total;

}

}

else

{

cout<<"Sorry!seats are not available"<<"\n";

cout<<"Please book in other classes";

}

}

break;}

 

 

case 11:

cout<<"Flights available from INDIA to LONDON\n";

 

cout<<"Flight Name" <<"\t"<<"Flitght No."<<"\t"<<"Origin" <<"\t"<<"Arrival"<<"\t"<<"Departure"<<"\t"<<"Days of operation"<<"\n";

cout<<"1: Air India" <<"\t"<<"AI 0809 " <<"\t"<<"Mumbai" <<"\t"<<"00:20" <<"\t"<<"21:30" <<"\t"<<"Mon,Wed" <<"\n";

cout<<"2: Kingfisher" <<"\t"<<"KF 1427" <<"\t"<<"Mangalore"<<"\t"<<"10:45" <<"\t"<<"20:56" <<"\t"<<"Fri,Sun" <<"\n";

cout<<"3: Jet Airways"<<"\t"<<"JA 5874" <<"\t"<<"Delhi" <<"\t"<<"11:55" <<"\t"<<"19:23" <<"\t"<<"Tues,Thurs,Sat" <<"\n";

 

 

cout<<"\n";

 

cout<<"Please enter your choice\n";

cin>>a;

 

cout<<"Do you want to book the seat(s) in\n";

cout<<"1: First Class\n";

cout<<"2: Economy Class\n";

cout<<"3: Executive Class\n";

cout<<"Please enter your choice\n";

cin>>b;

switch(b)

{

 

case 1:

 

cout<<"Please enter the no. of person(s) boarding the plane\n";

cin>>a1;

if(a1<=15)

{

cout<<" Please enter the no. of adults (above 12)\n";

cin>>ad;

cout<<"Please enter the no. of children (below 12)\n";

cin>>ch;

cout<<"Please enter the date and day you are boarding the plane\n";

cout<<"Date\n";

 

cin>>d1.day_no;

cout<<"month\n";

gets(d1.month);

 

cout<<"Year\n";

cin>>d1.year;

cout<<"day(monday\thursday)";

gets(d1.day);

cout<<"\n";

if(d1.day!=monday||thursday)

{

 

cout<<"Flight not in operation on"<<d1.day<<". please enter valid day only!\n";

}

else

{

 

cout<<"Please enter the name and age of the person(s) boarding\n";

cout<<"Name"<<"\t"<<"\t"<<"\t"<<"Age"<<"\n";

for(j=0;j<a1;j++)

{

gets(name);

cout<<"\t"<<"\t";

cin>>age;

cout<<"\n";

}

 

if(a==1)

{

 

cout<<"Total Cost="<<"\n";

cout<<"Basic Fare=Rs 8000\n";

cout<<"Fuel charges=Rs 7000\n";

cout<<"Travelling charges= Rs 6000\n";

unsigned long total=8000+7000+6000+(4800*ad)+(2000*ch);

cout<<total;

}

else if(a==2)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 7500\n";

cout<<"Fuel charges=Rs 6800\n";

cout<<"Travelling charges=Rs 5500\n";

unsigned long total=7500+6800+4800+(4500*ad)+(1800*ch);

cout<<total;

}

else if(a==3)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 7000\n";

cout<<"Fuel Charges=Rs 6000\n";

cout<<"Travelling Charges=Rs 5000\n";

unsigned long total=7000+6000+5000+(4000*ad)+(1500*ch);

cout<<total;

}

}

 

else

{

cout<<"Sorry!seats are not available"<<"\n";

cout<<"Please book in other classes";

}

break;}

 

 

case 2:

cout<<"Please enter the no. of person(s) boarding the plane\n";

cin>>a1;

if(a1<=28)

{

cout<<" Please enter the no. of adults (above 12)\n";

cin>>ad;

cout<<"Please enter the no. of children (below 12)\n";

cin>>ch;

cout<<"Please enter the date and day you are boarding the plane\n";

cout<<"Date\n";

 

cin>>d1.day_no;

cout<<"month\n";

gets(d1.month);

 

cout<<"Year\n";

cin>>d1.year;

cout<<"day(monday\thursday)";

gets(d1.day);

cout<<"\n";

if(d1.day!=monday||thursday)

{

 

cout<<"Flight not in operation on"<<d1.day<<". please enter valid day only!\n";

}

else

{

cout<<"Please enter the name and age of the person(s) boarding\n";

cout<<"Name"<<"\t"<<"\t"<<"\t"<<"Age"<<"\n";

for(j=0;j<a1;j++)

{

gets(name);

cout<<"\t"<<"\t";

cin>>age;

cout<<"\n";

}

 

if(a==1)

{

 

cout<<"Total Cost="<<"\n";

cout<<"Basic Fare=Rs 8000\n";

cout<<"Fuel charges=Rs 7500\n";

cout<<"Travelling charges= Rs 7000\n";

unsigned long total=8000+7500+7000+(5000*ad)+(2000*ch);

cout<<total;

}

else if(a==2)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 7600\n";

cout<<"Fuel charges=Rs 7050\n";

cout<<"Travelling charges=Rs 7005\n";

unsigned long total=7600+7050+7005+(4500*ad)+(1500*ch);

cout<<total;

}

else if(a==3)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 7000\n";

cout<<"Fuel Charges=Rs 6600\n";

cout<<"Travelling Charges=Rs 6200\n";

unsigned long total=7000+6600+6200+(4200*ad)+(1200*ch);

cout<<total;

}

}

else

{

cout<<"Sorry!seats are not available"<<"\n";

cout<<"Please book in other classes";

}

break;}

 

 

case 3:

cout<<"Please enter the no. of person(s) boarding the plane\n";

cin>>a1;

if(a1<=18)

{

cout<<" Please enter the no. of adults (above 12)\n";

cin>>ad;

cout<<"Please enter the no. of children (below 12)\n";

cin>>ch;

cout<<"Please enter the date and day you are boarding the plane\n";

cout<<"Date\n";

 

cin>>d1.day_no;

cout<<"month\n";

gets(d1.month);

 

cout<<"Year\n";

cin>>d1.year;

cout<<"day(monday\thursday)";

gets(d1.day);

cout<<"\n";

if(d1.day!=monday||thursday)

{

 

cout<<"Flight not in operation on"<<d1.day<<". please enter valid day only!\n";

}

else

{

cout<<"Please enter the name and age of the person(s) boarding\n";

cout<<"Name"<<"\t"<<"\t"<<"\t"<<"Age"<<"\n";

for(j=0;j<a1;j++)

{

gets(name);

cout<<"\t"<<"\t";

cin>>age;

cout<<"\n";

}

 

if(a==1)

{

 

cout<<"Total Cost="<<"\n";

cout<<"Basic Fare=Rs 9000\n";

cout<<"Fuel charges=Rs 8000\n";

cout<<"Travelling charges= Rs 7000\n";

unsigned long total=9000+8000+7000+(5700*ad)+(2500*ch);

cout<<total;

}

else if(a==2)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 8500\n";

cout<<"Fuel charges=Rs 7500\n";

cout<<"Travelling charges=Rs 6500\n";

unsigned long total=8500+7500+6500+(5000*ad)+(2000*ch);

cout<<total;

}

else if(a==3)

{

cout<<"Total cost=\n";

cout<<"Basic Fare=Rs 8000\n";

cout<<"Fuel Charges=Rs 7000\n";

cout<<"Travelling Charges=Rs 6000\n";

unsigned long total=8000+7000+6000+(4500*ad)+(1500*ch);

cout<<total;

}

}

else

{

cout<<"Sorry!seats are not available"<<"\n";

cout<<"Please book in other classes";

}

}

break;

 

}}

}

void main()

{

clrscr();

airline item;

int c;

char choice;

cout<<"\n Menu\n";

cout<<"1: INTERNATIONAL TICKET BOOKING\n";

cout<<"2: exit\n";

cout<<"Enter your choice";

cin>>c;

switch©

{

case 1:

item.inter();

break;

case 2:

exit(0);

}

 

getch();

 

}

cout<<"Travelling charges=Rs 5500\n";

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.