Thread: getting error in AIR LINE RESERVATION SYSTEMw

  1. #1
    Registered User
    Join Date
    Nov 2012
    Posts
    22

    getting error in AIR LINE RESERVATION SYSTEMw

    Code:
    #include<conio.h>
    #include<iostream.h>
    class air_line
    {
    private:
    char name[5][100];
    int opt,opt1,cnic[5],ticket_number[5];
    public:
    void input()
    {
    for(int i=1;i=5;i++)
    {
    cout<<"Please Enter Your Name : ";
    cin>>name[i];
    }
    for(int j=1;j<=5;j++)
    {
    cout<<"Please Enter Your CNIC Number : ";
    cin>>cnic[j];
    }
    for(int k=1;k<=5;k++)
    {
    cout<<"Please Enter Your Ticket Number : ";
    cin>>ticket_number[k];
    }
    }
    void process()
    {
    cout<<"Enter your option  \n 1.Prices  \n 2.Ticket Confirmation \n  ";
    cin>>opt;
    if(opt==1)
    {
    cout<<"Select Journey \n 1.Abroad\n 2.Pakistan ";
    cin>>opt1;
    if(opt1==1)
    {
    cout<<" ";
    else if(opt1==2)
    {
    cout<<"*********************Prices for Pakistan*********************";
    cout<<"Islmabad To Karachi - 14000 PKR";
    cout<<"Islmabad To Lahore - 6000 PKR";
    cout<<"Islmabad To Peshawar - 8000 PKR";
    cout<<"Islmabad To Sialkot - 4000 PKR";
    cout<<"Islmabad To Quetta - 7000 PKR ";
    }
    else if(opt1==2)
    {
    cout<<"*********************Prices for Abroad*********************";
    cout<<"Islmabad To Dubai UAE - 24000 PKR";
    cout<<"Islmabad To Wishington - USA  - 60000 PKR";
    cout<<"Islmabad To California - USA - 120000 PKR";
    cout<<"Islmabad To China - 20000 PKR";
    cout<<"Islmabad To Iran - 17000 PKR ";
    }
    else
    {
    cout<<"Wrong Statement Entered";
    }
    }
    if(opt==2)
    {
    cout<<"Please Enter Your Name : ";
    cin>>name;
    cout<<"Please Enter Your CNIC Number :";
    cin>>cnic;
    cout<<"Please Enter Your Ticket Number : ";
    cin>>ticket_number;
    for(int y=1;y<=5;y++)
    {
    cout<<"\n Eearch about these ticket no is:";
    cin>>ticket_number[i];
    }
    
    
    cout<<"\nenter search ticket no is:";
    cin>>ticket_no;
    for (i=0;i<=5;i++)
    if(ticket_number[1]==ticket_no)
    {
    cout<<"\n Your Info is Following : ";
    cout<<"\n Name of Passenger is: "<<name[1];
    cout<<"\n Ticket Number : is that "<<ticket_no[1];
    cout<<"\n CNIC No. :"<<cinic[1];
    }
    else if(ticket_number[2]==ticket_no)
    {
    cout<<"\n Your Info is Following : ";
    cout<<"\n Name of Passenger is: "<<name[2];
    cout<<"\n Ticket Number is "<<ticket_no[4];
    cout<<"\n CNIC No. :"<<cinic[2];
    }
    else if(ticket_number[3]==ticket_no)
    {
    cout<<"\n Your Info is Following : ";
    cout<<"\n Name of Passenger is: "<<name[2];
    cout<<"\n Ticket Number is "<<ticket_no[2];
    cout<<"\n CNIC No. :"<<cinic[2];
    }
    else if(ticket_number[4]==ticket_no)
    {
    cout<<"\n Your Info is Following : ";
    cout<<"\n Name of Passenger is: "<<name[4];
    cout<<"\n Ticket Number is "<<ticket_no[4];
    cout<<"\n CNIC No. :"<<cinic[4];
    }
    else if(ticket_number[5]==ticket_no)
    {
    cout<<"\n Your Info is Following : ";
    cout<<"\n Name of Passenger is: "<<name[5];
    
    
    cout<<"\n Ticket Number is "<<ticket_no[5];
    cout<<"\n CNIC No. :"<<cnic[5];
    }
    };
    air_line tahir;
    tahir.input();
    tahir.process();
    getch();
    }
    }

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,656
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Parse error on line 28 and 36
    By jollykiddo in forum C Programming
    Replies: 4
    Last Post: 12-18-2011, 04:28 AM
  2. reservation system
    By mufanz in forum C++ Programming
    Replies: 2
    Last Post: 05-08-2006, 07:15 AM
  3. Reservation Program Help
    By Ricey in forum C++ Programming
    Replies: 2
    Last Post: 01-25-2006, 03:19 PM
  4. #error & #line
    By studentc in forum C Programming
    Replies: 8
    Last Post: 05-28-2004, 07:47 PM
  5. reservation
    By Unregistered in forum C++ Programming
    Replies: 0
    Last Post: 11-27-2001, 12:22 PM