Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 23

Term paper cse-202

TITLE :-Design A Program For Hotel Management System

Submitted to :
submitted by:
Ms. Baljinder Kaur Rahul Dhiman
Roll no. B-80
10907542
B.Tech ‘CSE’
Sec ‘H0901’

1 |Page
Index

Introduction

I. Key Features

II. Hotel Master

III. Account Master

IV. Project description

V. Various classes used in this program are

VI. Various functions used in this program

VII. Hardware Used

VIII. Software Used

IX. Compatibility

X. Conclusion

XI. Coding

2 |Page
Introduction

This project is about developing a program for managing the day to day statistics
of a hotel and automation of the reservation system. This program enables a
reception clerk to manage the check in check out data of various customers coming
into the hotel. An easy to operate user friendly software that is Committed to meet
the all requirements to manage small, medium And big scale hotels.

Hotel Management System is one of the leading software for complete


management of your Hotel; it can manage the reception, restaurant, inventory and
accounts excellently.

The hotel management software provides all kinds of record keeping feature
required in a hotel like day books, daily business book, Preparation of OFI and
many more automatically.

3 |Page
Key Features:
• Complete and automatic operating of reception.

• Store management.

• Restaurant management.

• Preparing KOT’s reports.

• Complete history of visitors at your hotel.

• Preparation of visitor’s bill.

• Maintaining the inventory section of your hotel.

• Built in backup and restore facilities.

Hotel Master
Master Tables:

The hotel management software provides you all kinds of masters that are in
customizing mode so that your can add the things as per requirement like -

• You can decide masters for your hotel. The software gives masters for details of
types of rooms, types of items in your hotel.

• The software holds the details of your hotel employees.

• The software draws occupancy chart automatically for your hotel.

Restaurant:

You can manage the restaurant as per your requirements.

• Complete stock detail.


4 |Page
• Prepare the complete kot report and NCKOT report.

Hotel Reports:

All kinds of hotel reports can be generated in seconds and you can view and print
them easily.

• Day books

• Daily business report.

• Local call report.

• STD call report.

• Laundry report.

• Cash record.

Account Master
Heads:

• The hotel management software includes all principal heads of commercial field.

• We can also customize the heads per requirement.

Accounting Reports:

The hotel management software provide facility to view and print

• Ledger list.
• Ledger books with daily/summary options.
• Trial balance with closing balance and detailed options.
• Balance Sheets, quick view of current assets and liabilities.
• Reports of every head can also be generated on the closing and detailed
based.

Project description
5 |Page
The program uses the extensively the concept of classes along with file handling of
C++ all the concepts used in this program are described below in details.

CLASSES:-

A class is an expanded concept of a data structure: instead of holding only data, it


can hold both data and functions.

An object is an instantiation of a class. In terms of variables, a class would be the

type, and an object would be the variable.

Classes are generally declared using the keyword class, with the following format:

class class_name {
access_specifier_1:
member1;
access_specifier_2:
member2;
...
} object_names;

Where class_name is a valid identifier for the class, object_names is an optional


list of names for objects of this class. The body of the declaration can contain
members, that can be either data or function declarations, and optionally access
specifiers.

Graphics:-Graphics has been used in this program to draw vertical and horizontal
line for creating rows and columns in order to make the interface more
comprehensive and user friendly.

File handling:-The program also uses extensively the concept of file handling.
Without file handling storing the data of the customers isn’t possible. The program
creates files namely “CUSTOMER.DAT” to store the customers details such as

1. Customer name
2. No of guests with the customer
3. Customers nationality
4. Customers address
5. Customers phone no
6. Customers passport no. etc
6 |Page
.

Compatibility

Hardware Compatibility:-

Program compatible with

1. Pentium iv processor or above


2. Amd athlaon

Software Compatibility:-

Program compatible with

1. OPENSUSE 9 or above.
2. Fedora 8 or above
3. Ubuntu 4 or above
4. Redhat 7 or above.

Conclusion
This is a very useful program which enables a reception clerk to manage the check
in check out data of various customers coming into the hotel. An easy to operate
user friendly software that is Committed to meet the all requirements to manage
small, medium And big scale hotels.

Coding

// PROJECT ON HOTEL MANAGEMENT

# include <iostream.h>

# include <conio.h>

# include <dos.h>

# include <iomanip.h>

7 |Page
# include <graphics.h>

# include <stdio.h>

# include <string.h>

# include <fstream.h>

# include <stdlib.h>

# include <ctype.h>

# include <process.h>

fstream f,f1,f2,f3,f4,f5,f6,f7,f8;

//**********************************************************

// CLASS NAME : Hotel

// DETAILS : IT CONTROLS OVER ALL FUNCTIONING

// OF THE HOTEL

//**********************************************************

class HOTEL

char array[100];

struct bill_restaurant_bar

long brestaurant,bbar;

} b[100];

struct booking_data

long charge,roomno;

char name[25],address[75],telno[10],date[11],roomtype[15];

} d;

struct check_out_data

8 |Page
{

char name[25],address[75],telno[10],date[11],odate[11],otime[6];

int roomno;

} C;

struct cancellation_data

char name[25],address[75],telno[10];

} D;

struct member_swimming_pool_data

char name[25],address[75],telno[10],date[11];

int memno;

} ms;

struct member_gym_data

char name[25],address[75],telno[10],date[11];

int memno;

} mg;

public:

void booking();

void check_in();

void check_out();

void cancellation();

void taxi_service();

void restaurant();

void bar();

9 |Page
void swimming_pool();

void gymnasium();

void games();

void view_data();

} H;

//**********************************************************

// FUNCTION NAME : BOOKING

//**********************************************************

void HOTEL::booking ()

textcolor(2);

clrscr();

int c=0;

//FINDING AN UNOCCUPIED ROOM

f.open("ARRAY.DAT",ios::in|ios::binary);

f.read((char *)&array,sizeof(array));

while(array[c]!='e') c++;

array[c]='o';

f.close();

f.open("ARRAY.DAT",ios::out|ios::binary);

f.write((char *)&array,sizeof(array));

f.close();

f1.open("HOT.EL",ios::app|ios::binary);

d.roomno=c+1;

//DATA OF THE CUSTOMER

cout<<"ENTER THE REQUIRED DATA

10 | P a g e
"

<<"NAME :: ";

gets(d.name);

int l=strlen(d.name);

for(int i=0;i<l;i++) d.name[i]=toupper(d.name[i]);

cout<<"ADDRESS(R) :: ";

gets(d.address);

cout<<"TEL. NO.(R) :: ";

gets(d.telno);

cout<<"DATE WHEN YOU WILL CHECK-IN(dd/mm/yyyy) :: ";

gets(d.date);

cout<<"

ROOM TYPES "<<""

<<"CODES"<<" "<<"CHARGE PER DAY

"

<<"ROYAL SUITE "<<" "<<"1. "<<" "<<"Rs 20,000

"

<<"SUPER DELUXE"<<" "<<"2. "<<" "<<"Rs 15,000

"

<<"DELUXE "<<" "<<"3. "<<" "<<"Rs 10,000

"

<<"DOUBLE BED "<<" "<<"4. "<<" "<<"Rs 5,000

"

<<"SINGLE BED "<<" "<<"5. "<<" "<<"Rs 2,000

";

11 | P a g e
int roomcode;

REDO:

cout<<"ROOM CODE :: ";

cin>>roomcode;

switch(roomcode)

case 1 : strcpy(d.roomtype,"ROYAL SUITE");

d.charge=20000;

break;

case 2 : strcpy(d.roomtype,"SUPER DELUXE");

d.charge=15000;

break;

case 3 : strcpy(d.roomtype,"DELUXE");

d.charge=10000;

break;

case 4 : strcpy(d.roomtype,"DOUBLE BED");

d.charge=5000;

break;

case 5 : strcpy(d.roomtype,"SINGLE BED");

d.charge=2000;

break;

default: cout<<"ENTER THE RIGHT CODE

";

goto REDO;

clrscr();

12 | P a g e
cout<<"YOUR ROOM NO. IS :: "<<d.roomno<<"

";

gotoxy(25,25);

cout<<"PRESS ANY KEY TO CONTINUE";

getch();

//COPYING THE RECORD OF THE CUSTOMER INTO A FILE

f1.write((char *)&d,sizeof(d));

f1.close();

clrscr();

void HOTEL::check_in()

textcolor(12);

clrscr();

int rn;

char ans;

cout<<"HAVE YOU BOOKED IN ADVANCE ?(Y/N)::";

cin>>ans;

if(ans=='n'||ans=='N')

cout<<"THEN YOU FIRST HAVE TO BOOK";

gotoxy(25,25);

cout<<"PRESS ANY KEY TO CONTINUE";

getch();

booking();

13 | P a g e
clrscr();

cout<<"ROOM NUMBER :: ";

cin>>rn;

f1.open("HOT.EL",ios::in|ios::binary);

do f1.read((char *)&d,sizeof(d)); while(d.roomno!=rn);

cout<<"NAME :: "<<d.name<<"

"

<<"ADDRESS(R) :: "<<d.address<<"

"

<<"TEL. NO.(R) :: "<<d.telno<<"

"

<<"CHECK-IN DATE :: "<<d.date<<"

"

<<"ROOM TYPE :: "<<d.roomtype;

gotoxy(25,25);

cout<<"PRESS ANY KEY TO CONTINUE";

getch();

f1.close();

clrscr();

void HOTEL::check_out()

textcolor(10);

clrscr();

int rn;

cout<<"ROOM NUMBER :: ";

14 | P a g e
cin>>rn;

char od[11],ot[6];

cout<<"CHECK-OUT DATE (dd/mm/yyyy) :: ";

gets(od);

cout<<"CHECK-OUT TIME (in form of 07:30 , 22:55 etc) :: ";

gets(ot);

textcolor(6);

clrscr();

fstream e;

f1.open("HOT.EL",ios::in|ios::binary);

do{ f1.read((char *)&d,sizeof(d)); }while(d.roomno!=rn);

gotoxy(25,1); cout<<"**** BILL ****

";

cout<<endl;

cout<<" ROOM NUMBER :: "<<d.roomno<<"

"

<<" NAME :: "<<d.name<<"

"

<<" ADDRESS(R) :: "<<d.address<<"

"

<<" TEL. NO.(R) :: "<<d.telno<<"

"

<<" ROOM TYPE :: "<<d.roomtype<<"

"

<<" CHECK-IN DATE :: "<<d.date<<"

15 | P a g e
"

<<" CHECK-OUT DATE :: "<<od<<"

"

<<" CHECK-OUT TIME :: "<<ot<<"

";

//COPYING THE RECORD OF THE CUSTOMER INTO ANOTHER FILE

f2.open("C.OUT",ios::app|ios::binary);

strcpy(C.name,d.name);

strcpy(C.address,d.address);

strcpy(C.telno,d.telno);

strcpy(C.date,d.date);

strcpy(C.odate,od);

strcpy(C.otime,ot);

C.roomno=d.roomno;

f2.write((char *)&C,sizeof(C));

f2.close();

//CALCULATING NO. OF DAYS THE CUSTOMER OCCUPIED THE ROOM

//AND PRINTING THE TARIFF

long tariff;

int dd1,dd2,mm1,mm2,yy1,yy2,p,q,r;

dd1=(d.date[0]-48)*10+(d.date[1]-48);

dd2=(od[0]-48)*10+(od[1]-48);

mm1=(d.date[3]-48)*10+(d.date[4]-48);

mm2=(od[3]-48)*10+(od[4]-48);

yy1=(d.date[6]-48)*1000+(d.date[7]-48)*100+(d.date[8]-48)*10+(d.date[9]-
48);

yy2=(od[6]-48)*1000+(od[7]-48)*100+(od[8]-48)*10+(od[9]-48);
16 | P a g e
if(yy1%4==0) { p=29; q=28; }

else if(yy2%4==0) { p=28; q=29; }

else { p=28; q=28; }

int cy[12]={ 31,p,31,30,31,30,31,31,30,31,30,31 };

int ny[12]={ 31,q,31,30,31,30,31,31,30,31,30,31 };

if(yy1==yy2 && mm1==mm2 && dd1==dd2) tariff=d.charge;

else

if(yy1==yy2)

if(mm1==mm2) tariff=d.charge*(dd2-dd1);

else

r=cy[mm1-1]-dd1+dd2;

for(int l=mm1;l<mm2-1;l++) r+=cy[l];

tariff=d.charge*r;

else

r=cy[mm1-1]-dd1+dd2;

for(int l=mm1;l<12;l++) r+=cy[l];

for(l=0;l<mm2-1;l++) r+=ny[l];

tariff=d.charge*r;

17 | P a g e
int c1,c2;

c1=(ot[0]-48)*10+(ot[1]-48);

c2=(ot[3]-48)*10+(ot[4]-48);

if(yy1==yy2 && mm1==mm2 && dd1==dd2);

else if(c1>12) tariff+=d.charge;

else if(c1==12 && c2>0) tariff+=d.charge;

cout<<" TARIFF :: Rs "<<tariff<<'

';

f1.close();

//SHOWING THE CUSTOMER'S RESTAURANT AND BAR BILL

f8.open("BILL.DAT",ios::in|ios::binary);

f8.read((char *)&b,sizeof(b));

cout<<" RESTAURANT CHARGE :: Rs "<<b[rn-1].brestaurant<<'

'

<<" BAR CHARGE :: Rs "<<b[rn-1].bbar<<'

'

<<" TOTAL :: Rs "<<b[rn-1].brestaurant+b[rn-


1].bbar+tariff;

b[rn-1].bbar=b[rn-1].brestaurant=0;

f8.close();

f8.open("BILL.DAT",ios::out|ios::binary);

f8.write((char *)&b,sizeof(b));

f8.close();

//DELETING THE RECORD OF THE CUSTOMER

f1.open("HOT.EL",ios::in|ios::binary);

e.open("F.DAT",ios::out|ios::binary);

f1.read((char *)&d,sizeof(d));
18 | P a g e
while(f1)

if(d.roomno!=rn)

e.write((char *)&d,sizeof(d));

f1.read((char *)&d,sizeof(d));

else f1.read((char *)&d,sizeof(d));

e.close();

f1.close();

f1.open("HOT.EL",ios::out|ios::binary);

e.open("F.DAT",ios::in|ios::binary);

e.read((char *)&d,sizeof(d));

while(e)

f1.write((char *)&d,sizeof(d));

e.read((char *)&d,sizeof(d));

e.close();

f1.close();

//MAKING THE ROOM OCCUPIED BY THE CUSTOMER AS UNOCCUPIED

f.open("ARRAY.DAT",ios::in|ios::binary);

f.read((char *)&array,sizeof(array));

array[rn-1]='e';

f.close();

19 | P a g e
f.open("ARRAY.DAT",ios::out|ios::binary);

f.write((char *)&array,sizeof(array));

f.close();

gotoxy(25,25);

cout<<"PRESS ANY KEY TO CONTINUE";

getch();

clrscr();

void HOTEL::cancellation()

textcolor(1);

clrscr();

int rn;

cout<<"ROOM NUMBER :: ";

cin>>rn;

f1.open("HOT.EL",ios::in|ios::binary);

do f1.read((char*)&d,sizeof(d)); while(d.roomno!=rn);

cout<<"NAME :: "<<d.name<<"

"

<<"ADDRESS(R) :: "<<d.address<<"

"

<<"TEL. NO.(R) :: "<<d.telno<<"

"

<<"ROOM TYPE :: "<<d.roomtype<<"

"

20 | P a g e
<<"CANCELLED

";

//COPYING THE RECORD OF THE CUSTOMER INTO ANOTHER FILE

f3.open("CAN.CEL",ios::app|ios::binary);

strcpy(D.name,d.name);

strcpy(D.address,d.address);

strcpy(D.telno,d.telno);

f3.write((char *)&D,sizeof(D));

f3.close();

f1.close();

//MAKING THE ROOM ALLOTED TO THE CUSTOMER AS EMPTY

f.open("ARRAY.DAT",ios::in|ios::binary);

f.read((char *)&array,sizeof(array));

array[rn-1]='e';

f.close();

f.open("ARRAY.DAT",ios::out|ios::binary);

f.write((char *)&array,sizeof(array));

f.close();

fstream e;

//DELETING THE RECORD OF THE CUSTOMER

f1.open("HOT.EL",ios::in|ios::binary);

e.open("F1.DAT",ios::out|ios::binary);

f1.read((char *)&d,sizeof(d));

while(f1)

if(d.roomno!=rn)

21 | P a g e
{

e.write((char *)&d,sizeof(d));

f1.read((char *)&d,sizeof(d));

else f1.read((char *)&d,sizeof(d));

e.close();

f1.close();

f1.open("HOT.EL",ios::out|ios::binary);

e.open("F1.DAT",ios::in|ios::binary);

e.read((char *)&d,sizeof(d));

while(e)

f1.write((char *)&d,sizeof(d));

e.read((char *)&d,sizeof(d));

e.close();

f1.close();

gotoxy(25,25);

cout<<"PRESS ANY KEY TO CONTINUE";

getch();

clrscr();

void HOTEL::taxi_service()

int gd=DETECT,gm,choice;

22 | P a g e
initgraph(&gd,&gm,"c:\tc\bgi");

settextstyle(10,0,1);

int x=40,y=10;

setcolor(BROWN);

outtextxy(50,20,"I am staying in this hotel");

outtextxy(x,y,".");

setcolor(CYAN);

outtextxy(50,60,"I am not staying in this hotel");

char W;

int count=0;

do

count++;

W=getch();

23 | P a g e

You might also like