Saturday 1 November 2014

Air Line Reservation System in C++

Structure of the Problem Requirements 

In this project we will implement the code of  Airline Reservation system in C++. Airline Reservation system Consists of four modules, Admin Master, Admin, User, Help modules. In admin Master there is security setting of the system. Admin module deal with  flight Times ,Tickets Payments and seating arrangement.In user module a passenger can reserve seats, buy tickets,check the flight schedule and cancel the ticket. In help menu there is help for both admin and users.  Here is the complete code of Airline Reservation system with the output (screen shots). Don't forget to give your feedback in comments after using our codes.

SOURCE CODE  

#include<cstdlib>
#include<iostream>
#include<string>
#include<iomanip>
#include<cmath>
#include <time.h>
#include <conio.h>
#include <fstream>
#include<windows.h>
using namespace std;
                    //*****************  Function Declaration ************************//
void time( );
voidadminMaster();
voidLoginfunction();
voidBookingMenu();
voiduserMenufunction();
voidflightschudule();
voidadminfunction();
voidconfirmationSeat();
voidaddcoustomerfunction();
void testing();
voidcomplainFunction();
void addFlight();
voidTicetPrice();
voidshowflight();
voidremoveflight();

//Start Of Main :
int main()

{
    system("color 4f"); //Change For Screen Color
    char choice;
    char number;
    char clas;
    char adminchoice;
  
         //*************** WELCOME MASSAGE *******************//
    cout<<setw(60)<<"****************************************"<<endl<<endl;
    cout<<setw(56)<<"           WELCOME TO AIRLINE RESERVATION SYSTEM    "<<endl<<endl;
    cout<<setw(60)<<"****************************************"<<endl<<endl<<endl;
x:
loop:    
    time( );

    system("color 4f");
    Loginfunction(); //Give You 4 choices , Choose any one.
   
    cin>>choice;    //choice for admin or user login:
    switch(choice)          //Main Switch Start
    {
    case ('1'):             //Start Case 1 for Main Switch
         {
          adminMaster();    //For Member Of Admin Log in
         }
                     break;             //End Case 1 for Main Switch
    case ('2'):             //Start Case 2 for Main Switch
         {

         adminfunction();   //For Adminstrator
oop:
         cin>>adminchoice;    
         switch(adminchoice)  //Start Of Admin Switch
          {
           case '1':           //Start Case 1 Of Admin Switch
                {
                addFlight();   //you Add Flight
                }
                break;         //End Case 1 Of Admin Switch     
               case '2':       //Start Case 2 Of Admin Switch
               {
               removeflight(); 
               }
               break;          //End Case 2 Of Admin Switch
               case '3':       //Start Case 3 Of Admin Switch
               {
               TicetPrice();
               }
               break;          //End Case 3 Of Admin Switch
               case '4':
               {
               return 0;
               }
               break;
      
      
          case '5':            //Help In Admin Switch
               {   
                    system("cls");   
                    system("color 1a");        //Change For Screen Color
                   
                    cout<<setw(55)<<"***********************************"<<endl<<endl;
                    cout<<setw(58)<<"         HELP MENU                 "<<endl<<endl;
                    cout<<setw(55)<<"***********************************"<<endl<<endl<<endl;
                   
                    cout<<setw(27)<<"Asslam u Aliakum : "<<endl;
                    cout<<setw(70)<<"This is Help Menu You Have Only Three Choice "<<endl;
                    cout<<setw(81)<<"If You want to change add another Flight then Enter 1";
                    cout<<setw(68)<<"If You want to Remove Flight then Enter 2 "<<endl;
                    cout<<setw(44)<<"Prss 3 for Exist "<<endl<<endl;

               }
               break;     
          default:
                  {
                           cout<<"You Enter Invalid Key \n\n";
                           cout<<"Please Enter 1-5 \n\n";
                           cout<<"DO You Want To Agian Enter (y/n) \n\n";
                           char admin;
check:
                                                   cin>>admin;
                                                   if (admin=='Y' ||admin=='y')
                                                   {
                           system("cls");
                                                   goto oop; //Loop Start From Menu
                                       }
                           else if (admin =='n' || admin == 'N')
                                                   {
                                                   return 0;
                                                   }
                                                   else
                                                    {
                            cout<<"please enter y for yes and n for NO"<<endl;
                                                                goto check;
                            }
                          
                  }
         }
}
         break;
    case ('3'):            //Start Case 3 for Main Switch
         {

         userMenufunction();       //Select From Given Choice Any One
a:
         cin>>number;
         if(number <'1'|| number >'6' )
         {
          cout<<setw(35)<<"Dear Please Enter Between 1 And 6"<<endl<<endl;
          goto a;
          }
          else
          {
          cout<<endl;
           }  
         
         switch(number)         //Start Of User Switch
         {
        
        
         case ('1'):            //Start Case 1 for User Switch
              {
              BookingMenu();    //use Function
              }
              break;        //End Case 1 for User Switch
         case ('2'):        //Start Case 2 for User Switch
              {
              flightschudule();     //Use Function
              }
              break;           //End Case 2 for User Switch
         case ('3'):           //Start Case 3 for User Switch
              {
              BookingMenu();
              confirmationSeat();
             }                   //End Case 3 for User Switch
         case ('4'):             //Start Case 4 for User Switch
              {
                   complainFunction();   //You Give Any Complain about us
              }
          break;
                                   //End Of Case 4 for User Switch
          case ('5'):                    //Help For User
               {
                   
                    system("cls");
                    system("color 2e");
                    cout<<setw(55)<<"***********************************"<<endl<<endl;
                    cout<<setw(58)<<"         HELP MENU                 "<<endl<<endl;
                    cout<<setw(55)<<"***********************************"<<endl<<endl<<endl;
                    cout<<setw(27)<<"Asslam u Aliakum : "<<endl<<endl;
                    cout<<setw(70)<<"This is Help Menu You Have Only Six Choice "<<endl;
                    cout<<setw(73)<<"If You want to know about booking You Enter 1 "<<endl;
                    cout<<setw(73)<<"If You want to know about Flight then Enter 2 "<<endl;
                    cout<<setw(77)<<"If You want to Cancell your Seat then You Enter 3 "<<endl;
                    cout<<setw(69)<<"If You Have any complain then You Enter 4 "<<endl;
                    cout<<setw(44)<<"Prss 6 for Exist "<<endl<<endl<<endl;
               }
              break;                     //End Case 4 for User Switch
              }
           }
            break; 
case('4'):                      //Help 4 You in Main Switch
         {
                   system("cls");
                   system("color 5e");
                  cout<<setw(55)<<"***********************************"<<endl<<endl;
                  cout<<setw(58)<<"         HELP MENU                 "<<endl<<endl;
                  cout<<setw(55)<<"***********************************"<<endl<<endl<<endl;
                 
                  cout<<setw(27)<<"Asslam u Aliakum : "<<endl<<endl<<endl;
                  cout<<setw(70)<<"This is Help Menu in Which You Have Only Three Choice \n\n";
                  cout<<setw(74)<<"Master Admin in Which You Chage Admin Member and Password \n\n";
                  cout<<setw(58)<<"If You Are Administrator Then You Enter 2 \n\n";
                  cout<<setw(49)<<"If You Are User Then You Enter 3 \n\n"<<endl;
               
                  }       
                  break;
         default:
                 {
                        cout<<"Enter Wrong Nmber \n\n";
                        cout<<"Please Enter 1-4 \n\n";
                        cout<<"DO You Want To Agian Enter (y/n) \n\n";
                        char menu;
verify:
                                                cin>>menu;
                                                if (menu=='Y' ||menu=='y')
                                                {
                        system("cls");
                                                goto loop; //Loop Start From Menu
                                    }
                        else if (menu=='n' || menu == 'N')
                                                {
                                                return 0;
                                                }
                                                else
                                                {
                        cout<<"please enter y for yes and n for NO"<<endl;
                                                            goto verify;
                        }
                    }
               }                 //End Of Main Switch
                      
                         
                 cout<<endl<<"Back To Menu (enter y or n):-"<<endl; //For Back To Menu
                                 charterm;
rechk:
                                 cin>>term;
                                 if(term=='Y' ||term=='y')
                                 {
         system("cls");
                                 gotoloop; //Loop Start From Menu
                   }
        else if (term=='n' || term == 'N')
                                 {
                                 return 0;
                                 }
                                 else
                                 {
             cout<<"please enter y for yes and n for NO"<<endl;
                                                 gotorechk;}
    
 
system("pause");         //Not Neccessary Condition;
return 0;                //programe termination:
}
//End Of Main

      //******************************** START OF FUNCTION ******************************//

void time( )
     {
          char dateStr [9];
          char timeStr [9];
          _strdate( dateStr);
         cout<<setw(70)<<"DATE : "<<dateStr<<endl;
         _strtime( timeStr );
         cout<<setw(70)<<"TIME : "<<timeStr<<endl<<endl;
      }


voidLoginfunction() //Start Of First Function:
{
                cout<<setw(34)<<"1 : ADMIN MASTER"<<endl<<endl;
    cout<<setw(34)<<"2 : ADMIN LOG IN"<<endl<<endl;
                cout<<setw(37)<<"3 : USER MAIN MENU "<<endl<<endl;
    cout<<setw(26)<<"4 : HELP"          <<endl<<endl;
    cout<<setw(10)<<"Enter your Choice  "<<endl<<endl;
   
} //end Of Log in Function

voiduserMenufunction() //Start Of Second Function:
{
     system("cls");     //For Removing Previous From Screen
     system("color 4e");              //For Screen Color Change
     {
      cout<<setw(60)<<"****************************************"<<endl<<endl;
      cout<<setw(55)<<"             WELCOME TO USER MAIN MENU    "<<endl<<endl;
      cout<<setw(60)<<"****************************************"<<endl<<endl<<endl;
      cout<<setw(25)<<"DEAR PRESS :"<<endl<<endl;
      cout<<setw(55)<<" 1 : BOOKING MENU \n"<<endl;                        //For Booking;
      cout<<setw(58)<<" 2 : FLIGHT SCHUDULE \n"<<endl;                     //For Flight;
      cout<<setw(60)<<" 3 : CANCELLATION SEAT \n"<<endl;                   //For Cancel Seat;
      cout<<setw(55)<<" 4 : COMPLAIN BOX \n"<<endl;                        //If you Have Any Complain
      cout<<setw(47)<<" 5 : HELP \n"<<endl;                                //for your Easyness
      cout<<setw(47)<<" 6 : EXIT\n"<<endl;                         
     }
     cout<<setw(25)<<"So What Can You Do ??? "<<endl<<endl;              //your Choice;
    
}
//End Of Second Function :
     
void TicetPrice()
{
     system("cls");
     system("color 1f");
     cout<<setw(60)<<"****************************************"<<endl<<endl;
     cout<<setw(62)<<"             WELCOME IN TICKET PRICE MOUDULE    "<<endl<<endl;
     cout<<setw(60)<<"****************************************"<<endl<<endl<<endl;
     cout<<"About Moudule : \n\n";
     cout<<"In This Moudule Admin Can Change The Ticket Price \n\n";
     cout<<"Of Each Flight. \n\n";
    
    
     char price;
ticket:
     cout<<"We Have Only Five Flights \n\n";
     testing();
     cout<<"In Which Flight You Want To Chage Ticket Price \n\n";
     cin>>price;
     switch(price)
         {
              case '1':
                   {       
              cout<<"This is For First Flight \n\n";     
              ofstream myfile;
              string TicketPrice1;
              cout<<"Enter Ticket Price For First Class Passanger \n\n"<<endl;
              cin.sync();
              getline(cin, TicketPrice1,'\n');
              myfile.open ("Ticket Price First class 1.txt");
              myfile<<TicketPrice1;
              myfile.close();
        
              ofstream file;
              string TicketPrice2;
              cout<<endl<<"Enter Ticket Price For Coach Class Passanger \n\n"<<endl;
              cin.sync();
              getline(cin, TicketPrice2,'\n');
              file.open ("Ticket Price Coach class 1.txt");       //1 show Flight
              file<<TicketPrice2;
              file.close();
              }
              break;          
          
          
             
               case '2':
                    {
            cout<<"This is For Second Flight \n\n";  
            ofstream myfile;
            string TicketPrice1;
            cout<<"Enter Ticket Price For First Class Passanger \n\n"<<endl;
            cin.sync();
            getline(cin, TicketPrice1,'\n');
            myfile.open ("Ticket Price First class 2.txt");  //2 show 2nd Flight
            myfile<<TicketPrice1;
            myfile.close();
        
            ofstream file;
            string TicketPrice2;
            cout<<endl<<"Enter Ticket Price For Coach Class Passanger \n\n"<<endl;
            cin.sync();
            getline(cin, TicketPrice2,'\n');
            file.open ("Ticket Price Coach class 2.txt");       //2 show Flight
            file<<TicketPrice2;
            file.close();
            }
            break;
        
        
                   
             
            case '3':
            {  
            cout<<"This is For Third Flight \n\n";  
            ofstream myfile;
            string TicketPrice1;
            cout<<"Enter Ticket Price For First Class Passanger \n\n"<<endl;
            cin.sync();
            getline(cin, TicketPrice1,'\n');
            myfile.open ("Ticket Price First class 3.txt");  //3 show 3rd Flight
            myfile<<TicketPrice1;
            myfile.close();
        
            ofstream file;
            string TicketPrice2;
            cout<<endl<<"Enter Ticket Price For Coach Class Passanger \n\n"<<endl;
            cin.sync();
            getline(cin, TicketPrice2,'\n');
            file.open ("Ticket Price Coach class 3.txt");       //3 show Flight
            file<<TicketPrice2;
            file.close();
            }
            break;
               
                    
        
            case '4':
            {  
            cout<<"This is For Fourth Flight \n\n";  
            ofstream myfile;
            string TicketPrice1;
            cout<<"Enter Ticket Price For First Class Passanger \n\n"<<endl;
            cin.sync();
            getline(cin, TicketPrice1,'\n');
            myfile.open ("Ticket Price First class 4.txt");  //4 show 4th Flight
            myfile<<TicketPrice1;
            myfile.close();
        
            ofstream file;
            string TicketPrice2;
            cout<<endl<<"Enter Ticket Price For Coach Class Passanger \n\n"<<endl;
            cin.sync();
            getline(cin, TicketPrice2,'\n');
            file.open ("Ticket Price Coach class 4.txt");       //4 show Flight
            file<<TicketPrice2;
            file.close();
            }
            break;
        
        
           
            case '5':
            {  
            cout<<"This is For Fifth Flight \n\n";  
            ofstream myfile;
            string TicketPrice1;
            cout<<"Enter Ticket Price For First Class Passanger \n\n"<<endl;
            cin.sync();
            getline(cin, TicketPrice1,'\n');
            myfile.open ("Ticket Price First class 5.txt");  //5 show 5th Flight
            myfile<<TicketPrice1;
            myfile.close();
        
            ofstream file;
            string TicketPrice2;
            cout<<endl<<"Enter Ticket Price For Coach Class Passanger \n\n"<<endl;
            cin.sync();
            getline(cin, TicketPrice2,'\n');
            file.open ("Ticket Price Coach class 5.txt");       //4 show Flight
            file<<TicketPrice2;
            file.close();
            }
            break;
                     
         default:
         {
                 cout<<"You Enter Wrong Number \n\n";
                 cout<<"Do YOu Want Agian To Choose Again (y/n) \n\n";
no:              charTiket;
                                         cin>>Tiket;
                                         if(Tiket=='Y' ||Tiket=='y')
                                         {
                 system("cls");
                                         gototicket; //Loop Start From Menu
                             }
                 else if (Tiket =='n' || Tiket == 'N')
                                         {
                                        
                                         }
                                         else
                                         {
                 cout<<"please enter y for yes and n for NO"<<endl;
                                                     gotono;
                 }
                
         }
}
}


voidBookingMenu() //Start Of Function Make Booking:
{
     system("cls");
     system("color 5e");
    
     //***************** WELCOME MASSAGE ***************//
    
     cout<<setw(60)<<"****************************************"<<endl<<endl;
     cout<<setw(57)<<"             Welcome To Booking Menu    "<<endl<<endl;
     cout<<setw(60)<<"****************************************"<<endl<<endl<<endl;
               
     string name;
                 int cash,ReturnAmount = 0;                           //intillizing a Value
                 char flight,destination;                             //Declaration
     int date=0,month=0,year=0;                           //intillize
     cout<<"Enter Your Full Name \n\n";                  
      cin.sync();          
     getline(cin,name,'\n');                               //Get From User
                 
     cout<<endl<<"Enter Date :  \n\n";                          //your desired date :
f:
     cout<<setw(40)<<"When System Asked Date Then YOu Must Enter Only Date 31 \n\n";
     cout<<setw(40)<<"When System Asked Month Then YOu Must Enter Only Month 12 \n\n";
     cout<<setw(40)<<"When System Asked Year Then YOu Must Enter Only Year 2012 \n\n";
     cout<<"date\n";
     cin>>date;                                   //Put Only Date;
                 cout<<"month\n";
                 cin>>month;                                   //Put Only Month;
                 cout<<"Year\n";
                 cin>>year;                                    //Put Only Year;
                 cout<<endl<<endl<<"Input Date is :"<<date<<"/"<<month<<"/"<<year<<endl<<endl ;
                 //Checking Condition
                 if(date==31 && month==12 && year==2012)
                 {
w:
   
     cout<<setw(60)<<"You Want To see flight On Your Favourite Date "<<endl;
                 cout<<setw(33)<<"If You Want Press 1"<<endl;
                 cin>>flight;            //flight According To Destination;
                 if(flight=='1')         //Checking Condtion
                 {
     switch(flight)          //Start Of Flight Switch
     {
     case ('1'):             //Start Case 1 For Flight Switch
     {
     system("cls");
s:
     
      system("color 1e");
      testing();             //Calling A Function;
      cout<<"Enter Your Destination Or Choose Any one From Given \n\n";
                  cin>>destination;             //Where You Want to Go
                    if(destination<'1'|| destination>'6' )       //Checking a Condition
         {
          cout<<setw(35)<<"Dear Please Enter Between 1 And 6"<<endl<<endl;
                                  gotos;
          }
          else                  //Start Of Else
          {
                 switch(destination)        //Start Of Destination Switch
                 {
                 case'1':                  //Start Of Case 1 For Destination Switch
                                 {
  bool coachclass [7] = {0,0,0,0,0,0,0};
  bool firstclass [4] = {0,0,0,0};
              system("cls");
               system("color 4f");
                                                 cout<<"Yes Flight is Available \n\n";
                                                {
             cout<<"Total Seats in Your Flight \n\n";
                                                 const int rows=6,column=2;
                         int numbers[rows][column];
                         inti=0,j=0;
                         for(i=0;i<rows;i++)
                         {
                                     for(j=0;j<column;j++)
                                     {
                                                 numbers[i][j]=i+i+j+1;
                 }
                 }

                             for(i=0;i<rows;i++)
                             {
                                         cout<<"\t";
                                         for(j=0;j<column;j++)
                                         {
                                                     cout<<numbers[i][j]<<" ";
                                         }
                                      cout<<endl;
              }
clas:
back:
              cout<<setw(45)<<"Which Class Would You Like \n\n";
              cout<<setw(40)<<"1: VIP Class \n\n";
              cout<<setw(40)<<"2: ECONOMY Class \n\n";
              cout<<setw(10)<<"Enter Your Choice \n\n";
              char clas;
              cin>>clas;
              if(clas>'2' || clas<'1')
              {
              cout<<setw(25)<<"Enter 1 Or 2 \n\n";
chek:
                                      cout<<"If YOu Want To Choose Again Press y \n\n";
              cin>>clas;
              if (clas=='Y' ||clas=='y')
                                      {
               system("cls");
                                       goto clas; //Loop Start From Menu
                           }
               else if (clas=='n' || clas == 'N')
                                       {
                                      
                                       }
                                       else
                                       {
               cout<<"please enter y for yes and n for NO"<<endl;
                                                   gotochek;
               }
               }
                                       else
                                       {
                   switch(clas)
                   {
                               case '1':
                                    {
                                       
                                     cout<<"Welcome In VIP Class :\n\n";
                                     int seat=0,saet=0;
                                     cout<<"Enter Seats Between 1-4 \n\n";
                                     cin >> seat;
                                     saet = seat - 1;
                                     if (seat > 4)
                                     {
                                     cout << "The seat of this class is 1-4 \n\n";
                                     }
                                     if (seat <=4)
                                     {
                                     if (firstclass [saet] == 0)
                                     {
                                     firstclass [saet]  = 1;
                                     cout << "Your seat number is: " << seat << endl;
                    
                                     ifstream myfile("Ticket Price First class 1.txt");
                                     string TicketPrice1;
                                     string word;
                                                 if(myfile.is_open())
                                                 {
                                                 while(!myfile.eof())
                                     {
                                     getline(myfile,TicketPrice1);
                                     }
                                     myfile.close();
                                     }
                                     else
                                     {
       
                                     }
                                     cout<<endl<<"Pay"<<TicketPrice1<<" For This Destination \n\n";
                                     string cash;
                                     cin>>cash;      
                                     if(cash<TicketPrice1)
                                     {
                                     cout<<"Sorry You Have Don't Amount For This \n\n";
                                     }
                                      if(cash==TicketPrice1)
                                      {
                                      cout<<"Thankx For Purchasing \n\n";
                                      }
                                      if(cash>TicketPrice1)
                                      {
                                      int ReturnAmount = 0;
                                      //ReturnAmount = cash - TicketPrice1;
                                      cout<<"Thankx For Purchasing \n\n";
                                      cout<<"Your Remaining Cash is ="<<ReturnAmount<<endl<<"Take it ?"<<endl;
                                                                          }
                           
               
               
                                      }
                                                                                      else
                                      {
                                      cout << "This seat is booked" << endl;
                                                                                      }
                                   }
                                   cout << "Would you want to book another seat (y/n)? " << endl;
                                   char cont;
                                   cin >> cont;
                                               if(cont == 'y' || cont == 'Y'  )
                                   {
                                   goto back;
                                   }
                                    }
                                    break;
                               case '2':
                                    {
                                       
                                    cout<<"Welcome In ECONOMY Class \n\n\n";
                                     int seat=0,saet=0;
                                     cout<<"Enter Between 5-12 \n\n";
                                     cin >> seat;
                                     saet = seat - 1;
                                     if (seat < 5 || seat > 12 )
                                     {
                                     cout << "The seat of this class is 5-12 \n\n";
                                     }
                                     if (seat >= 5)
                                     {
                                     if (coachclass [saet] == 0)
                                     {
                                     coachclass [saet] = 1;
                                     cout << "Your seat number is: " << seat << endl;
                                    
                                     ifstream file("Ticket Price Coach class 1.txt");
                                     string TicketPrice2;
                                     string word;
                                                 if(file.is_open())
                                                 {
                                                 while(!file.eof())
                                     {              
                                     getline(file,TicketPrice2);
                                     }
                                     file.close();
                                     }
                                     else
                                     {
       
                                     }
                                     cout<<endl<<"Pay"<<TicketPrice2<<" For This Destination \n\n";
                                     string cash;
                                     cin>>cash;      
                                     if(cash<TicketPrice2)
                                     {
                                     cout<<"Sorry You Have Don't Amount For This \n\n";
                                     }
                                      if(cash==TicketPrice2)
                                      {
                                      cout<<"Thankx For Purchasing \n\n";
                                      }
                                      if(cash>TicketPrice2)
                                      {
                                      int ReturnAmount = 0;
                                      //ReturnAmount = cash - TicketPrice2;
                                      cout<<"Thankx For Purchasing \n\n";
                                      //cout<<"Your Remaining Cash is ="<<ReturnAmount<<endl<<"Take it ?"<<endl;
                                                                          }
                           
                                               }
                                               else
                                               {
                                               cout << "This seat is booked" << endl;
                                                                                               }
                                            }
                                            cout << "Would you want to book another seat (y/n)? " << endl;
                                            char cont;
                                            cin >> cont;
                                                        if(cont == 'y' || cont == 'Y')
                                            {
                                            goto back;
                                            }
                                            }
                                            break;
                                         }
                            } 
          }
        break;             
}  
break;                   
                                 case'2':    //Start Of Case 2 For Destination Switch
                                 {
              bool firstclass [4] = {0,0,0,0};
              bool coachclass [7] = {0,0,0,0,0,0,0};
              system("cls");
              system("color 4f");
                                                  cout<<"Yes Flight is Available \n\n";
                                    { 
              cout<<"Total Seats in Your Flight \n\n";
                                                  const int rows=6,column=2;
                          intnumbers[rows][column];
                          inti=0,j=0;
                          for(i=0;i<rows;i++)
                          {
                                      for(j=0;j<column;j++)
                                      {
                                                  numbers[i][j]=i+i+j+1;
                 }
                 }

                             for(i=0;i<rows;i++)
                             {
                                         cout<<"\t";
                                         for(j=0;j<column;j++)
                                         {
                                                     cout<<numbers[i][j]<<" ";
                                         }
                                         cout<<endl;
                 }
                 }
cls:
bck:
              cout<<setw(45)<<"Which Class Would You Like \n\n";
              cout<<setw(40)<<"1: VIP Class \n\n";
              cout<<setw(40)<<"2: ECONOMY Class \n\n";
              cout<<setw(10)<<"Enter Your Choice \n\n";
              char clas;
              cin>>clas;
              if(clas>'2' || clas<'1')
              {
              cout<<setw(25)<<"Enter 1 Or 2 \n\n";
chk:
                                      cout<<"If YOu Want To Choose Again Press y \n\n";
              cin>>clas;
              if (clas=='Y' ||clas=='y')
                                      {
               system("cls");
                                       goto cls; //Loop Start From Menu
                           }
               else if (clas=='n' || clas == 'N')
                                       {
                                      
                                       }
                                       else
                                       {
               cout<<"please enter y for yes and n for NO"<<endl;
                                                   gotochk;
               }
               }
              
                                       else
                                       {
                   switch(clas)
                   {
                              
                                case'1':
                                    {
                                     cout<<"Welcome In VIP Class : \n\n";
                                     int seat=0,saet=0;
                                     cout<<"Enter Seats Between 1-4 \n\n";
                                     cin >> seat;
                                     saet = seat - 1;
                                     if (seat > 4)
                                     {
                                     cout << "The seat of this class is 1-4 \n\n";
                                     }
                                     if (seat <=4)
                                     {
                                     if (firstclass [saet] == 0)
                                     {
                                     firstclass [saet]  = 1;
                                     cout << "Your seat number is: " << seat << endl;
                    
                                     ifstream myfile("Ticket Price First class 2.txt");
                                     string TicketPrice1;
                                     string word;
                                                 if(myfile.is_open())
                                                 {
                                                 while(!myfile.eof())
                                     {
                                     getline(myfile,TicketPrice1);
                                     }
                                     myfile.close();
                                     }
                                     else
                                     {
       
                                     }
                                     cout<<endl<<"Pay "<<TicketPrice1<<" For This Destination \n\n";
                                     string cash;
                                     cin>>cash;      
                                     if(cash<TicketPrice1)
                                     {
                                     cout<<"Sorry You Have Don't Amount For This \n\n";
                                     }
                                      if(cash==TicketPrice1)
                                      {
                                      cout<<"Thankx For Purchasing \n\n";
                                      }
                                      if(cash>TicketPrice1)
                                      {
                                      int ReturnAmount = 0;
                                      //ReturnAmount = cash - TicketPrice1;
                                      cout<<"Thankx For Purchasing \n\n";
                                      cout<<"Your Remaining Cash is ="<<ReturnAmount<<endl<<"Take it ?"<<endl;
                                                                          }
                           
                                      }
                                                                                      else
                                      {
                                      cout << "This seat is booked" << endl;
                                                                                      }
                                   }
                                   cout << "Would you want to book another seat (y/n)? " << endl;
                                   char cont;
                                   cin >> cont;
                                               if(cont == 'y' || cont == 'Y'  )
                                   {
                                   goto bck;
                                   }
                                    }
                                    break;
                                case '2':
                                     {
                                        
                                        cout<<"Welcome In ECONOMY Class \n\n\n";
                                         intseat=0,saet=0;
                                     cout<<"Enter Between 5-12 \n\n";
                                     cin >> seat;
                                     saet = seat - 1;
                                     if (seat < 5 || seat > 12 )
                                     {
                                     cout << "The seat of this class is 5-12 \n\n";
                                     }
                                     if (seat >= 5)
                                     {
                                     if (coachclass [saet] == 0)
                                     {
                                     coachclass [saet] = 1;
                                     cout << "Your seat number is: " << seat << endl;
                                     
                                     ifstream file("Ticket Price Coach class 2.txt");
                                     string TicketPrice2;
                                     string word;
                                                 if(file.is_open())
                                                 {
                                                 while(!file.eof())
                                     {              
                                     getline(file,TicketPrice2);
                                     }
                                     file.close();
                                     }
                                     else
                                     {
       
                                     }
                                     cout<<endl<<"Pay "<<TicketPrice2<<" For This Destination \n\n";
                                     string cash;
                                     cin>>cash;      
                                     if(cash<TicketPrice2)
                                     {
                                     cout<<"Sorry You Have Don't Amount For This \n\n";
                                     }
                                      if(cash==TicketPrice2)
                                      {
                                      cout<<"Thankx For Purchasing \n\n";
                                      }
                                      if(cash>TicketPrice2)
                                      {
                                      int ReturnAmount = 0;
                              
    cout<<"Thankx For Purchasing \n\n";
                                                                                                          }
                           
                                               }
                                               else
                                               {
                                               cout << "This seat is booked" << endl;
                                                                                               }
                                            }
                                            cout << "Would you want to book another seat (y/n)? " << endl;
                                            char cont;
                                            cin >> cont;
                                                        if(cont == 'y' || cont == 'Y')
                                            {
                                            goto bck;
                                            }
                                            }
                                            break;
                                        
                                         }        
                                   }
        
                   }
                   break;        
           
         case '3':
                                 {
              bool firstclass [4] = {0,0,0,0};
              bool coachclass [7] = {0,0,0,0,0,0,0};
              system("cls");
               system("color 4f");
                                                 cout<<"Yes Flight is Available \n\n";
                                                 {
              cout<<"Total Seats in Your Flight \n\n";
                                                 const int rows=6,column=2;
                         int numbers[rows][column];
                         inti=0,j=0;
                         for(i=0;i<rows;i++)
                         {
                                     for(j=0;j<column;j++)
                                     {
                                                 numbers[i][j]=i+i+j+1;
                 }
                 }

                             for(i=0;i<rows;i++)
                             {
                                         cout<<"\t";
                                         for(j=0;j<column;j++)
                                         {
                                                     cout<<numbers[i][j]<<" ";
                                         }
                                      cout<<endl;
              }
las:
ack:
              cout<<setw(45)<<"Which Class Would You Like \n\n";
              cout<<setw(40)<<"1: VIP Class \n\n";
              cout<<setw(40)<<"2: ECONOMY Class \n\n";
              cout<<setw(10)<<"Enter Your Choice \n\n";
              char clas;
              cin>>clas;
              if(clas>'2' || clas<'1')
              {
              cout<<setw(25)<<"Enter 1 Or 2 \n\n";
hek:
                                      cout<<"If YOu Want To Choose Again Press y \n\n";
              cin>>clas;
              if (clas=='Y' ||clas=='y')
                                      {
               system("cls");
                                       goto las; //Loop Start From Menu
                           }
               else if (clas=='n' || clas == 'N')
                                       {
                                      
                                       }
                                       else
                                       {
               cout<<"please enter y for yes and n for NO"<<endl;
                                                   goto hek;
               }
               }
                                       else
                                       {
                   switch(clas)
                   {
                               case '1':
                                    {
                                    
                                   
                                     cout<<"Welcome In VIP Class : \n\n";
                                     int seat=0,saet=0;
                                     cout<<"Enter Seats Between 1-4 \n\n";
                                     cin >> seat;
                                     saet = seat - 1;
                                     if (seat > 4)
                                     {
                                     cout << "The seat of this class is 1-4 \n\n";
                                     }
                                     if (seat <=4)
                                     {
                                     if (firstclass [saet] == 0)
                                     {
                                     firstclass [saet]  = 1;
                                     cout << "Your seat number is: " << seat << endl;
                   
                                     ifstream myfile("Ticket Price First class 3.txt");
                                     string TicketPrice1;
                                     string word;
                                                 if(myfile.is_open())
                                                 {
                                                 while(!myfile.eof())
                                     {
                                     getline(myfile,TicketPrice1);
                                     }
                                     myfile.close();
                                     }
                                     else
                                     {
       
                                     }
                                     cout<<endl<<"Pay "<<TicketPrice1<<" For This Destination \n\n";
                                     string cash;
                                     cin>>cash;      
                                     if(cash<TicketPrice1)
                                     {
                                     cout<<"Sorry You Have Don't Amount For This \n\n";
                                     }
                                      if(cash==TicketPrice1)
                                      {
                                      cout<<"Thankx For Purchasing \n\n";
                                      }
                                      if(cash>TicketPrice1)
                                      {
                                      int ReturnAmount = 0;
                                      //ReturnAmount = cash - TicketPrice1;
                                      cout<<"Thankx For Purchasing \n\n";
                                      cout<<"Your Remaining Cash is ="<<ReturnAmount<<endl<<"Take it ?"<<endl;
                                                                          }
                            
               
               
                                      }
                                                                                      else
                                      {
                                      cout << "This seat is booked" << endl;
                                                                                      }
                                   }
                                   cout << "Would you want to book another seat (y/n)? " << endl;
                                   char cont;
                                   cin >> cont;
                                               if(cont == 'y' || cont == 'Y'  )
                                   {
                                   goto ack;
                                   }
                                    }
                                    break;
                               case '2':
                                    {
                                   
                                  cout<<"Welcome In ECONOMY Class \n\n\n";
                                     int seat=0,saet=0;
                                     cout<<"Enter Between 5-12 \n\n";
                                     cin >> seat;
                                     saet = seat - 1;
                                     if (seat < 5 || seat > 12 )
                                     {
                                     cout << "The seat of this class is 5-12 \n\n";
                                     }
                                     if (seat >= 5)
                                     {
                                     if (coachclass [saet] == 0)
                                     {
                                     coachclass [saet] = 1;
                                     cout << "Your seat number is: " << seat << endl;
                                    
                                     ifstream file("Ticket Price Coach class 3.txt");
                                     string TicketPrice2;
                                     string word;
                                                 if(file.is_open())
                                                 {
                                                 while(!file.eof())
                                     {              
                                     getline(file,TicketPrice2);
                                     }
                                     file.close();
                                     }
                                     else
                                     {
       
                                     }
                                     cout<<endl<<"Pay "<<TicketPrice2<<" For This Destination \n\n";
                                     string cash;
                                     cin>>cash;      
                                     if(cash<TicketPrice2)
                                     {
                                     cout<<"Sorry You Have Don't Amount For This \n\n";
                                     }
                                      if(cash==TicketPrice2)
                                      {
                                      cout<<"Thankx For Purchasing \n\n";
                                      }
                                      if(cash>TicketPrice2)
                                      {
                                      int ReturnAmount = 0;
                                      //ReturnAmount = cash - TicketPrice2;
                                      cout<<"Thankx For Purchasing \n\n";
                                      //cout<<"Your Remaining Cash is ="<<ReturnAmount<<endl<<"Take it ?"<<endl;
                                                                          }
                           
                                               }
                                               else
                                               {
                                               cout << "This seat is booked" << endl;
                                                                                               }
                                            }
                                            cout << "Would you want to book another seat (y/n)? " << endl;
                                            char cont;
                                            cin >> cont;
                                                        if(cont == 'y' || cont == 'Y')
                                            {
                                            goto ack;
                                            }
                                            }
                                            break;
                                         }
                            } 
                            }
                            break;             
                            }
         break;
                                       //Start Of Case 4 For Destination Switch
                                 case'4':
                                 {
              bool firstclass [4] = {0,0,0,0};
              bool coachclass [7] = {0,0,0,0,0,0,0};
              system("cls");
               system("color 4f");
                                                 cout<<"Yes Flight is Available \n\n";
                                                 { 
              cout<<"Total Seats in Your Flight \n\n";
                                                  const int rows=6,column=2;
                          intnumbers[rows][column];
                          inti=0,j=0;
                          for(i=0;i<rows;i++)
                          {
                                      for(j=0;j<column;j++)
                                      {
                                                  numbers[i][j]=i+i+j+1;
                 }
                 }

                             for(i=0;i<rows;i++)
                             {
                                         cout<<"\t";
                                         for(j=0;j<column;j++)
                                         {
                                                     cout<<numbers[i][j]<<" ";
                                         }
                                         cout<<endl;
                 }
                 }

ad:
ab:
              cout<<setw(45)<<"Which Class Would You Like \n\n";
              cout<<setw(40)<<"1: VIP CLASS \n\n";
              cout<<setw(40)<<"2: ECONOMY CLASS \n\n";
              cout<<setw(10)<<"Enter Your Choice \n\n";
              char clas;
              cin>>clas;
              if(clas>'2' || clas<'1')
              {
              cout<<setw(25)<<"Enter 1 Or 2 \n\n";
ah:
                                      cout<<"If YOu Want To Choose Again Press (y/n)\n\n";
              cin>>clas;
              if (clas=='Y' ||clas=='y')
                                      {
               system("cls");
                                       gotoab; //Loop Start From Menu
                           }
               else if (clas=='n' || clas == 'N')
                                       {
                                      
                                       }
                                       else
                                       {
               cout<<"please enter y for yes and n for NO"<<endl;
                                                   gotoah;
               }
               }
              
                                       else
                                       {
                   switch(clas)
                   {
                              
                                case'1':
                                    {
                                     cout<<"Welcome In VIP Class : \n\n";
                                     int seat=0,saet=0;
                                     cout<<"Enter Seats Between 1-4 \n\n";
                                     cin >> seat;
                                     saet = seat - 1;
                                     if (seat > 4)
                                     {
                                     cout << "The seat of this class is 1-4 \n\n";
                                     }
                                     if (seat <=4)
                                     {
                                     if (firstclass [saet] == 0)
                                     {
                                     firstclass [saet]  = 1;
                                     cout << "Your seat number is: " << seat << endl;
                   
                                     ifstream myfile("Ticket Price First class 4.txt");
                                     string TicketPrice1;
                                     string word;
                                                 if(myfile.is_open())
                                                 {
                                                 while(!myfile.eof())
                                     {
                                     getline(myfile,TicketPrice1);
                                     }
                                     myfile.close();
                                     }
                                     else
                                     {
       
                                     }
                                     cout<<endl<<"Pay"<<TicketPrice1<<" For This Destination \n\n";
                                     string cash;
                                     cin>>cash;      
                                     if(cash<TicketPrice1)
                                     {
                                     cout<<"Sorry You Have Don't Amount For This \n\n";
                                     }
                                      if(cash==TicketPrice1)
                                      {
                                      cout<<"Thankx For Purchasing \n\n";
                                      }
                                      if(cash>TicketPrice1)
                                      {
                                      int ReturnAmount = 0;
                                      //ReturnAmount = cash - TicketPrice1;
                                      cout<<"Thankx For Purchasing \n\n";
                                      cout<<"Your Remaining Cash is ="<<ReturnAmount<<endl<<"Take it ?"<<endl;
                                                                          }
                           
                                      }
                                                                                      else
                                      {
                                      cout << "This seat is booked" << endl;
                                                                                      }
                                   }
                                   cout << "Would you want to book another seat (y/n)? " << endl;
                                   char cont;
                                   cin >> cont;
                                               if(cont == 'y' || cont == 'Y'  )
                                   {
                                   goto ad;
                                   }
                                    }
                                    break;
                                case '2':
                                     {
                                        
                                     cout<<"Welcome In ECONOMY Class \n\n\n";   
                                     int seat=0,saet=0;
                                     cout<<"Enter Between 5-12 \n\n";
                                     cin >> seat;
                                     saet = seat - 1;
                                     if (seat < 5 || seat > 12 )
                                     {
                                     cout << "The seat of this class is 5-12 \n\n";
                                     }
                                     if (seat >= 5)
                                     {
                                     if (coachclass [saet] == 0)
                                     {
                                     coachclass [saet] = 1;
                                     cout << "Your seat number is: " << seat << endl;
                                    
                                     ifstream file("Ticket Price Coach class 4.txt");
                                     string TicketPrice2;
                                     string word;
                                                 if(file.is_open())
                                                 {
                                                 while(!file.eof())
                                     {              
                                     getline(file,TicketPrice2);
                                     }
                                     file.close();
                                     }
                                     else
                                     {
       
                                     }
                                     cout<<endl<<"Pay "<<TicketPrice2<<" For This Destination \n\n";
                                     string cash;
                                     cin>>cash;      
                                     if(cash<TicketPrice2)
                                     {
                                     cout<<"Sorry You Have Don't Amount For This \n\n";
                                     }
                                      if(cash==TicketPrice2)
                                      {
                                      cout<<"Thankx For Purchasing \n\n";
                                      }
                                      if(cash>TicketPrice2)
                                      {
                                      int ReturnAmount = 0;
                                      //ReturnAmount = cash - TicketPrice2;
                                      cout<<"Thankx For Purchasing \n\n";
                                      //cout<<"Your Remaining Cash is ="<<ReturnAmount<<endl<<"Take it ?"<<endl;
                                                                          }
                           
                                               }
                                               else
                                               {
                                               cout << "This seat is booked" << endl;
                                                                                               }
                                            }
                                            cout << "Would you want to book another seat (y/n)? " << endl;
                                            char cont;
                                            cin >> cont;
                                                        if(cont == 'y' || cont == 'Y')
                                            {
                                            goto ad;
                                            }
                                            }
                                            break;
                                        
                                         }        
                                   }
                               
                                 }//End Of Case 4 For Destination Switch
                                 break;
                                       //Start Of Case 5 For Destination Switch
                                 case '5':
                                 {
              bool firstclass [4] = {0,0,0,0};
              bool coachclass [7] = {0,0,0,0,0,0,0};
              system("cls");
               system("color 4f");
                                                                 cout<<"Yes Flight is Available \n\n";
                                                { 
              cout<<"Total Seats in Your Flight \n\n";
                                                  const int rows=6,column=2;
                          intnumbers[rows][column];
                          inti=0,j=0;
                          for(i=0;i<rows;i++)
                          {
                                      for(j=0;j<column;j++)
                                      {
                                                  numbers[i][j]=i+i+j+1;
                 }
                 }

                             for(i=0;i<rows;i++)
                             {
                                         cout<<"\t";
                                         for(j=0;j<column;j++)
                                         {
                                                     cout<<numbers[i][j]<<" ";
                                         }
                                         cout<<endl;
                 }
                 }

xy:
mn:
              cout<<setw(45)<<"Which Class Would You Like \n\n";
              cout<<setw(40)<<"1: First Class \n\n";
              cout<<setw(40)<<"2: Coach Class \n\n";
              cout<<setw(10)<<"Enter Your Choice \n\n";
              char clas;
              cin>>clas;
              if(clas>'2' || clas<'1')
              {
              cout<<setw(25)<<"Enter 1 Or 2 \n\n";
pq:
                                      cout<<"If YOu Want To Choose Again Press (y/n)\n\n";
              cin>>clas;
              if (clas=='Y' ||clas=='y')
                                      {
               system("cls");
                                       goto mn; //Loop Start From Menu
                           }
               else if (clas=='n' || clas == 'N')
                                       {
                                      
                                       }
                                       else
                                       {
               cout<<"please enter y for yes and n for NO"<<endl;
                                                   gotopq;
               }
               }
              
                                       else
                                       {
                   switch(clas)
                   {
                              
                                case '1':
                                    {
                                     cout<<"Welcome In VIP Class : \n\n";
                                     int seat=0,saet=0;
                                     cout<<"Enter Seats Between 1-4 \n\n";
                                     cin >> seat;
                                     saet = seat - 1;
                                     if (seat > 4)
                                     {
                                     cout << "The seat of this class is 1-4 \n\n";
                                     }
                                     if (seat <=4)
                                     {
                                     if (firstclass [saet] == 0)
                                     {
                                     firstclass [saet]  = 1;
                                     cout << "Your seat number is: " << seat << endl;
                   
                                     ifstream myfile("Ticket Price First class 4.txt");
                                     string TicketPrice1;
                                     string word;
                                                 if(myfile.is_open())
                                                 {
                                                 while(!myfile.eof())
                                     {
                                     getline(myfile,TicketPrice1);
                                     }
                                     myfile.close();
                                     }
                                     else
                                     {
       
                                     }
                                     cout<<endl<<"Pay"<<TicketPrice1<<" For This Destination \n\n";
                                     string cash;
                                     cin>>cash;      
                                     if(cash<TicketPrice1)
                                     {
                                     cout<<"Sorry You Have Don't Amount For This \n\n";
                                     }
                                      if(cash==TicketPrice1)
                                      {
                                      cout<<"Thankx For Purchasing \n\n";
                                      }
                                      if(cash>TicketPrice1)
                                      {
                                      int ReturnAmount = 0;
                                      //ReturnAmount = cash - TicketPrice1;
                                      cout<<"Thankx For Purchasing \n\n";
                                      cout<<"Your Remaining Cash is ="<<ReturnAmount<<endl<<"Take it ?"<<endl;
                                                                          }
                           
                                      }
                                                                                      else
                                      {
                                      cout << "This seat is booked" << endl;
                                                                                      }
                                   }
                                   cout << "Would you want to book another seat (y/n)? " << endl;
                                   char cont;
                                   cin >> cont;
                                               if(cont == 'y' || cont == 'Y'  )
                                   {
                                   goto xy;
                                   }
                                    }
                                    break;
                                case '2':
                                     {
                                        
                                        cout<<"Welcome In ECONOMY Class \n\n\n";
                                         int seat=0,saet=0;
                                     cout<<"Enter Between 5-12 \n\n";
                                     cin >> seat;
                                     saet = seat - 1;
                                     if(seat < 5 || seat > 12 )
                                     {
                                     cout << "The seat of this class is 5-12 \n\n";
                                     }
                                     if (seat >= 5)
                                     {
                                     if (coachclass [saet] == 0)
                                     {
                                     coachclass [saet] = 1;
                                     cout << "Your seat number is: " << seat << endl;
                                     
                                     ifstream file("Ticket Price Coach class 4.txt");
                                     string TicketPrice2;
                                     string word;
                                                 if(file.is_open())
                                                 {
                                                 while(!file.eof())
                                     {              
                                     getline(file,TicketPrice2);
                                     }
                                     file.close();
                                     }
                                     else
                                     {
       
                                     }
                                     cout<<endl<<"Pay "<<TicketPrice2<<" For This Destination \n\n";
                                     string cash;
                                     cin>>cash;      
                                     if(cash<TicketPrice2)
                                     {
                                     cout<<"Sorry You Have Don't Amount For This \n\n";
                                     }
                                      if(cash==TicketPrice2)
                                      {
                                      cout<<"Thankx For Purchasing \n\n";
                                      }
                                      if(cash>TicketPrice2)
                                      {
                                      intReturnAmount = 0;
                                      //ReturnAmount = cash - TicketPrice2;
                                      cout<<"Thankx For Purchasing \n\n";
                                      //cout<<"Your Remaining Cash is ="<<ReturnAmount<<endl<<"Take it ?"<<endl;
                                                                          }
                           
                                               }
                                               else
                                               {
                                               cout << "This seat is booked" << endl;
                                                                                               }
                                            }
                                            cout << "Would you want to book another seat (y/n)? " << endl;
                                            char cont;
                                            cin >> cont;
                                                        if(cont == 'y' || cont == 'Y')
                                            {
                                            goto xy;
                                            }
                                            }
                                            break;
                                        
                                         }                 
                                  
                                   }
                             
                                          
                                
                    
                                 }
                                 //End Of Case 5 For Destination Switch
                                 break;
                                       //Start Of Case 6 For Destination Switch
                                 case('6'):
              {
                    system("cls");
                    system("color 1a");
                    cout<<setw(55)<<"***********************************"<<endl<<endl;
                    cout<<setw(58)<<"         HELP MENU                 "<<endl<<endl;
                    cout<<setw(55)<<"***********************************"<<endl<<endl<<endl;
                    cout<<setw(27)<<"Asslam u Aliakum : "<<endl;
                    cout<<setw(70)<<"This is Help Menu You Have Only Six Choice "<<endl;
                    cout<<setw(73)<<"we Show You Our Flight Schudule. You Choose One Of Them "<<endl;
                    cout<<setw(73)<<"If You go Makkah Choose 1 as So On "<<endl;
                    cout<<setw(79)<<"When You Choose Your Destination Then I show our Ticket Price "<<endl;
                    cout<<setw(78)<<"When You Give Us Ticket Price Then i Give You More Option  "<<endl;
                    cout<<setw(77)<<"Remember It : You Choose Only 31 date 12 month and year 2012 "<<endl;
                    cout<<setw(44)<<"Prss 6 for Exist "<<endl<<endl;
                   
              }
              //End Of Case 6 For Destination Switch
              break;
                                 default:
                 //if Codtion is Fail Then
                 {
                                                                 cout<<"Sorry You Enter Wrong Number \n\n";
                                                                 gotos;
                 }
                 break;
            }
           }
          }

          }
     }
  

     else              //Start Of Else
     {
      cout<<"Dear Only Enter 1"<<endl<<endl;
      goto w;

}//End Of Else
}

else                       //Start Of Else
{
    char num;
    cout<<"Sorry Sir On that Date Flight is Not Available \n\n";
    cout<<"If You Want To Change Date Press 3 . \n\n";
    cin>>num;
    if(num=='3')
    {
                system("cls");
                goto f;
    }
    else               //Start Of Else
    {
        cout<<"Ok Bye Bye \n\n\n\n";
    }//End Of Else
}//End Of Else
}
//End Of Long Booking Function
voidflightschudule() //fuction in which we discuss flights schudule
{
     system("color 5f");
                const int maxflights=5;
     system("cls"); //removing text from screen
     cout<<setw(60)<<"****************************************"<<endl<<endl;
     cout<<setw(60)<<"      Our Flight Schudule is That:       "<<endl<<endl;
     cout<<setw(60)<<"****************************************"<<endl<<endl<<endl;
flgt:
     cout<<"There are Only"<<maxflights<<" Flights:"<<endl; //flights available
                 //here we discus destination
                 testing();
                 chardesti;
                 cout<<"Enter Your Distination From Given \n\n";
                 cin>>desti;
                 if(desti<'1' || desti>'6')
                 {
                cout<<"Enter Number Between 1 And 6 \n\n";
                cout<<"You Want Again Choose Your Detination  (y/n): \n\n";
Des:           
                char des;
                                        cin>>des;
                                        if(des=='Y' ||des=='y')
                                        {
                system("cls");
                                        gotoflgt; //Loop Start From Menu
                            }
                else if (des=='n' || des== 'N')
                                        {
                                        }
                                        else
                                        {
                cout<<"please enter y for yes and n for NO"<<endl;
                                                    goto Des;
                }
               
     }
     else
     {
     switch(desti)
     {
     case '1':
          {
     string destination[maxflights];
                 destination[0]="Lahore To Makkah \n\n";
                 stringdate[maxflights];
     date[0]="20/12/2012 \n\n";
     string time[maxflights];
                 time[0]="11:20 \n\n";
     cout<<destination[0]<<date[0]<<time[0]<<endl;
          }
     break;
     case '2':
          {
            string destination[maxflights];
                        destination[1]="Lahore To London \n\n";
                        string date[maxflights];
            date[1]="20/12/2012 \n\n";
            string time[maxflights];
                        time[1]="12:20 \n\n";
            cout<<destination[1]<<date[1]<<time[1]<<endl;
          }
     break;
     case '3':
          {
            string destination[maxflights];
                        destination[2]="Lahore To Baghdad \n\n";
                        stringdate[maxflights];
            date[2]="20/12/2012 \n\n";
            string time[maxflights];
                        time[2]="13:30 \n\n";
            cout<<destination[2]<<date[2]<<time[2]<<endl;
          }
     break;   
     case '4':
          {
            string destination[maxflights];
                        destination[3]="Lahore To Canda \n\n";
                        stringdate[maxflights];
            date[3]="20/12/2012 \n\n";
            stringtime[maxflights];
                    time[3]="14:30 \n\n";
            cout<<destination[3]<<date[3]<<time[3]<<endl;
          }
     break;
     case '5':
          {
            string destination[maxflights];
                        destination[4]="Lahore To Africa \n\n";
                        stringdate[maxflights];
            date[4]="20/12/2012 \n\n";
            string time[maxflights];
                        time[4]="15:20 \n\n";
            cout<<destination[4]<<date[4]<<time[4]<<endl;
          }
     break;
                 }

}
}
voidadminMaster()
{
     system("cls");
     system("color 2f");
     cout<<setw(60)<<"****************************************"<<endl<<endl;
     cout<<setw(60)<<"    WELCOME TO ADMIN MASTER        "<<endl<<endl;
     cout<<setw(60)<<"****************************************"<<endl<<endl<<endl;
     cout<<setw(35)<<endl<<"ABOUT ADMIN MASTER : \n\n"<<endl;
     cout<<setw(70)<<"In This Moudule We Can Change Name And Password \n\n";           
     cout<<setw(72)<<"Of The Admin Login. In Here You write A name And  \n\n";
     cout<<setw(72)<<"Password, Then Login In Admin With Same Name and  \n\n";
     cout<<setw(81)<<"Password.In Other Words This Is Sign Up For Admin Login . \n\n\n"<<endl;
     ofstream myfile;
     string adminname;
     cout<<"Enter Your Name For Admin Log in \n\n";
     cin.sync();
     getline(cin, adminname,'\n');
     myfile.open ("Admin Name.txt");
     myfile<<adminname;
     myfile.close();
                    
     string password;
     cout<<endl<<"Enter Your Password \n\n";
     cin.sync();
     getline(cin, password,'\n');
     myfile.open ("password.txt");
     myfile<<password;
     myfile.close();

}
voidadminfunction()
{
      system("cls");
      system("color 6b");
      string name;
                  stringpasswords;
                  intchance=3;
                 
c:   
      //*******************  WELCOME MASSAGE  *********************//
     
      cout<<setw(60)<<"****************************************"<<endl<<endl;
      cout<<setw(57)<<"             WELCOME IN ADMIN MOUDULE       "<<endl<<endl;
      cout<<setw(60)<<"****************************************"<<endl<<endl<<endl;
       
         cout<<"PLEASE ENTER YOUR NAME  : \n\n";
         cin.sync();
         getline(cin,name,'\n');
         ifstream myfile("Admin Name.txt");
         string adminname;
         string word;
                     if(myfile.is_open())
                     {
                     while(!myfile.eof())
         {
                            getline(myfile,adminname);
         }
         myfile.close();
         }
         else
         {
       
         }
         if(name==adminname)
         {

    
                while (chance>=0)
                {

        cout<<endl<<"PLEASE ENTER PASSWORD FOR LOG IN : \n\n";
        cin>>passwords;
        ifstreammyfile("password.txt");
        string password;
        stringword;
        if(myfile.is_open())
        {
        while(!myfile.eof())
        {
        getline(myfile,password);
        }
        myfile.close();
        }
        else
        {
        cout<<"Error Opening File Programe will Exist;)";
        }
        if(passwords==password)
                                  {
            cout<<setw(25)<<"Paswword Accepted \n\n"<<endl;
                                                cout<<setw(35)<<"Dear Press : \n"<<endl<<endl;
                                                cout<<setw(51)<<" 1 : FLIGHT ADD \n"<<endl;
                                                cout<<setw(54)<<" 2 : FLIGHT REMOVE \n"<<endl;
            cout<<setw(53)<<" 3 : TICKET PRICE \n"<<endl;
            cout<<setw(45)<<" 4 : EXIT \n"<<endl;
                                                cout<<setw(45)<<" 5 : HELP \n"<<endl;
                                                cout<<"Enter Your Choice \n\n";
                                                break;
         }
                                 else
                                 {
                                                cout<<"wrong entry please try again "<<endl;
                                                cout<<"you have "<< chance<< " chances left "<<endl;
                                                if (chance==0)
                                                {
                                                                cout<<"sory u failed to prove ur identity program will now exit \n\n"<<endl;
                                                                cout<<" Press any key \n\n";
                                                }
                                                chance--;
                                }
                 
   }
  
 }
 else
 {
     char again;
     cout<<"You Are Not Administrator \n\n";
     cout<<"if You Want Again Login Press y \n\n"<<endl;
     cin>>again;
     if (again=='Y' ||again=='y')
                                 {
         system("cls");
                                 gotoc;
                   }
                   else
                   {
           cout<<"Next Time Be CareFull For Adminstrator \n\n";
           cout<<"Press any key \n\n";
       }
     }
}
voidconfirmationSeat()
{
     system("cls");
     cout<<setw(60)<<"****************************************"<<endl<<endl;
     cout<<setw(63)<<"    Welcome To Confirmation Seat        "<<endl<<endl;
     cout<<setw(60)<<"****************************************"<<endl<<endl<<endl;
               
     const int size = 12;
     int seats[size];
     cout<<setw(40)<<"Total Seat In Your Flight are :"<<endl;
                for(int i=1;i<13;i++)
                {
            int seats = 0;
            seats = seats + i;
            cout<<setw(42)<<seats<<endl;
      }
      
}

voidaddcoustomerfunction()
{
     system("cls");
      cout<<setw(60)<<"****************************************"<<endl<<endl;
     cout<<setw(63)<<"    Welcome To Add a Coustomer           "<<endl<<endl;
     cout<<setw(60)<<"****************************************"<<endl<<endl<<endl;
}
void testing()
{
               
 cout<<"Available Flights are :\n\n";
 cout<<setw(20)<<"Dear Sir Press : \n\n";
 cout<<setw(40)<<"1 :Lahore To Makkah\n\n" ;
 cout<<setw(41)<<"2 :Lahore To London \n\n";
 cout<<setw(42)<<"3 :Lahore To Baghdad \n\n";
 cout<<setw(40)<<"4 :Lahore To Canda \n\n";
 cout<<setw(40)<<"5 :Lahore To Africa\n\n";
 cout<<setw(28)<<"6 :Help\n\n";
 cout<<"Please Enter Your Choice\n\n";
}
voidcomplainFunction()
{
     system("cls");
     system("color 6f");
     ofstream complainfile;
                 stringcomplain;
     complainfile.open ("Complain File.txt");
     int count = 5;
                 for(int i=0; i<count; i++)
                 {
                          
                             cout<<"Enter Complain No : "<<i+1<<endl;
                 cin.sync();
                 getline(cin, complain,'\n');
                

                                complainfile <<complain<<endl;
                  }
  complainfile.close();
}
void showflight()
{
     ofstream myfile;
               
                myfile.open ("Flight Save.txt");


                {
                                myfile<<"1 :Lahore To Makkah\n\n" ;
                                myfile<<"2 :Lahore To London \n\n";
                                myfile<<"3 :Lahore To Baghdad \n\n";
                                myfile<<"4 :Lahore To Canda \n\n";
                                myfile<<"5 :Lahore To Africa\n\n";
                }
                myfile.close();
}

void addFlight()
{
    
      system("cls");
      system("color 5f");
      cout<<setw(60)<<"****************************************"<<endl<<endl;
     cout<<setw(65)<<"    WELCOME TO ADD FLIGHT                 "<<endl<<endl;
     cout<<setw(60)<<"****************************************"<<endl<<endl<<endl;
     cout<<"These Flights Are Already Available \n\n";
      showflight();
      string line;
                  ifstreammyfile ("Flight Save.txt");

                  if(myfile.is_open())
                  {
                                while (! myfile.eof() )
                                {
                                                getline (myfile,line);
                                                cout << line << endl;
                                }

                 myfile.close();
                 }

                 else cout << "Unable to open file";

              cout<<"Do You Want To Enter Another Flight (y/n) \n\n"<<endl;            
Fd:
FD:
              
               char fd;
               cin>>fd;
                if (fd=='Y' || fd=='y')
                                        {
                string newflight;
                ofstream myfile;
               
                {
                cout<<"Enter Your New Flight \n\n";
                cin.sync();
                getline(cin,newflight,'\n');
                myfile.open ("Flight Save.txt", ios::app); 
                myfile<<newflight;
                myfile.close();
                }
                            myfile.close();
                                
                                          goto Fd; //Loop Start From Menu
                              }
                  else if (fd=='n' || fd == 'N')
                                           {
                                           
                                             }
                                               else
                                                {
                         cout<<"please enter y for yes and n for NO"<<endl;
                                                             goto FD;} 
                      myfile.close();
                         
}
voidremoveflight()
{
     cout<<"The Total Flight In Your File Is \n\n";
     ifstream myfile ("Flight Save.txt");
     string line;
                  if(myfile.is_open())
                  {
                                while (! myfile.eof() )
                                {
                                                getline (myfile,line);
                                                cout << line << endl;
                                }

                    myfile.close();
                    }

                    else
        {
             cout << "Unable to open file";
        }     
        char remove;
        cout<<"What Flight You Can Remove \n\n";
        cin>>remove;
        switch(remove)
        {
                      case '1':
                           {
                               }
        }

}

OUTPUT OF THE PROGRAM

Airline Reservation System in C++
Airline Reservation System in C++

C++ Projects
Admin Master Module

C++ Projects
Set Admins

Airline Reservation System in C++
Admin Module

Airline Reservation System in C++
Add Flight in admin Module

Front 

Airline Reservation System in C++
Front Screen

Airline Reservation System in C++
Airline Reservation System in C++



Share it Please
asad

About Author!

Asad Niazi is Software Engineer , Programmer, Web Developers and a young mentor of Tech Solutions Desk and Blogging Solutions . Asad Love to writes about Technology, Programming, Blogging and make money online.

0 comments:

Post a Comment