cout << "Welcome to the Main Menu "<<endl;
cout << "1. Reserve a room. "<<endl;
cout << "2. Check vacant rooms. "<<endl;
cout << "3. Bill calculation "<<endl;
cout << "4. History of reserved rooms. "<<endl;
cout << "5. Delete the Reservation data. "<<endl;
cout << "6. About the Application. "<<endl;
default:
cout <<"invalid Choice "<<endl;
cout <<endl;
}
cout<<"1. to go back into MAIN Menu or 0 to terminate the program: ";
cin>>again;
cout<<"___________________________________"<<endl;
cout<<endl;
}
while (again=='1');
cout<<"Thank you, For using Hotel Reservation application."<<endl;
cout<<"Have a nice day! "<<endl;
cout<<endl;
system ("pause");
}
void user_total() //funtion definition of function user_total
{
int choice,days,total1;
char AC,again;
int c=1000;
int single= 3000;
int doubl=3500;
int triple=4000;
int time=24;
int service=300;
do
{
cout<<"Which kind of Room did the guest stayed in? "<<endl;
cout<<endl;
cout<<" 1.Single "<<endl;
cout<<endl;
cout<<" 2.Double "<<endl;
cout<<endl;
cout<<" 3.Triple "<<endl;
cout<<endl;
cout<<"Select 1,2,3,4,5 or 6 . "<<endl;
cout<<endl;
cout<<"Enter Your Choice Here_: ";
cin>>choice;
cout<<"__________________________________"<<endl;
switch(choice)
{
case 1:
cout<<" Single room selected. "<<endl;
cout<<endl;
cout<<" Days spent: ";
cin>>days;
cout<<endl;
cout<<" Press Y for A/c and N for without A/c: ";
cin>>AC;
cout<<endl;
if (AC == 'Y' || AC == 'y')
{
total1 =(c+single+time+service)*days;
cout<<"Your Total Total bill + service tax = ("<<total1<<" BWP.)"<<endl;
cout<<endl;
cout<<"______________________________"<<endl;
}
else if (AC == 'N' || AC == 'n')
{
total1=(single+time+service) * days;
cout<<"Your Total Total bill + service tax = ("<<total1<<" BWP.)"<<endl;
cout<<endl;
cout<<"_______________________________"<<endl;
}
break;
case 2:
cout <<"You Have Selected Double room."<<endl;
cout <<endl;
cout <<"Days spent: ";
cin >>days;
cout <<endl;
cout <<" Press Y for A/c and N for without A/c: ";
cin >>AC;
cout <<endl;
if (AC == 'Y' || AC == 'y')
{
total1 =(c+doubl+time+service)*days;
cout<<"Your Total Total bill + service tax = ("<<total1<<" BWP.)"<<endl;
cout<<endl;
cout<<"__________________________________"<<endl;
}
else if (AC == 'N' || AC == 'n')
{
total1=(doubl+time+service) * days;
cout<<"Your Total Total bill + service tax = ("<<total1<<" BWP.)"<<endl;
cout<<endl;
cout<<"_______________________________________"<<endl;
}
break;
case 3:
cout<<"You Have Selected Suit. "<<endl;
cout<<endl;
cout<<" Days spent: ";
cin>>days;
cout<<endl;
cout<<" Press Y for A/c and N for without A/c: ";
cin>>AC;
cout<<endl;
if (AC == 'Y' || AC == 'y')
{
total1 =(c+triple+time+service)*days;
cout<<"Your Total Total bill + service tax = ("<<total1<<" BWP.)"<<endl;
cout<<endl;
cout<<"_______________________________________"<<endl;
}
else if (AC == 'N' || AC == 'n')
{
total1=(triple+time+service) * days;
cout<<"Your Total Total bill + service tax = ("<<total1<<" BWP.)"<<endl;
default:
cout<<"you have enter an invalid Choice "<<endl;
cout<<endl;
}
cout<<"Do you want to checkout for another room? (Y/N): ";
cin>>again;
cout<<"___________________________________"<<endl;
cout<<endl;
}
while(again == 'y' || again == 'Y');
}
void customer_reserve() //function definition
{
Name guest; // guest is the name structure
Name guest2;
char choicedo; //for enter more data
do
{
ofstream file;
file.open("User info input.txt",ios::out | ios::app); //openning txt file
if(!file)
{
cout<<"Error: Cannot open file.\n";
system("pause");
}
cout<<" Room Number to be Reserved: ";
cin>>guest.room;
cin.ignore();
cout<<endl;
cout<<”First Name: ";
cin.getline(guest.first, 20);
cout<<endl;
cout<<"Last Name: ";
cin.getline(guest.last, 20);
cout<<endl;
cout<<"Enter The Mobile no.: +";
cin.getline(guest.mob, 20);
cout<<endl;
cout<<"Enter The CNIC of The Customer: ";
cin.getline(guest.cnic, 20);
cout<<endl;
cout<<"The Name of Manager in Charge: ";
cin.getline(guest2.first, 20);
cout<<endl;
cout<<endl;
cout<<"Date: ";
cin.getline(guest.date, 20);
cout<<endl;
int a; ///for choice
/////////////
cout<<"1.Save or 2. cancel: ";
cout<<endl;
cin>>a;
if(a==1)
{
cout<<endl;
file<<" Guests Info"<<endl;
cout<<endl;
file<<"------------------------------------------------------------"<<endl;
file << endl;
file << "Reservation: "<<guest.room<<endl;
file << endl;
file << " Guest is: "<<guest.first<<" "<<guest.last<<endl;
file << endl;
file << "Mobile No.: +"<<guest.mob<<endl;
file << endl;
file << "CNIC No.: "<<guest.cnic<<endl;
file << endl;
file << "Manager in Charge is: "<<guest2.first<<endl;
file << endl;
file << "Date: "<<guest.date<<endl;
file << endl;
file <<endl;
file <<"-----"<<endl;
file.close();
cout <<"Record Saved..."<<endl;
cout <<"__________________________________"<<endl;
cout <<endl;
}
else
{
cout <<"Not Saved"<<endl;
cout <<"_________"<<endl;
cout <<endl;
}
cout <<" Y input another data or N to Exit: ";
cin >>choicedo;
cout <<"__________"<<endl;
cout <<endl;
}
while (choicedo=='y' || choicedo=='Y'); //to enter more data
//}
}
cout<<"About the Application"<<endl;
cout<< " made for Hotel Reservation "<<endl;
}
Help me to create it using class.
Add a code that check availability of vacant rooms