Like Tree1Likes
  • 1 Post By jimblumberg

How to Correct the search In the end of the program

This is a discussion on How to Correct the search In the end of the program within the C++ Programming forums, part of the General Programming Boards category; I have written same post before but my question is different this time .. so moderators please ... Code: #include<conio.h>#include<iostream.h> ...

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

    Question How to Correct the search In the end of the program

    I have written same post before but my question is different this time .. so moderators please ...
    Code:
    #include<conio.h>#include<iostream.h>
    class air_line
    {
    private:
    char name[5][100],name1;
    long double opt,opt1,opt2,cnic[5],ticket_number[5],ticket_number1,cnic1;
    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<<"Where You want to go \n 0.Pakistan \n 1.Abroad";
    cin>>opt2;
    }
    	if(opt2==0)
    {
    cout<<"*********************Prices for Pakistan*********************";
    cout<<"Islambad To Karachi - 14000 PKR";
    cout<<"Islambad To Lahore - 6000 PKR";
    cout<<"Islambad To Peshawar - 8000 PKR";
    cout<<"Islambad To Sialkot - 4000 PKR";
    cout<<"Islambad To Quetta - 7000 PKR ";
    }
    	if(opt2==1)
    {
    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 Ticket Number : ";
    cin>>ticket_number1;
    }
    
    
    for (int k=1;k<=5;k++)
    {
    if(ticket_number1==ticket_number[k])
    {
    cout<<"\n Your Info is Following : ";
    cout<<"\n Name of Passenger is: "<<name[i];
    cout<<"\n Ticket Number : is that "<<ticket_number[k];
    cout<<"\n CNIC No. :"<<cnic[j];
    }
    }
    };
    main();
    {
    clrscr()
    air_line tahir;
    tahir.input();
    tahir.process();
    getch();
    }

  2. #2
    Registered User
    Join Date
    May 2010
    Posts
    2,805
    Why did you open a new topic? You already asked this question here.

    Jim
    Salem likes this.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. please help me correct this program
    By loogan211 in forum C Programming
    Replies: 5
    Last Post: 02-09-2013, 10:53 PM
  2. correct this program anyone please....
    By jothimani1991 in forum C Programming
    Replies: 3
    Last Post: 01-08-2013, 05:49 PM
  3. another little program: is this correct?
    By fsx in forum C Programming
    Replies: 7
    Last Post: 05-19-2009, 07:50 AM
  4. is this simple program correct? K&R 1-12
    By fsx in forum C Programming
    Replies: 14
    Last Post: 04-22-2009, 03:04 PM
  5. Is this program correct ?
    By broli86 in forum C Programming
    Replies: 9
    Last Post: 08-02-2008, 06:01 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21