Help This Beginner

Discussion in 'Software' started by khukhu, Jul 5, 2009.

  1. khukhu

    khukhu

    Joined:
    Jul 5, 2009
    Messages:
    1
    i am failing to understand my source code .It can't be executed.i have spent a lot of time on this. I am using Visual..here is my source code.

    #include <iostream>
    #include <string>
    using namespace std;
    //class TRAVEL CONTROLS ALL FUNCTIONS
    class Travel
    {

    struct Hotel
    { string cityName;
    string hotelName;
    int hotelCode;
    int standardRoomNo;
    int standardRoomPrice;
    int deluxeRoomNo;
    int deluxeRoomPrice;
    }H;

    struct Resort
    { string cityName;
    int resortID;
    string resortName;
    int numberOfResorts;
    int resortPrice;
    }R;
    struct Booking
    { int reservationNum;
    string clientName;
    int contactTel;
    string email;
    char option;
    }B;

    public:
    void Hotelinput();
    void Resortinput();
    void Bookinginput();
    void Display1();
    void Display2();
    void Display3();
    } P;


    //**********************************************************
    // FUNCTION NAME : Hotel
    //**********************************************************

    void Travel::Hotelinput()
    {
    //DATA OF HOTEL
    cout<<"Enter Hotel Information:";
    cout<<"Enter City Name:";
    cin>>(H.cityName);
    cout<<"Hotel Name:";
    cin>>(H.hotelName);
    cout<<"Hotel Code:";
    cin>>(H.hotelCode);
    cout<<"Standard Room Number:";
    cin>>(H.standardRoomNo);
    cout<<"Standard Room Price:";
    cin>>(H.standardRoomPrice);
    cout<<"Deluxe Room Number:";
    cin>>(H.deluxeRoomNo);
    cout<<"Deluxe Room Price:";
    cin>>(H.deluxeRoomPrice);
    }

    void Travel::Resortinput()
    //DATA OFRESORT
    { cout<<"Enter City Name:";
    cin>>(R.cityName);
    cout<<"Enter Resort ID:";
    cin>>(R.resortID);
    cout<<"Enter Resort Name:";
    cin>>(R.resortName);
    cout<<"Number Of Resorts:";
    cin>>(R.numberOfResorts);
    cout<<"Enter Resort Price:";
    cin>>(R.resortPrice);
    }

    void Travel::Bookinginput()
    //BOOKING DATA
    { cout<<"Enter Reservation Number:";
    cin>>(B.reservationNum);
    cout<<"Enter Client Name:";
    cin>>(B.clientName);
    cout<<"Enter Contact Tel.:";
    cin>>(B.contactTel);
    cout<<"Enter E-mail:";
    cin>>(B.email);
    cout<<"Enter Catergory(H for Hotel,R forResort):";
    cin>>(B.option);
    }

    void Travel::Display1()
    {
    cout<<"Hotel information:";
    cout<<"City Name:"<<H.cityName<<endl;
    cout<<"Hotel Name:"<<H.hotelName<<endl;
    cout<<"Hotel Code:"<<H.hotelCode<<endl;
    cout<<"Standard Room Number:"<<H.standardRoomNo<<endl;
    cout<<"Standard Room Price:"<<H.standardRoomPrice<<endl;
    cout<<" Deluxe Room Number:"<<H.deluxeRoomNo<<endl;
    cout<<"Deluxe Room Price:"<<H.deluxeRoomPrice<<endl;

    }

    void Travel::Display2()
    {
    cout<<"Resort information:"<<endl;
    cout<<"City Name:"<<R.cityName<<endl;
    cout<<"Resort Name:"<<R.resortName<<endl;
    cout<<"Resort ID:"<<R.resortID<<endl;
    cout<<"Resort Price:"<<R.resortPrice<<endl;

    }

    void Travel::Display3()
    {
    cout<<"Reservation Number:"<<B.reservationNum<<endl;
    cout<<"Client Name:"<<B.clientName<<endl;
    cout<<"Contact Tel.:"<<B.contactTel<<endl;
    cout<<"E-mail:"<<B.email<<endl;
    cout<<"Catergory:"<<B.option<<endl;
    }



    int main()
    {

    void displayMain();
    return 0;
    }
    void displayMain()
    {
    {int selection;
    do
    {
    cout<<"**********MAIN**********"<<endl;
    cout<<"1.) Add Hotel Information: " << endl;
    cout<<"2.) Add Resort Information:" << endl;
    cout<<"3.) Add New Booking:" << endl;
    cout<<"4.) View Hotel Information:"<<endl;
    cout<<"5.) View Resort Information:"<<endl;
    cout<<"6.) View Booking Information:"<<endl;
    cout<<"7.) EXIT" << endl;
    cout << "Selection: ";
    cin >> selection;
    }
    while (selection <= 0 && selection >= 7);

    switch (selection)
    {
    case 1:
    P.Hotelinput();
    break;
    case 2:
    P.Resortinput();
    break;
    case 3:
    P.Bookinginput();
    break;
    case 4:
    P.Display1();
    case 5:
    P.Display2();
    case 6:
    P.Display3();

    case 7://leave blank
    default:
    ;
    }
    }
    }
    khukhu, Jul 5, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?U2Ft?=

    Help a beginner!!!

    =?Utf-8?B?U2Ft?=, Apr 20, 2005, in forum: Wireless Networking
    Replies:
    4
    Views:
    521
    Rob D
    Apr 21, 2005
  2. big chris
    Replies:
    4
    Views:
    3,468
    big chris
    Jan 18, 2004
  3. =?Utf-8?B?Sm9obiBIYXllcw==?=

    HELP!!! I am a TOTAL BEGINNER!

    =?Utf-8?B?Sm9obiBIYXllcw==?=, Jan 19, 2004, in forum: MCSD
    Replies:
    11
    Views:
    798
    The Poster Formerly Known as Kline Sphere
    Jan 22, 2004
  4. Janaka Palliyeguruge

    help for MCSD beginner

    Janaka Palliyeguruge, Oct 14, 2004, in forum: MCSD
    Replies:
    1
    Views:
    472
    =?Utf-8?B?UmFqYQ==?=
    Oct 15, 2004
  5. Mikita
    Replies:
    11
    Views:
    579
    BuffNET Tech Support - MichaelJ
    Feb 1, 2004
Loading...

Share This Page