Professional Documents
Culture Documents
Oop Term Paper
Oop Term Paper
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
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.
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.
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.
Restaurant:
Hotel Reports:
All kinds of hotel reports can be generated in seconds and you can view and print
them easily.
• Day books
• Laundry report.
• Cash record.
Account Master
Heads:
• The hotel management software includes all principal heads of commercial field.
Accounting Reports:
• 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:-
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;
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:-
Software Compatibility:-
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
# 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;
//**********************************************************
// 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;
//**********************************************************
//**********************************************************
void HOTEL::booking ()
textcolor(2);
clrscr();
int c=0;
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;
10 | P a g e
"
<<"NAME :: ";
gets(d.name);
int l=strlen(d.name);
cout<<"ADDRESS(R) :: ";
gets(d.address);
gets(d.telno);
gets(d.date);
cout<<"
"
"
"
"
"
";
11 | P a g e
int roomcode;
REDO:
cin>>roomcode;
switch(roomcode)
d.charge=20000;
break;
d.charge=15000;
break;
case 3 : strcpy(d.roomtype,"DELUXE");
d.charge=10000;
break;
d.charge=5000;
break;
d.charge=2000;
break;
";
goto REDO;
clrscr();
12 | P a g e
cout<<"YOUR ROOM NO. IS :: "<<d.roomno<<"
";
gotoxy(25,25);
getch();
f1.write((char *)&d,sizeof(d));
f1.close();
clrscr();
void HOTEL::check_in()
textcolor(12);
clrscr();
int rn;
char ans;
cin>>ans;
if(ans=='n'||ans=='N')
gotoxy(25,25);
getch();
booking();
13 | P a g e
clrscr();
cin>>rn;
f1.open("HOT.EL",ios::in|ios::binary);
cout<<"NAME :: "<<d.name<<"
"
<<"ADDRESS(R) :: "<<d.address<<"
"
"
"
gotoxy(25,25);
getch();
f1.close();
clrscr();
void HOTEL::check_out()
textcolor(10);
clrscr();
int rn;
14 | P a g e
cin>>rn;
char od[11],ot[6];
gets(od);
gets(ot);
textcolor(6);
clrscr();
fstream e;
f1.open("HOT.EL",ios::in|ios::binary);
";
cout<<endl;
"
"
"
"
"
15 | P a g e
"
"
";
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();
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(yy1==yy2)
if(mm1==mm2) tariff=d.charge*(dd2-dd1);
else
r=cy[mm1-1]-dd1+dd2;
tariff=d.charge*r;
else
r=cy[mm1-1]-dd1+dd2;
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);
';
f1.close();
f8.open("BILL.DAT",ios::in|ios::binary);
f8.read((char *)&b,sizeof(b));
'
'
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();
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));
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();
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);
getch();
clrscr();
void HOTEL::cancellation()
textcolor(1);
clrscr();
int rn;
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<<"
"
"
"
20 | P a g e
<<"CANCELLED
";
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();
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;
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));
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);
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(x,y,".");
setcolor(CYAN);
char W;
int count=0;
do
count++;
W=getch();
23 | P a g e