Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > General Computer Discussion > Software > Help This Beginner

Reply
Thread Tools

Help This Beginner

 
 
khukhu khukhu is offline
Junior Member
Join Date: Jul 2009
Posts: 1
 
      07-05-2009
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:isplay1()
{
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:isplay2()
{
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:isplay3()
{
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:
;
}
}
}
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Beginner's Beginner william nelson Ruby 7 04-11-2011 11:23 PM
Help a beginner!!! =?Utf-8?B?U2Ft?= Wireless Networking 4 04-21-2005 06:50 AM
Help with Visual Studio (beginner) tripwater ASP .Net 3 03-09-2005 06:00 PM
No Class at ALL!!! beginner/beginner question =?Utf-8?B?S3VydCBTY2hyb2VkZXI=?= ASP .Net 7 02-03-2005 02:47 PM
Tutorial for beginner/ Tutorial voor beginner Rensjuh C++ 7 09-02-2004 12:41 AM



Advertisments