Reservation Program

Good day, i need help with creating a reservation program.
Using this scenario:

[You are a Software Engineer working in the IT Department (** Resort)

You a tasked with developing program to automate the resort’s booking

process.



The resort has types of clients

1.) Students Clients – in addition to common properties would

have student number, discount rate, school/university, and programme of study.



2.) Corporate Clients –

in addition to common properties would have company name, registration number, and VAT number,

and Individual Clients who pretty much only have the common attributes that the others have. The

resort has several rooms that are charged according to capacity.

These would include:

• Single: A room assigned to one person

• Double: A room assigned to two people

• Triple: A room assigned to three people

• Quad: A room assigned to four people

• Queen: A room with a queen-sized bed

• King: A room with a king-sized bed.



Write a program that will:

1. Check if a particular room is available on a given date

2. Book a room for a given date

3. Print the details of a client who is booked into a particular room on a given date.

4. Print the booking history of a particular room

5. Print the details of all available (not booked rooms)

6. Show a client how much they owe for their booking.



Your solution should be written in C++ and should demonstrate the following concepts learnt in the

course:

• Object-Orientation

• Inheritance

• Polymorphism

• Encapsulation

• Overloading



Make use:

Files to store your data

Arrays (one dimensional and two-dimensional arrays).

What do you need help with?
What don't you understand?
How can we help you?
Can you show us your code so far?

Without this, this is pretty hard for anyone here to help you :)
Honestly, sounds like you'd need sql, not c++.
#include<iostream>
#include<fstream>
#include<windows.h>
#include<string>
using namespace std;

struct Name
{
char first[20];
char last[20];
char date[20];
int room;
char cnic[20],mob[20];
};

//\\Functions prototyping//\/\\

void vacant_rooms(); //for vacant rooms|
void customer_reserve();
//void check();
void user_total();

//void help();
void about();
void del_resdata();

//------------------------.>//


int main()
{

int a;
int choice;
char again;
char x[20];
cout <<endl;
cout <<"Hotel Reservation Application "<<endl;
cout <<endl;


do
{

cout << "Welcome to the Holiday Resort "<<endl;
cout << "Type of client\n"<<endl;
cout << " 1.Students Clients "<<endl;
cout << " 2.Corporate Clients \n"<<endl;
cout << "Enter Here_: ";
cin >>a;
cout <<"_____________________________________"<<endl;
cout <<endl;


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;


cout << "0. Exit application.\n"<<endl;
cout << "Enter Here_: ";
cin >>a;
cout <<"_____________________________________"<<endl;
cout <<endl;

switch(a)
{
cout <<"________________________________________"<<endl;
case 0:
break;
case 1:

cout << "Welcome to the Reservation Menu"<<endl;


cout <<endl;
customer_reserve();
break;
case 2:

cout << "Welcome to the Vacant Rooms"<<endl;
cout<<endl;
vacant_rooms();
break;
case 3:

cout <<"Bill Calculation"<<endl;


cout<<endl;
user_total(); //function calling
break;
case 4:

cout <<"Welcome to the History Menu" <<endl;
cout <<endl;

check(); //function calling
break;
case 5:
cout << " " <<endl;
cout << "Welcome to Delete Reservation data function" <<endl;
cout << " " <<endl;
cout << endl;
cout << endl;
del_resdata(); //function calling
break;
case 6:
cout << " " <<endl;
cout << "About the Application" <<endl;
cout << " " <<endl;
cout << endl;
cout << endl;
about(); //function calling
break;

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;

cout<<endl;
cout<<"__________________________________________"<<endl;
}
break;




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
Last edited on
Topic archived. No new replies allowed.