Академический Документы
Профессиональный Документы
Культура Документы
TABLE OF
CONTENTS
Certificate
Acknowledgement
Introduction
Header Files And Their
Purpose
Coding
Output
1
PROJECT ON HOTEL MANAGEMENT SYSTEM
CERTIFICATE
This is to certify that this project report
entitled “HOTEL MANAGEMENT SYSTEM
IN C++ LANGUAGE” Submitted to
VIRENDRA PUBLIC SCHOOL is a bonafide
record of work done by “Aayush Kumar”
under the supervision of “MRS. Amrita
Dass”.
2
PROJECT ON HOTEL MANAGEMENT SYSTEM
ACKNOWLEDGEMENT
In the accomplishment of this project
successfully, many people have best owned
upon me their blessings and the heart
pledged upon, this time I am utilising to
thank all the people who have been
concerned with project.
Primarily I would thank god for being able to
complete this project with success. Then I
would like to thank my principal Mrs. Rama
Malhotra and computer teacher Mrs.
Amrita, whose valuable guidance has been
the ones that helped me patch this project
and make it full proof success her
suggestions and her instructions has served
as a major contributor towards the
completion of the project.
3
PROJECT ON HOTEL MANAGEMENT SYSTEM
4
PROJECT ON HOTEL MANAGEMENT SYSTEM
INTRODUCTION
A hotel is an establishment that provides
lodging paid on a short-term basis. Facilities
provided may range from a basic bed and
storage for clothing, to luxury features like
en-suite bathrooms. Larger hotels may
provide additional guest facilities such as a
swimming pool, business center, childcare,
conference facilities and social function
services. Hotel rooms are usually numbered
(or named in some smaller hotels and B&BS)
to allow guests to identify their room. Some
hotels offer meals as part of a room and
board arrangement. In the United Kingdom,
a hotel is required by law to serve food and
drinks to all guests within certain stated
hours. In Japan, capsule hotels provide a
5
PROJECT ON HOTEL MANAGEMENT SYSTEM
6
PROJECT ON HOTEL MANAGEMENT SYSTEM
HEADER FILES
USED
#include<fstream.h>
#include<conio.h>
#include<dos.h>
#include<string.h>
#include<process.h>
#include<stdlib.h>
#include<stdio.h>
#include<ctype.h>
7
PROJECT ON HOTEL MANAGEMENT SYSTEM
CODING
#include<fstream.h>
#include<conio.h>
#include<dos.h>
#include<string.h>
#include<process.h>
#include<stdlib.h>
#include<stdio.h>
#include<ctype.h>
class menu
private :
void edit_menu(void) ;
void report_menu(void) ;
void room_edit_menu(void) ;
void customer_edit_menu(void) ;
public :
void intro(void) ;
void main_menu(void) ;
void enter_password(void) ;
8
PROJECT ON HOTEL MANAGEMENT SYSTEM
};
class room
private :
int recordno(int) ;
void display_record(int) ;
int roomno ;
float tariff ;
public :
void modify(void) ;
void deletion(void) ;
void display_room_record(void) ;
void display_list(void) ;
void change_status(int,char) ;
char room_status(int) ;
float get_data(int) ;
};
class customer
private :
9
PROJECT ON HOTEL MANAGEMENT SYSTEM
int recordno(int) ;
void display_record(int) ;
void delete_record(int) ;
int roomno ;
public :
void modify(void) ;
void deletion(void) ;
void display_list(void) ;
void display_customer_record(void) ;
};
class account
public :
};
clrscr() ;
gotoxy(30,3) ;
10
PROJECT ON HOTEL MANAGEMENT SYSTEM
cout<<"Welcome to Project" ;
gotoxy(30,5) ;
gotoxy(30,6) ;
gotoxy(15,8) ;
gotoxy(15,9) ;
gotoxy(15,11) ;
gotoxy(15,12) ;
cout<<"records at a time." ;
gotoxy(15,14) ;
gotoxy(15,15) ;
cout<<"explanatory menus." ;
gotoxy(15,17) ;
gotoxy(15,18) ;
cout<<"\t" ;
gotoxy(40,20) ;
11
PROJECT ON HOTEL MANAGEMENT SYSTEM
gotoxy(20,23) ;
getch() ;
main_menu();
clrscr() ;
gotoxy(30,12) ;
pass1=getch() ;
cout<<"*" ;
pass2=getch() ;
cout<<"*" ;
pass3=getch() ;
cout<<"*" ;
getch();
return ;
12
PROJECT ON HOTEL MANAGEMENT SYSTEM
clrscr();
gotoxy(30,12) ;
gotoxy(2,1) ;
getch() ;
exit(0) ;
char ch ;
clrscr();
gotoxy(14,2);
gotoxy(30,5) ;
cout<<"1. INTRODUCTION" ;
gotoxy(30,7) ;
gotoxy(30,9) ;
gotoxy(30,11) ;
gotoxy(30,13) ;
13
PROJECT ON HOTEL MANAGEMENT SYSTEM
gotoxy(30,15) ;
cout<<"6. EDIT" ;
gotoxy(30,17) ;
cout<<"7. REPORT" ;
gotoxy(30,19) ;
gotoxy(55,25) ;
gotoxy(30,21) ;
cin>>ch;
getch();
if ( ch == '1' )
intro() ;
else
if ( ch == '2' )
customer c ;
c.checkin() ;
else
if ( ch == '3' )
14
PROJECT ON HOTEL MANAGEMENT SYSTEM
customer c ;
c.checkout() ;
if ( ch == '4' )
customer c ;
c.display_customer_record() ;
else
if ( ch == '5' )
room r ;
r.display_room_record() ;
else
if ( ch == '6' )
edit_menu() ;
else
if ( ch == '7' )
report_menu() ;
else
if ( ch == '8' )
15
PROJECT ON HOTEL MANAGEMENT SYSTEM
clrscr();
gotoxy(26,10);
getch();
gotoxy(32,12);
getch();
exit(0);
char ch;
while(1)
clrscr() ;
gotoxy(34,4) ;
cout<<" EDIT" ;
gotoxy(30,8) ;
gotoxy(30,10) ;
gotoxy(30,12) ;
16
PROJECT ON HOTEL MANAGEMENT SYSTEM
cout<<"3. BACK" ;
gotoxy(30,15) ;
cin>>ch;
getch() ;
if ( ch == '1' )
room_edit_menu() ;
else
if ( ch == '2' )
customer_edit_menu() ;
else
if ( ch == '3' )
main_menu();
char ch ;
while(1)
clrscr() ;
gotoxy(34,4);
cout<<"EDIT ROOM";
17
PROJECT ON HOTEL MANAGEMENT SYSTEM
gotoxy(30,8) ;
gotoxy(30,10) ;
gotoxy(30,12) ;
gotoxy(30,14) ;
cout<<"4. BACK" ;
gotoxy(30,17) ;
cin>>ch;
getch() ;
if ( ch == '1' )
room r ;
r.add() ;
else
if ( ch == '2' )
room r ;
r. modify() ;
18
PROJECT ON HOTEL MANAGEMENT SYSTEM
else
if ( ch == '3' )
room r ;
r.deletion() ;
else
if ( ch == '4' )
break ;
char ch ;
while(1)
clrscr() ;
gotoxy(34,4);
cout<<"EDIT CUSTOMER";
gotoxy(30,8) ;
gotoxy(30,10) ;
19
PROJECT ON HOTEL MANAGEMENT SYSTEM
gotoxy(30,12) ;
cout<<"3. BACK" ;
gotoxy(30,15) ;
cin>>ch;
getch() ;
if ( ch == '1' )
customer c ;
c.modify() ;
else
if ( ch == '2' )
customer c ;
c.deletion() ;
else
if ( ch == '3' )
break ;
20
PROJECT ON HOTEL MANAGEMENT SYSTEM
char ch ;
while(1)
clrscr() ;
gotoxy(34,4);
cout<<"REPORT";
gotoxy(30,8) ;
gotoxy(30,10) ;
gotoxy(30,12) ;
cout<<"3. BACK" ;
gotoxy(30,15) ;
cin>>ch;
getch() ;
if ( ch == '1' )
room r ;
r.display_list() ;
else
21
PROJECT ON HOTEL MANAGEMENT SYSTEM
if ( ch == '2' )
customer c ;
c.display_list() ;
else
if ( ch == '3' )
main_menu();
break ;
fstream file ;
file.open("ROOM.DAT", ios::in) ;
file.seekg(0) ;
int found = 0 ;
if ( roomno == t_roomno )
found = 1 ;
22
PROJECT ON HOTEL MANAGEMENT SYSTEM
file.close() ;
return found ;
clrscr() ;
fstream file ;
file.open("ROOM.DAT", ios::in) ;
file.seekg(0) ;
gotoxy(18,1) ;
cout<<"LIST OF ROOMS" ;
gotoxy(1,3) ;
delay(50) ;
found = 1 ;
gotoxy(2,row) ;
cout<<roomcode ;
gotoxy(16,row) ;
cout <<roomno ;
23
PROJECT ON HOTEL MANAGEMENT SYSTEM
gotoxy(29,row) ;
cout <<status ;
gotoxy(42,row) ;
cout <<tariff ;
if ( row == 23 )
row = 5 ;
gotoxy(66,1) ;
pageno++ ;
gotoxy(1,25) ;
getch() ;
clrscr() ;
gotoxy(18,1) ;
cout<<"LIST OF ROOMS" ;
gotoxy(1,5) ;
else
row++ ;
if ( !found )
24
PROJECT ON HOTEL MANAGEMENT SYSTEM
gotoxy(1,5) ;
gotoxy(66,1) ;
gotoxy(1,25) ;
getch() ;
file.close () ;
fstream file ;
file.open("ROOM.DAT", ios::in) ;
file.seekg(0) ;
int count = 0 ;
count++ ;
if (t_roomno == roomno)
break ;
25
PROJECT ON HOTEL MANAGEMENT SYSTEM
file.close() ;
return count ;
fstream file ;
file.open("ROOM.DAT", ios::in) ;
file.seekg(0) ;
int found = 0 ;
if (t_roomno == roomno)
found = 1 ;
gotoxy(1,5) ;
gotoxy(1,6) ;
gotoxy(1,7) ;
gotoxy(1,8) ;
26
PROJECT ON HOTEL MANAGEMENT SYSTEM
file.close () ;
clrscr() ;
menu m;
int valid ;
int t_roomno ;
gotoxy(1,3) ;
cin>>t_roomno ;
if (!room_found(t_roomno))
gotoxy(1,25) ; clreol() ;
gotoxy(1,24) ;
gotoxy(1,25) ;
getch() ;
m.main_menu();
clrscr() ;
27
PROJECT ON HOTEL MANAGEMENT SYSTEM
gotoxy(5,3) ;
cout<<"ROOM RECORD" ;
display_record(t_roomno) ;
gotoxy(1,25) ;
getch() ;
m.main_menu();
int recno ;
recno = recordno(t_roomno) ;
fstream file ;
int location ;
file.seekp(location) ;
status = t_status ;
file.close () ;
28
PROJECT ON HOTEL MANAGEMENT SYSTEM
fstream file ;
file.open("ROOM.DAT", ios::in) ;
file.seekg(0) ;
int found = 0 ;
char t_status ;
if (t_roomno == roomno)
found = 1 ;
t_status = status ;
file.close () ;
return t_status ;
fstream file ;
file.open("ROOM.DAT", ios::in) ;
file.seekg(0) ;
float t_tariff ;
29
PROJECT ON HOTEL MANAGEMENT SYSTEM
if (t_roomno == roomno)
t_tariff = tariff ;
break ;
file.close() ;
return t_tariff ;
char ch ;
char t_rcode[5] ;
int t_roomno ;
char t_status ;
float t_tariff ;
do
fstream file ;
clrscr() ;
gotoxy(1,1) ;
30
PROJECT ON HOTEL MANAGEMENT SYSTEM
gotoxy(1,3) ;
cout<<"Code : ";
gotoxy(1,4) ;
gotoxy(1,5) ;
cout<<"Status : " ;
gotoxy(1,6) ;
cout<<"Tariff : " ;
gotoxy(20,11) ;
gotoxy(20,12) ;
gotoxy(20,13) ;
gotoxy(20,14) ;
int valid = 0 ;
do
valid = 1 ;
gotoxy(1,25) ;
31
PROJECT ON HOTEL MANAGEMENT SYSTEM
gotoxy(13,3) ;
cin>>t_rcode ;
strupr(t_rcode) ;
result = strcmpi(t_rcode,string[i]) ;
if ( result != 0 )
count++ ;
if ( count == 4 )
valid = 0 ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,24) ;
cout<<"INVALID CODE" ;
gotoxy(1,25) ;
getch() ;
gotoxy(1,24) ; clreol() ;
gotoxy(1,25) ; clreol() ;
gotoxy(13,3) ; clreol() ;
32
PROJECT ON HOTEL MANAGEMENT SYSTEM
} while ( valid == 0 ) ;
gotoxy(1,i) ; clreol() ;
do
valid = 1 ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,25) ;
gotoxy(13,4) ;
cin>>t_roomno ;
getch();
valid = 0 ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,24) ;
gotoxy(1,25) ;
33
PROJECT ON HOTEL MANAGEMENT SYSTEM
getch() ;
gotoxy(1,24) ; clreol() ;
gotoxy(1,25) ; clreol() ;
gotoxy(13,4) ; clreol() ;
if ( room_found( t_roomno ) )
valid = 0 ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,24) ;
gotoxy(1,25) ;
getch() ;
gotoxy(1,24) ; clreol() ;
gotoxy(1,25) ; clreol() ;
gotoxy(13,4) ; clreol() ;
} while ( !valid ) ;
do
valid = 1 ;
gotoxy(1,25) ; clreol() ;
34
PROJECT ON HOTEL MANAGEMENT SYSTEM
gotoxy(1,25) ;
gotoxy(13,5) ;
cin>>t_status ;
t_status = toupper(t_status) ;
valid = 0 ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,24) ;
gotoxy(1,25) ;
getch() ;
gotoxy(1,24) ; clreol() ;
gotoxy(1,25) ; clreol() ;
gotoxy(13,5) ; clreol() ;
} while ( !valid ) ;
do
valid = 1 ;
gotoxy(1,25) ; clreol() ;
35
PROJECT ON HOTEL MANAGEMENT SYSTEM
gotoxy(1,25) ;
gotoxy(13,6) ;
cin>>t_tariff ;
getch();
if ( t_tariff <= 0 )
valid = 0 ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,24) ;
gotoxy(1,25) ;
getch() ;
gotoxy(1,24) ; clreol() ;
gotoxy(1,25) ; clreol() ;
gotoxy(13,6) ; clreol() ;
} while ( !valid ) ;
gotoxy(1,8) ;
do
36
PROJECT ON HOTEL MANAGEMENT SYSTEM
valid = 1 ;
gotoxy(42,8) ;
cin>>ch;
getch() ;
ch = toupper(ch) ;
valid = 0 ;
gotoxy(42,8) ; clreol() ;
} while ( !valid ) ;
if (ch == 'Y')
strcpy(roomcode,t_rcode) ;
roomno = t_roomno ;
status = t_status ;
tariff = t_tariff ;
gotoxy(1,9) ;
do
37
PROJECT ON HOTEL MANAGEMENT SYSTEM
valid = 1 ;
gotoxy(42,9) ;
cin>>ch;
getch() ;
ch = toupper(ch) ;
valid = 0 ;
gotoxy(42,9) ; clreol() ;
} while ( !valid ) ;
file.close () ;
} while ( ch == 'Y') ;
clrscr() ;
int valid ;
char ch ;
char t_rcode[5] ;
int t_roomno , tr ;
char t_status ;
float t_tariff ;
38
PROJECT ON HOTEL MANAGEMENT SYSTEM
fstream file ;
gotoxy(1,3) ;
cin>>tr ;
getch();
if ( !room_found( tr ) )
gotoxy(1,25) ; clreol() ;
gotoxy(1,24) ;
gotoxy(1,25) ;
getch() ;
return ;
display_record(tr) ;
gotoxy(1,10) ;
do
valid = 1 ;
gotoxy(48,10) ;
39
PROJECT ON HOTEL MANAGEMENT SYSTEM
cin>>ch;
getch() ;
ch = toupper(ch) ;
valid = 0 ;
gotoxy(42,9) ; clreol() ;
} while ( !valid ) ;
if (ch == 'N')
return ;
gotoxy(1,12) ;
gotoxy(1,14) ;
cout<<"Code : ";
gotoxy(1,15) ;
gotoxy(1,16) ;
cout<<"Status : " ;
gotoxy(1,17) ;
cout<<"Tariff : " ;
do
40
PROJECT ON HOTEL MANAGEMENT SYSTEM
valid = 1 ;
gotoxy(1,25) ;
gotoxy(13,14) ;
cin>>t_rcode ;
getch();
strupr(t_rcode) ;
result = strcmpi(t_rcode,string[i]) ;
if ( result != 0 )
count++ ;
if ( count == 4 )
valid = 0 ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,24) ;
cout<<"INVALID CODE" ;
gotoxy(1,25) ;
41
PROJECT ON HOTEL MANAGEMENT SYSTEM
getch() ;
gotoxy(1,24) ; clreol() ;
gotoxy(1,25) ; clreol() ;
gotoxy(13,14) ; clreol() ;
} while ( valid == 0 ) ;
do
valid = 1 ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,25) ;
gotoxy(13,15) ;
cin>>t_roomno ;
getch();
valid = 0 ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,24) ;
gotoxy(1,25) ;
42
PROJECT ON HOTEL MANAGEMENT SYSTEM
getch() ;
gotoxy(1,24) ; clreol() ;
gotoxy(1,25) ; clreol() ;
gotoxy(13,15) ; clreol() ;
valid = 0 ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,24) ;
gotoxy(1,25) ;
getch() ;
gotoxy(1,24) ; clreol() ;
gotoxy(1,25) ; clreol() ;
gotoxy(13,15) ; clreol() ;
} while ( !valid ) ;
do
valid = 1 ;
gotoxy(1,25) ; clreol() ;
43
PROJECT ON HOTEL MANAGEMENT SYSTEM
gotoxy(1,25) ;
gotoxy(13,16) ;
cin>>t_status ;
getch();
t_status = toupper(t_status) ;
valid = 0 ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,24) ;
gotoxy(1,25) ;
getch() ;
gotoxy(1,24) ; clreol() ;
gotoxy(1,25) ; clreol() ;
gotoxy(13,16) ; clreol() ;
} while ( !valid ) ;
do
valid = 1 ;
44
PROJECT ON HOTEL MANAGEMENT SYSTEM
gotoxy(1,25) ; clreol() ;
gotoxy(1,25) ;
gotoxy(13,17) ;
cin>>t_tariff ;
getch();
if ( t_tariff <= 0 )
valid = 0 ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,24) ;
gotoxy(1,25) ;
getch() ;
gotoxy(1,24) ; clreol() ;
gotoxy(1,25) ; clreol() ;
gotoxy(13,17) ; clreol() ;
} while ( !valid ) ;
gotoxy(1,19) ;
do
45
PROJECT ON HOTEL MANAGEMENT SYSTEM
valid = 1 ;
gotoxy(42,19) ;
ch = getch() ;
ch = toupper(ch) ;
valid = 0 ;
gotoxy(42,19) ; clreol() ;
} while ( !valid ) ;
if (ch == 'Y')
int recno ;
recno = recordno(tr) ;
int location ;
file.seekp(location) ;
strcpy(roomcode,t_rcode) ;
roomno = t_roomno ;
status = t_status ;
tariff = t_tariff ;
46
PROJECT ON HOTEL MANAGEMENT SYSTEM
file.close () ;
clrscr() ;
int valid ;
char ch ;
int t_roomno ;
gotoxy(1,3) ;
cin>>t_roomno ;
if ( !room_found( t_roomno ) )
gotoxy(1,25) ; clreol() ;
gotoxy(1,24) ;
gotoxy(1,25) ;
getch() ;
return ;
display_record(t_roomno) ;
47
PROJECT ON HOTEL MANAGEMENT SYSTEM
gotoxy(1,10) ;
do
valid = 1 ;
gotoxy(48,10) ;
cin>>ch ;
getch() ;
ch = toupper(ch) ;
valid = 0 ;
gotoxy(42,9) ; clreol() ;
} while ( !valid ) ;
if (ch == 'N')
return ;
fstream file ;
file.open("ROOM.DAT", ios::in) ;
fstream temp ;
temp.open("temp.dat", ios::out) ;
while ( !file.eof() )
48
PROJECT ON HOTEL MANAGEMENT SYSTEM
if ( file.eof() )
break ;
if ( roomno != t_roomno )
file.close() ;
temp.close() ;
file.open("ROOM.DAT", ios::out) ;
temp.open("temp.dat", ios::in) ;
temp.seekg(0) ;
while ( !temp.eof() )
if ( temp.eof() )
break ;
file.close() ;
temp.close() ;
49
PROJECT ON HOTEL MANAGEMENT SYSTEM
clrscr() ;
fstream file ;
file.open("CUSTOMER.DAT", ios::in) ;
file.seekg(0) ;
int row = 5 ;
int found = 0 ;
int pageno = 1 ;
int total = 0 ;
gotoxy(18,1) ;
cout<<"LIST OF CUSTOMERS" ;
gotoxy(1,3) ;
total++ ;
found = 1 ;
gotoxy(2,row) ;
cout<<roomno ;
gotoxy(12,row) ;
puts(name) ;
fflush(stdout) ;
gotoxy(34,row) ;
cout<<phone ;
50
PROJECT ON HOTEL MANAGEMENT SYSTEM
gotoxy(47,row) ;
cout<<room_srv ;
gotoxy(62,row) ;
cout<<advance ;
gotoxy(72,row) ;
cout<<misc ;
if ( row == 23 )
row = 5 ;
gotoxy(66,1) ;
pageno++ ;
gotoxy(1,25) ;
getch() ;
clrscr() ;
gotoxy(18,1) ;
cout<<"LIST OF CUSTOMERS" ;
gotoxy(1,3) ;
else
row++ ;
51
PROJECT ON HOTEL MANAGEMENT SYSTEM
if ( found==0 )
gotoxy(1,5) ;
gotoxy(66,1) ;
gotoxy(1,25) ;
getch() ;
clrscr() ;
gotoxy(5,5) ;
gotoxy(1,25) ;
getch() ;
file.close () ;
room r ;
menu m1;
52
PROJECT ON HOTEL MANAGEMENT SYSTEM
char ch ;
int valid = 1 ;
clrscr() ;
gotoxy(1,1) ;
gotoxy(1,3) ;
gotoxy(1,4) ;
cout<<"Name :";
gotoxy(1,5) ;
gotoxy(1,6) ;
cout<<"Address :";
gotoxy(1,7) ;
cout<<"Phone :";
gotoxy(1,8) ;
cout<<"Nationality :";
gotoxy(1,9) ;
gotoxy(1,11) ;
53
PROJECT ON HOTEL MANAGEMENT SYSTEM
cout<<"Advance :";
gotoxy(1,12) ;
cout<<"Miscellineous : " ;
gotoxy(1,13) ;
gotoxy(20,3) ;
cin>>t_roomno ;
char t_status ;
t_status = r.room_status(t_roomno) ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,24) ;
gotoxy(1,25) ;
getch() ;
m1.main_menu() ;
do
valid = 1 ;
gotoxy(1,25) ; clreol() ;
54
PROJECT ON HOTEL MANAGEMENT SYSTEM
gotoxy(1,25) ;
gotoxy(20,4) ;
gets(t_name) ;
strupr(t_name) ;
fflush(stdin) ;
valid = 0 ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,24) ;
gotoxy(1,25) ;
getch() ;
gotoxy(1,24) ; clreol() ;
gotoxy(1,25) ; clreol() ;
gotoxy(20,4) ; clreol() ;
} while ( !valid ) ;
do
valid = 1 ;
55
PROJECT ON HOTEL MANAGEMENT SYSTEM
gotoxy(1,25) ; clreol() ;
gotoxy(1,25) ;
gotoxy(20,5) ;
cin>>t_no_cust ;
valid = 0 ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,24) ;
gotoxy(1,25) ;
getch() ;
gotoxy(1,24) ; clreol() ;
gotoxy(1,25) ; clreol() ;
gotoxy(20,5) ; clreol() ;
} while ( !valid ) ;
do
valid = 1 ;
gotoxy(1,25) ; clreol() ;
56
PROJECT ON HOTEL MANAGEMENT SYSTEM
gotoxy(1,25) ;
gotoxy(20,6) ;
gets(t_address) ;
fflush(stdin) ;
valid = 0 ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,24) ;
gotoxy(1,25) ;
getch() ;
gotoxy(1,24) ; clreol() ;
gotoxy(1,25) ; clreol() ;
gotoxy(20,6) ; clreol() ;
} while ( !valid ) ;
do
valid = 1 ;
gotoxy(1,25) ; clreol() ;
57
PROJECT ON HOTEL MANAGEMENT SYSTEM
gotoxy(1,25) ;
cout<<"ENTER THE PHONE NO. OF THE CUSTOMER, ENTER '-' FOR NO PHONE NO." ;
gotoxy(20,7) ;
cin>>t_phone ;
valid = 0 ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,24) ;
gotoxy(1,25) ;
getch() ;
gotoxy(1,24) ; clreol() ;
gotoxy(1,25) ; clreol() ;
gotoxy(20,7) ; clreol() ;
} while ( !valid ) ;
do
valid = 1 ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,25) ;
58
PROJECT ON HOTEL MANAGEMENT SYSTEM
gotoxy(20,8) ;
gets(t_nation) ;
fflush(stdin) ;
valid = 0 ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,24) ;
gotoxy(1,25) ;
getch() ;
gotoxy(1,24) ; clreol() ;
gotoxy(1,25) ; clreol() ;
gotoxy(20,8) ; clreol() ;
} while ( !valid ) ;
do
valid = 1 ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,25) ;
59
PROJECT ON HOTEL MANAGEMENT SYSTEM
gotoxy(20,9) ;
gets(t_passport) ;
fflush(stdin) ;
valid = 0 ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,24) ;
gotoxy(1,25) ;
getch() ;
gotoxy(1,24) ; clreol() ;
gotoxy(1,25) ; clreol() ;
gotoxy(20,9) ; clreol() ;
} while ( !valid ) ;
do
valid = 1 ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,25) ;
60
PROJECT ON HOTEL MANAGEMENT SYSTEM
gotoxy(20,11) ;
cin>>t_advance ;
if (t_advance < 0)
valid = 0 ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,24) ;
gotoxy(1,25) ;
getch() ;
gotoxy(1,24) ; clreol() ;
gotoxy(1,25) ; clreol() ;
gotoxy(20,11) ; clreol() ;
} while ( !valid ) ;
do
valid = 1 ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,25) ;
61
PROJECT ON HOTEL MANAGEMENT SYSTEM
gotoxy(20,12) ;
cin>>t_misc ;
if (t_misc < 0)
valid = 0 ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,24) ;
gotoxy(1,25) ;
getch() ;
gotoxy(1,24) ; clreol() ;
gotoxy(1,25) ; clreol() ;
gotoxy(20,12) ; clreol() ;
} while ( !valid ) ;
do
valid = 1 ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,25) ;
gotoxy(20,13) ;
62
PROJECT ON HOTEL MANAGEMENT SYSTEM
cin>>t_room_srv ;
getch();
if (t_room_srv < 0)
valid = 0 ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,24) ;
gotoxy(1,25) ;
getch() ;
gotoxy(1,24) ; clreol() ;
gotoxy(1,25) ; clreol() ;
gotoxy(20,13) ; clreol() ;
} while ( !valid ) ;
gotoxy(1,15) ;
do
valid = 1 ;
gotoxy(42,15) ;
cin>>ch;
63
PROJECT ON HOTEL MANAGEMENT SYSTEM
getch() ;
ch = toupper(ch) ;
valid = 0 ;
gotoxy(42,15) ; clreol() ;
} while ( !valid ) ;
if (ch == 'Y')
r.change_status(t_roomno,'O') ;
roomno = t_roomno ;
strcpy(name,t_name) ;
strcpy(phone,t_phone) ;
advance = t_advance ;
misc = t_misc ;
room_srv = t_room_srv ;
fstream file ;
file.close() ;
m1.main_menu() ;
64
PROJECT ON HOTEL MANAGEMENT SYSTEM
fstream file ;
file.open("CUSTOMER.DAT", ios::in) ;
file.seekg(0) ;
int found = 0 ;
if (t_roomno == roomno)
found = 1 ;
gotoxy(1,5) ;
gotoxy(1,6) ;
gotoxy(1,7) ;
gotoxy(1,8) ;
gotoxy(1,9) ;
gotoxy(1,10) ;
65
PROJECT ON HOTEL MANAGEMENT SYSTEM
file.close () ;
fstream file ;
file.open("CUSTOMER.DAT", ios::in) ;
file.seekg(0) ;
int count = 0 ;
count++ ;
if (t_roomno == roomno)
break ;
file.close() ;
return count ;
clrscr() ;
66
PROJECT ON HOTEL MANAGEMENT SYSTEM
room r ;
int valid ;
char ch ;
int t_roomno , tr ;
fstream file ;
gotoxy(1,3) ;
cin>>tr ;
getch();
char t_status ;
t_status = r.room_status(tr) ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,24) ;
gotoxy(1,25) ;
getch() ;
return ;
67
PROJECT ON HOTEL MANAGEMENT SYSTEM
display_record(tr) ;
gotoxy(1,12) ;
do
valid = 1 ;
gotoxy(48,12) ;
cin>>ch;
getch() ;
ch = toupper(ch) ;
valid = 0 ;
gotoxy(42,12) ; clreol() ;
} while ( !valid ) ;
if (ch == 'N')
return ;
gotoxy(1,14) ;
gotoxy(1,16) ;
68
PROJECT ON HOTEL MANAGEMENT SYSTEM
gotoxy(1,17) ;
cout<<"Name :";
gotoxy(1,18) ;
cout<<"Phone :";
gotoxy(1,19) ;
cout<<"Advance :";
gotoxy(1,20) ;
cout<<"Miscellineous : " ;
gotoxy(1,21) ;
do
valid = 1 ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,25) ;
gotoxy(20,16) ;
cin>>t_roomno ;
getch();
t_status = r.room_status(t_roomno) ;
69
PROJECT ON HOTEL MANAGEMENT SYSTEM
valid = 0 ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,24) ;
gotoxy(1,25) ;
getch() ;
gotoxy(1,24) ; clreol() ;
gotoxy(1,25) ; clreol() ;
gotoxy(20,16) ; clreol() ;
} while ( !valid ) ;
do
valid = 1 ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,25) ;
gotoxy(20,17) ;
gets(t_name) ;
getch();
strupr(t_name) ;
fflush(stdin) ;
70
PROJECT ON HOTEL MANAGEMENT SYSTEM
valid = 0 ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,24) ;
gotoxy(1,25) ;
getch() ;
gotoxy(1,24) ; clreol() ;
gotoxy(1,25) ; clreol() ;
gotoxy(20,17) ; clreol() ;
} while ( !valid ) ;
do
valid = 1 ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,25) ;
cout<<"ENTER THE PHONE NO. OF THE CUSTOMER, ENTER '-' FOR NO PHONE NO." ;
gotoxy(20,18) ;
cin>>t_phone ;
71
PROJECT ON HOTEL MANAGEMENT SYSTEM
valid = 0 ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,24) ;
gotoxy(1,25) ;
getch() ;
gotoxy(1,24) ; clreol() ;
gotoxy(1,25) ; clreol() ;
gotoxy(20,18) ; clreol() ;
} while ( !valid ) ;
do
valid = 1 ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,25) ;
gotoxy(20,19) ;
cin>>t_advance ;
getch();
if (t_advance < 0)
72
PROJECT ON HOTEL MANAGEMENT SYSTEM
valid = 0 ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,24) ;
gotoxy(1,25) ;
getch() ;
gotoxy(1,24) ; clreol() ;
gotoxy(1,25) ; clreol() ;
gotoxy(20,19) ; clreol() ;
} while ( !valid ) ;
do
valid = 1 ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,25) ;
gotoxy(20,20) ;
cin>>t_misc ;
getch();
if (t_misc < 0)
73
PROJECT ON HOTEL MANAGEMENT SYSTEM
valid = 0 ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,24) ;
gotoxy(1,25) ;
getch() ;
gotoxy(1,24) ; clreol() ;
gotoxy(1,25) ; clreol() ;
gotoxy(20,20) ; clreol() ;
} while ( !valid ) ;
do
valid = 1 ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,25) ;
gotoxy(20,21) ;
cin>>t_room_srv ;
getch();
if (t_room_srv < 0)
74
PROJECT ON HOTEL MANAGEMENT SYSTEM
valid = 0 ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,24) ;
gotoxy(1,25) ;
getch() ;
gotoxy(1,24) ; clreol() ;
gotoxy(1,25) ; clreol() ;
gotoxy(20,21) ; clreol() ;
} while ( !valid ) ;
gotoxy(1,23) ;
do
valid = 1 ;
gotoxy(42,23) ;
cin>>ch;
getch() ;
ch = toupper(ch) ;
75
PROJECT ON HOTEL MANAGEMENT SYSTEM
valid = 0 ;
gotoxy(42,23) ; clreol() ;
} while ( !valid ) ;
if (ch == 'Y')
if (t_roomno != tr)
r.change_status(t_roomno,'O') ;
r.change_status(tr,'V') ;
int recno ;
recno = recordno(tr) ;
int location ;
file.seekp(location) ;
roomno = t_roomno ;
strcpy(name,t_name) ;
strcpy(phone,t_phone) ;
room_srv = t_room_srv ;
advance = t_advance ;
misc = t_misc ;
76
PROJECT ON HOTEL MANAGEMENT SYSTEM
file.close () ;
fstream file ;
file.open("CUSTOMER.DAT", ios::in) ;
fstream temp ;
temp.open("temp.dat", ios::out) ;
while ( !file.eof() )
if ( file.eof() )
break ;
if ( roomno != t_roomno )
file.close() ;
temp.close() ;
file.open("CUSTOMER.DAT", ios::out) ;
temp.open("temp.dat", ios::in) ;
temp.seekg(0) ;
77
PROJECT ON HOTEL MANAGEMENT SYSTEM
while ( !temp.eof() )
if ( temp.eof() )
break ;
file.close() ;
temp.close() ;
clrscr() ;
room r ;
int valid ;
int t_roomno ;
gotoxy(1,3) ;
cin>>t_roomno ;
char t_status ;
t_status = r.room_status(t_roomno) ;
78
PROJECT ON HOTEL MANAGEMENT SYSTEM
gotoxy(1,25) ; clreol() ;
gotoxy(1,24) ;
gotoxy(1,25) ;
getch() ;
return ;
clrscr() ;
gotoxy(5,3) ;
cout<<"CUSTOMER RECORD" ;
display_record(t_roomno) ;
gotoxy(1,25) ;
getch() ;
clrscr() ;
room r ;
int valid ;
char ch ;
int t_roomno ;
79
PROJECT ON HOTEL MANAGEMENT SYSTEM
gotoxy(1,3) ;
cin>>t_roomno ;
char t_status ;
t_status = r.room_status(t_roomno) ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,24) ;
gotoxy(1,25) ;
getch() ;
return ;
display_record(t_roomno) ;
gotoxy(1,15) ;
do
valid = 1 ;
gotoxy(52,15) ;
cin>>ch ;
80
PROJECT ON HOTEL MANAGEMENT SYSTEM
getch() ;
ch = toupper(ch) ;
valid = 0 ;
gotoxy(52,15) ; clreol() ;
} while ( !valid ) ;
if (ch == 'N')
return ;
r.change_status(t_roomno,'V') ;
delete_record(t_roomno) ;
clrscr() ;
menu m1 ;
room r ;
int valid ;
char ch ;
int t_roomno ;
gotoxy(1,3) ;
81
PROJECT ON HOTEL MANAGEMENT SYSTEM
cin>>t_roomno ;
char t_status ;
t_status = r.room_status(t_roomno) ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,24) ;
gotoxy(1,25) ;
getch() ;
m1.main_menu();
display_record(t_roomno) ;
gotoxy(1,15) ;
cout<<"Do you want to prepare bill of this Customer Record (y/n) : " ;
do
valid = 1 ;
gotoxy(63,15) ;
cin>>ch;
getch() ;
ch = toupper(ch) ;
82
PROJECT ON HOTEL MANAGEMENT SYSTEM
valid = 0 ;
gotoxy(63,15) ; clreol() ;
} while ( !valid ) ;
if (ch == 'N')
return ;
fstream file ;
file.open("CUSTOMER.DAT", ios::in) ;
file.seekg(0) ;
char t_name[21] ;
if (t_roomno == roomno)
strcpy(t_name,name) ;
t_advance = advance ;
t_room_srv = room_srv ;
t_misc = misc ;
break ;
83
PROJECT ON HOTEL MANAGEMENT SYSTEM
file.close() ;
t_tariff = r.get_data(t_roomno) ;
account a ;
a.prepare_bill(t_roomno,t_tariff,t_name,t_advance,t_room_srv,t_misc) ;
r.change_status(t_roomno,'V') ;
delete_record(t_roomno) ;
gotoxy(1,25) ;
getch() ;
m1.main_menu() ;
menu m1 ;
int valid ;
int days ;
gotoxy(1,17) ;
do
84
PROJECT ON HOTEL MANAGEMENT SYSTEM
valid = 1 ;
gotoxy(25,17) ;
cin>>days ;
valid = 0 ;
gotoxy(1,25) ; clreol() ;
gotoxy(1,24) ;
gotoxy(1,25) ;
getch() ;
gotoxy(1,24) ; clreol() ;
gotoxy(1,25) ; clreol() ;
gotoxy(25,17) ; clreol() ;
} while ( !valid ) ;
clrscr() ;
menu m ;
85
PROJECT ON HOTEL MANAGEMENT SYSTEM
gotoxy(5,3) ;
gotoxy(5,6) ;
gotoxy(5,8) ;
gotoxy(5,10) ;
gotoxy(5,12) ;
gotoxy(5,14) ;
gotoxy(5,16) ;
gotoxy(5,18) ;
cout<<"------------------------------------------" ;
gotoxy(5,19) ;
gotoxy(5,20) ;
cout<<"------------------------------------------" ;
86
PROJECT ON HOTEL MANAGEMENT SYSTEM
menu m ;
m.enter_password() ;
m.intro();
87
PROJECT ON HOTEL MANAGEMENT SYSTEM
OUTPUT
88
PROJECT ON HOTEL MANAGEMENT SYSTEM
89
PROJECT ON HOTEL MANAGEMENT SYSTEM
90
PROJECT ON HOTEL MANAGEMENT SYSTEM
91
PROJECT ON HOTEL MANAGEMENT SYSTEM
92
PROJECT ON HOTEL MANAGEMENT SYSTEM
93
PROJECT ON HOTEL MANAGEMENT SYSTEM
BIBLOGRAPHY
www.wikipedia.org
www.scribd.com
www.programmingsimplified.com
www.cprogramming.com
94