Computer Project Hotel Managenent System: Name: Class: Xii Rollno
Computer Project Hotel Managenent System: Name: Class: Xii Rollno
Project
Hotel Managenent System
NAME :
CLASS : XII
ROLLNO :
CERTIFICATE
This
is
to
certify
that
topic
Hotel
Management
towards
curriculum
Secondary
submitted
of
partial
Central
fullment
of
Board
of
Education(CBSE)
satisfactory
and
report
as
ACKNOWLEDGEMENT
I would like to express my sincere
gratitude to my computer teacher
Mrs. Vidhi Arora Hasija for her
vital
support,
guidance
and
encouragement to complete my
project on time. she also guided me to
complete the investigatory project
step by step on
topic Hotel
Management System. I also thanks to
our
honorable
principal
Dr.R.K.VERMA
sir who provided
laboratory due to which we can
performed experiment and do result
on our project.
output streams
conio.h:- to stop the output and
screen after completion
string.h: - for string and character
time.h:-
for
showing
date
and
time,
graphic.h:output
File Generated
hotel.cpp
hotel.bak
hotel.dat
WORKING
DESCRIPTION
This
project is based on the
working of a hotel management
system.When we check in a hotel
the formality we do by filling
certain details such as owr
SOURCE CODE
#include<iostream.h>
#include<conio.h>
#include<string.h>
#include <time.h>
#include<graphics.h>
#include<process.h>
#include<fstream.h>
int trap=0;
struct logindata // please note the password :
bho
{
char username[10];
char password[10];
};
void login();
void coupd();
void coup();
void gen();
void dlx();
void spd();
void login()
{
clrscr() ;
char pass1, pass2, pass3 ;
gotoxy(30,12) ;
cout<<"Enter the password : " ;
pass1=getch() ;
cout<<"#" ;
pass2=getch() ;
cout<<"#" ;
pass3=getch() ;
cout<<"#" ;
getch();
if (pass1 == 'b' && pass2 == 'h' && pass3
== 'o')
{
return;
}
clrscr();
gotoxy(30,12) ;
cout<<" WRONG PASSWORD " ;
gotoxy(2,1) ;
getch() ;
exit(0) ;
}
class room
{
protected:
int r_no;
int r_charge;
char r_cust[20];
char c_city[20];
int c_mem;
char c_nat[20];
char r_avail;
int r_per;
int no;
char type[20];
int charge;
char cust[20];
char avail;
int per;
int year;
int mon;
int day;
public:
char r_type[20];
char getavail()
{
return(r_avail);
}
void getr1()
{
r_no=1;
strcpy(r_type,"Sp Dlx");
r_charge=1600;
r_avail='Y';
strcpy(r_cust,"N.A");
r_per=0;
}
void getr2()
{
r_no=2;
strcpy(r_type,"Dlx");
r_charge=1250;
r_avail='Y';
strcpy(r_cust,"N.A");
r_per=0;
}
void getr3()
{
r_no=3;
strcpy(r_type,"Gen");
r_charge=1100;
r_avail='Y';
strcpy(r_cust,"N.A");
r_per=0;
}
void getr4()
{
r_no=4;
strcpy(r_type,"Coupl");
r_charge=1850;
r_avail='Y';
strcpy(r_cust,"N.A");
r_per=0;
}
void getr5()
{
r_no=5;
strcpy(r_type,"C Dlx");
r_charge=2200;
r_avail='Y';
strcpy(r_cust,"N.A");
r_per=0;
}
void putinfo()
{
cout<<"\n"<<r_no<<"\t
"<<r_type<<"\t
"<<r_charge<<"\t
"<<r_avail<<"\t
"<<r_cust<<"\t "<<r_per;
}
void modify()
{
cout<<"\n Enter modifyied data";
cout<<"\n____________________________________
________________________________________";
cout<<"\n Enter Room no :";
cin>>no;
cout<<"\n Enter Room type :";
cin>>type;
cout<<"\n Enter Room charges :";
cin>>charge;
cout<<"\n Enter Room Availability :";
cin>>avail;
cout<<"\n Enter name of customer living :";
cin>>cust;
cout<<"\n For how many days customer want
the room :";
cin>>per;
cout<<"\n...... Data is modified";
r_no=no;
strcpy(r_type,type);
r_charge=charge;
r_avail=avail;
strcpy(r_cust,cust);
r_per=per;
}
void allocate()
{
if(r_avail=='Y')
{
cout<<"\n Enter Name of customer living :";
cin >>cust;
cout<<"\n For how many days customer want
the room :";
cin>>per;
cout<<"\n Enter city name :";
cin>>c_city;
cout<<"\n Enter nationality :";
cin>>c_nat;
cout<<"\n Enter no. of member in your
group :";
cin>>c_mem;
cout<<"\n Enter the date of arrival ";
cout<<"\n------------------------------";
cout<<"\n Year : ";
cin >>year;
cout<<"\n Month :";
cin >>mon;
cout<<"\n Day :";
cin >>day;
cout<<"\n...
Room
is
allocated
"<<cust<<" for "<<per<<" days.";
to
strcpy(r_cust,cust);
r_per=per;
r_avail='N';
}
else
{
cout<<"\n ERROR : Room cannot be allocated
...";
cout<<"\n Room is not available...";
}
}
void putcust()
{
int i,j;
i=day+r_per;
j=strcmp(r_cust,"N.A");
if(j==0)
{
cout<<"\n Data is not available ";
}
else
{
cout<<"\n Room No
:"<<r_no;
:"<<r_per;
:"<<c_city;
:"<<c_nat;
}
}
friend void date(int d,int m,int y);
}
friend void date(int
date(int d,int m,int y)
{
int i;
i=m%12;
if(i==0)
{
if(d>31)
{
d=d-31;
m=m+1;
}
if(m>12)
{
m=m-12;
y=y+1;
d,int
m,int
y);
void
}
cout<<"\n
Date :"<<d<<"/"<<m<<"/"<<y;
Departure
}
else
if(i==1)
{
if(d>31)
{
d=d-31;
m=m+1;
}
if(m>12)
{
m=m-12;
y=y+1;
}
cout<<"\n
Date :"<<d<<"/"<<m<<"/"<<y;
Departure
}
else
if(i==2)
{
if(d>30)
{
d=d-30;
m=m+1;
}
if(m>12)
{
m=m-12;
y=y+1;
}
cout<<"\n
Date :"<<d<<"/"<<m<<"/"<<y;
}
else
if(i==3)
Departure
{
if(d>31)
{
d=d-31;
m=m+1;
}
if(m>12)
{
m=m-12;
y=y+1;
}
cout<<"\n
Date :"<<d<<"/"<<m<<"/"<<y;
}
else
if(i==4)
{
if(d>30)
Departure
{
d=d-30;
m=m+1;
}
if(m>12)
{
m=m-12;
y=y+1;
}
cout<<"\n
Date :"<<d<<"/"<<m<<"/"<<y;
}
else
if(i==5)
{
if(d>31)
{
d=d-31;
m=m+1;
Departure
}
if(m>12)
{
m=m-12;
y=y+1;
}
cout<<"\n
Date :"<<d<<"/"<<m<<"/"<<y;
}
else
if(i==6)
{
if(d>30)
{
d=d-30;
m=m+1;
}
if(m>12)
{
Departure
m=m-12;
y=y+1;
}
cout<<"\n
Date :"<<d<<"/"<<m<<"/"<<y;
}
else
if(i==7)
{
if(d>31)
{
d=d-31;
m=m+1;
}
if(m>12)
{
m=m-12;
y=y+1;
}
Departure
cout<<"\n
Date :"<<d<<"/"<<m<<"/"<<y;
Departure
}
else
if(i==8)
{
if(d>31)
{
d=d-31;
m=m+1;
}
if(m>12)
{
m=m-12;
y=y+1;
}
cout<<"\n
Date :"<<d<<"/"<<m<<"/"<<y;
}
else
Departure
if(i==9)
{
if(d>30)
{
d=d-30;
m=m+1;
}
if(m>12)
{
m=m-12;
y=y+1;
}
cout<<"\n
Date :"<<d<<"/"<<m<<"/"<<y;
}
else
if(i==10)
{
if(d>31)
{
Departure
d=d-31;
m=m+1;
}
if(m>12)
{
m=m-12;
y=y+1;
}
cout<<"\n
Date :"<<d<<"/"<<m<<"/"<<y;
}
else
if(i==11)
{
if(d>30)
{
d=d-30;
m=m+1;
}
if(m>12)
Departure
{
m=m-12;
y=y+1;
}
cout<<"\n
Date :"<<d<<"/"<<m<<"/"<<y;
}
}
class bill: public room
{
private:
long total;
int food;
long room;
float ser;
int t;
int oc;
public:
Departure
void calculate()
{
room= r_charge * r_per;
cout<<"\n
Enter
restaurant:";
the
bill
amount
of
cin>>food;
cout<<"\n Enter other charges:";
cin>>oc;
t=(int) room + food + oc;
ser=(int)(0.103*t);
total=t+ser;
}
void dispbill()
{
clrscr();
cout<<"\n____________________________________
____________________________________________";
cout<<"\n*************************
Hotel
Management System ***********************";
cout<<"\n
______________________________________________
___________________________
";
cout<<"\n";
cout<<"\n";
cout<<"\n-------------------------------------------------------------------------------";
cout<<"\n
cout<<"\n____________________________________
____________________________________________ ";
cout<<"\n
cout<<"\n
Room charges
"<<r_charge<<"(Per day)";
cout<<"\n
Room charges
"<<room<<"(total)";
cout<<"\n
cout<<"\n
cout<<"\n
14.3%";
cout<<"\n
cout<<"\n
"<<total;
Ser.tax % =
Ser.tax ="<<ser;
Bill Amount >>>>>> Rs
cout<<"\n
";
cout<<"\n
cout<<"\n
strcpy(r_cust,"N.A");
r_per=0;
r_avail='y';
day=0;
mon=0;
year=0;
strcpy(c_city,"N.A ");
strcpy(c_nat,"N.A ");
c_mem = 0;
}
void check();
};
void bill:: check()
{
if(r_avail=='y')
{
cout<<"\n"<<r_no<<"\t
"<<r_type<<"\t"<<r_charge<<"\t
"<<r_avail<<"\t
"<<r_cust<<"\t
"<<r_per;
}
}
void main()
{
int i,ch;
login();
bill R[5];
char c;
clrscr();
getch();
clrscr();
R[0].getr1();
R[1].getr2();
R[2].getr3();
R[3].getr4();
R[4].getr5();
time_t t;
clrscr();
t = time(NULL);
cout<<"\n
"<<ctime(&t);
t -= 24L*60L*60L;
cout<<"\n-------------------------------------------------------------------------------";
cout<<"\n-------------------------------------------------------------------------------";
cout<<"\n******************** WELCOME TO
HOTEL
MANAGEMENT
SYSTEM
************************";
cout<<"\n-------------------------------------------------------------------------------";
cout<<"\n-------------------------------------------------------------------------------";
gotoxy(35,35);
cout<<"Submitted By:";
gotoxy(35,37);
cout<<"Bhoomesh
Chandola,Keertiman
Chandola,Aman Jain,Abhishek Singh";
gotoxy(5,37);
cout<<"\nGuided By:-";
gotoxy(5,35
);
cout<<"Vidhi mam";
getch();
xyz:
clrscr();
cout<<"\n-------------------------------------------------------------------------------";
cout<<"\n********************
Management
**************************";
Hotel
System
cout<<"\n
________________________________
";
cout<<"\n
";
cout<<"\n
";
cout<<"\n-------------------------------------------------------------------------------";
cout<<"\n
";
cout<<"\n
1.ROOM
2.CUSTOMER INFO
";
INFORMATION
cout<<"\n
";
cout<<"\n
3.MODIFY
4.CHECK THE AVAILABILITY
INFORMATION
";
cout<<"\n
";
cout<<"\n
5.RESERVE
6.FEATURES OF ROOMS
ROOM
";
cout<<"\n
";
cout<<"\n
8.EXIT
7.CREATE
";
BILL
if(ch>8)
{
clrscr();
cout<<"\n Wrong choice ....";
getch();
goto xyz;
}
if(ch==1)
{
clrscr();
cout<<"\n
";
ROOM INFO
cout<<"\n
";
-----------
}
getch();
clrscr();
cout<<"\n
";
cout<<"\n-------------------------------------------------------------------------------";
cout<<"\n Do you want to exit :";
cin>>c;
if (c=='n')
{
goto xyz;
}
else
{
goto mno;
}
}
else
if(ch==2)
{
abc:
clrscr();
int n;
cout<<"\n Enter room no. :";
cin>>n;
if(n>5)
{
cout<<"\n Wrong choice ....";
getch();
goto abc;
}
n=n-1;
clrscr();
cout<<"\n
";
CUSTOMER INFO
cout<<"\n
";
--------------
R[n].putcust();
getch();
clrscr();
cout<<"\n
";
cout<<"\n-------------------------------------------------------------------------------";
cout<<"\n Do you want to exit :";
cin>>c;
if (c=='n')
{
goto xyz;
}
else
{
goto mno;
}
}
else
if(ch==3)
{
pqr:
clrscr();
int a;
cout<<"\n Enter Room no :";
cin>>a;
if(a>5)
{
cout<<"\n Wrong choice ...";
getch();
goto pqr;
}
a=a-1;
R[a].modify();
getch();
clrscr();
cout<<"\n
";
cout<<"\n-------------------------------------------------------------------------------";
cout<<"\n Do you want to exit :";
cin>>c;
if (c=='n')
{
goto xyz;
}
else
{
goto mno;
}
}
else
if(ch==4)
{
clrscr();
cout<<"\n
ROOMS
AVAILABLE
";
cout<<"\n
";
-----------------
for(i=0;i<=4;i++)
{
R[i].check();
}
getch();
clrscr();
cout<<"\n
";
cout<<"\n-------------------------------------------------------------------------------";
cout<<"\n Do you want to exit :";
cin>>c;
if (c=='n')
{
goto xyz;
}
Else
{
goto mno;
}
}
else
if(ch==5)
{
int b;
def:
clrscr();
cout<<"\n Enter room no to be allocated:";
cin >>b;
if(b>5)
{
cout<<"\n Wrong choice ...";
getch();
goto def;
}
b=b-1;
R[b].allocate();
getch();
clrscr();
cout<<"\n
";
cout<<"\n-------------------------------------------------------------------------------";
cout<<"\n Do you want to exit :";
cin>>c;
if (c=='n')
{
goto xyz;
}
else
{
goto mno;
}
}
else
if(ch==6)
{
ghi:
clrscr();
int a,d,e,f,g,h;
char c;
char b[5];
cout<<"\n Enter Room No:";
cin>>a;
if(a>5)
{
cout<<"\n Wrong choice ...";
getch();
goto ghi;
}
a=a-1;
strcpy(b,R[a].r_type);
d=stricmp(b,"Sp Dlx");
e=stricmp(b,"Dlx");
f=stricmp(b,"Gen");
g=stricmp(b,"Coupl");
h=stricmp(b,"C Dlx");
if(d==0)
{
spd();
}
else
if(e==0)
{
dlx();
}
else
if(f==0)
{
gen();
}
else
if(g==0)
{
coupd();
}
else
if(h==0)
{
coup();
}
getch();
clrscr();
cout<<"\n
";
cout<<"\n-------------------------------------------------------------------------------";
cout<<"\n Do you want to exit :";
cin>>c;
if (c=='n')
{
goto xyz;
}
}
else
if(ch==7)
{
stu:
clrscr();
int b;
cout<<"\n Enter Room no :";
cin>>b;
if(b>5)
{
cout<<"\n Wrong choice ...";
getch();
goto stu;
}
{
char av;
av=R[b-1].getavail();
if(av=='y')
{
cout<<"\n ERROR: Room is not allocated.";
cout<<"\n Bill cannot be created ";
getch();
goto stu;
}
else
{
R[b-1].calculate();
R[b-1].dispbill();
getch();
}
}
clrscr();
cout<<"\n
";
cout<<"\n-------------------------------------------------------------------------------";
cout<<"\n Do you want to exit :";
cin>>c;
if (c=='n')
{
goto xyz;
}
}
else
if(ch==8)
{
goto mno;
}
mno:
}
void spd()
{
clrscr();
cout<<"\n
ROOM
FEATURES OF THIS
";
cout<<"\n-----------------------------------------------------------------";
cout<<"\n\n Room Type
";
>>> Sp.delux
>>> Rs.1600
cout<<"\n\n 1. Bed
>>>
3";
cout<<"\n\n 2.Capacity
>>>
4";
";
cout<<"\n-----------------------------------------------------------------";
cout<<"\n
FEATURES
ADDITIONAL
";
cout<<"\n-----------------------------------------------------------------";
cout<<"\n\n 1.A/C available ";
cout<<"\n\n 2.Geyser available";
cout<<"\n\n 3.TV available
";
cout<<"\n-----------------------------------------------------------------";
cout<<"\n NOTE :- Extra bed will cost Rs.50
per bed ";
}
void dlx()
{
clrscr();
cout<<"\n
ROOM
FEATURES OF THIS
";
cout<<"\n------------------------------------------------------------------";
cout<<"\n\n Room Type
";
>>> Delux
>>>Rs.1100
>>>
cout<<"\n\n 2.Capacity
>>>
5";
6";
cout<<"\n------------------------------------------------------------------";
cout<<"\n
";
ADDITIONAL FEATURES
cout<<"\n------------------------------------------------------------------";
cout<<"\n\n 1.A/C avaalable ";
cout<<"\n\n 3.Geyser available";
cout<<"\n\n 4.TV available
";
cout<<"\n------------------------------------------------------------------";
cout<<"\n NOTE :- Extra bed will cost Rs.50
per bed ";
}
void gen()
{
clrscr();
cout<<"\n
ROOM
FEATURES OF THIS
";
cout<<"\n-----------------------------------------------------------------";
cout<<"\n\n Room Type
";
>>> General
>>>Rs.1100
>>>
cout<<"\n\n 2.Capacity
5";
>>>
6";
cout<<"\n-----------------------------------------------------------------";
cout<<"\n
FEATURES
ADDITIONAL
";
cout<<"\n-----------------------------------------------------------------";
cout<<"\n\n 1.Geyser available";
cout<<"\n-----------------------------------------------------------------";
cout<<"\n NOTE :- Extra bed will cost Rs.50
per bed ";
}
void coup()
{
clrscr();
cout<<"\n
ROOM
FEATURES OF THIS
";
cout<<"\n-----------------------------------------------------------------";
cout<<"\n\n Room Type
";
>>> Couple
>>>Rs.1850
cout<<"\n\n 1. Bed
cout<<"\n\n 2. Capacity
>>>
2";
>>>
";
3";
cout<<"\n-----------------------------------------------------------------";
cout<<"\n
";
ADDITIONAL FEATURES
cout<<"\n-----------------------------------------------------------------";
cout<<"\n\n 2.Geyser available";
cout<<"\n\n 3.TV available
";
cout<<"\n-----------------------------------------------------------------";
cout<<"\n NOTE :- Extra bed will cost Rs.50
per bed ";
}
void coupd()
{
clrscr();
cout<<"\n
ROOM
FEATURES OF THIS
";
cout<<"\n-----------------------------------------------------------------";
>>> Couple
>>>
>>>
cout<<"\n\n 2.Capacity
1";
>>>
2";
";
cout<<"\n-----------------------------------------------------------------";
cout<<"\n
FEATURES
ADDITIONAL
";
cout<<"\n-----------------------------------------------------------------";
cout<<"\n\n 1.A/C available ";
cout<<"\n\n 2.Geyser available";
cout<<"\n\n 3.TV available
";
cout<<"\n-----------------------------------------------------------------";
cout<<"\n NOTE :- Extra bed will cost Rs.50
per bed ";
}
Home page
Room information
Reserve room
Modification of data
Create bill
If bill is paid
LIMITATION
S
1.Duplication of data
2.Bills payment can create
problem at the time of
departure
Bibliography
1.Wikipedia
2.Our text book
Arora.
3.my C.B.S.E.com
4.C.B.S.E portal .com
5.C++project.com
Sumita