Professional Documents
Culture Documents
PROJECT
HOTEL MANAGEMENT
CLASS: XII
ROLL NO.:
ACKNOWLEDGEMENT
I would to express a deep sense of thanks and gratitude to
my project guide Mrs. Shweta Mittal mam for guiding me
immensely through the course of the project. She always
evinced keen interest in my work. Her constructive advice
and constant motivation have been responsible for the
successful completion of this project.
My sincere thanks goes to Dr. Rakesh Dutt, the principle of
our school for her coordination in extending every possible
support for the completion of this project.
I also want to thanks to my parents for their motivation and
support. I must thanks to my group mates and classmates for
their timely help and support for the completion of this
project.
Last but not the least I would like to thank all those who had
helped directly or indirectly in the completion of this project.
KHUSHI PRUTHI
XII-A
CERTIFICATE
This is to certify that the project entitled
“HOTEL MANAGEMENT”
Is prepared under my guidance and supervision by
NAME: KHUSHI PRUTHI
ROLL NO.:
CLASS: XII-A
SUBJECT: COMPUTER SCIENCE
SESSION: 2019-2020
SIGNATURE:
INTRODUCTION
A typical luxury hotel requires a management system to
control its various operations such as maintaining
account of all the people in its domain of services,
attending to various needs of customers and achieving
increased efficiency in the overall working of the hotel
itself.
<IOSTREAM.H>
<FSTREAM.H>
<CONIO.H>
<STDIO.H>
FILES GENERATED
“HOT.TXT”
“ST.TXT”
CODING
#include<iostream.h>
#include<conio.h>
#include<fstream.h>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
class hotel
int room_no;
char name[30];
char address[50];
char phone[20] ;
char ar_date[20];
char dep_date[20];
int n_days;
int b_id;
public:
void main_menu();
void add();
void display();
void edit();
void about();
int check(int);
void modify(int);
void delete_rec(int);
void bill(int);
int r_no();
}h1;
void hotel::main_menu()
int r;
int choice;
clrscr();
cout<<"\n\t\t\t********************************";
cout<<"\n\t\t\t********************************";
cout<<"\n\t\t\t********************************";
cout<<"\n\t\t\t********************************";
cout<<"\n\n\n\t\t\t1.Book A Room";
cout<<"\n\t\t\t2.Customer Records";
cout<<"\n\t\t\t3.Edit Record";
cout<<"\n\t\t\t4.Bill of Customer";
cout<<"\n\t\t\t6.Exit";
cin>>choice;
switch(choice)
{
case 1: add();
break;
case 2: display();
break;
case 3: edit();
break;
case 4: bill(r);
break;
case 5: about();
break;
case 6:clrscr();
cout<<"\n\n\n\n\n\t\t\t\tTHANK YOU!!!";
break;
default:
cout<<"\n\n\t\t\tWrong choice.....!!!";
getch();
main_menu();
getch();
void hotel::add()
clrscr();
int r,flag;
ofstream fout("hot.txt",ios::app);
cout<<"\n Enter Customer Detalis";
cout<<"\n ----------------------";
cout <<"\n Enter The Room no. you want to stay in :- ";
cin>>r;
flag=check(r);
if(flag)
else
h1.room_no=r;
cout<<" Name: ";
gets(h1.name);
gets(h1.address);
gets(h1.phone);
cin>>h1.n_days;
gets(h1.ar_date);
gets(h1.dep_date);
cin>>h1.b_id;
fout.write((char*)&h1,sizeof(h1));
}
cout<<"\n Press any key to continue.....!!";
getch();
fout.close();
main_menu();
void hotel::display()
clrscr();
ifstream fin("hot.txt",ios::in);
int r,flag;
cin>>r;
while(!fin.eof())
fin.read((char*)&h1,sizeof(h1));
if(h1.r_no()==r)
{
clrscr();
flag=1;
break;
if(flag==0)
getch();
fin.close();
main_menu();
void hotel::edit()
clrscr();
int choice,r;
cout<<"\n ---------";
clrscr();
switch(choice)
case 1: modify(r);
break;
case 2: delete_rec(r);
break;
case 3: main_menu();
break;
int hotel::check(int r)
int flag=0;
ifstream fin("hot.txt",ios::in);
while(!fin.eof())
fin.read((char*)&h1,sizeof(h1));
if(h1.r_no()==r)
flag=1;
break;
}
fin.close();
return(flag);
void hotel::modify(int r)
long pos,flag=0;
fstream file("hot.txt",ios::in|ios::out|ios::binary);
cin>>r;
while(!file.eof())
{
pos=file.tellg();
file.read((char*)&h1,sizeof(h1));
if(h1.r_no()==r)
cout<<"\n -----------------";
cout<<"\n Name:";
cin>>h1.name;
cout<<"Address:";
cin>>h1.address;
cout<<"Phone no:";
cin>>h1.phone;
cin>>h1.n_days;
cout<<"Arrival Date:";
cin>>h1.ar_date;
cout<<"Departure Date:";
cin>>h1.dep_date;
cout<<"Booking ID:";
cin>>h1.b_id;
file.seekg(pos);
file.write((char*)&h1,sizeof(h1));
flag=1;
break;
if(flag==0)
getch();
file.close();
edit();
}
//function to delete the details of the customer
void hotel::delete_rec(int r)
int flag=1;
char ch;
ifstream fin("hot.txt",ios::in);
ofstream fout("st.txt",ios::out);
cin>>r;
while(!fin.eof())
fin.read((char*)&h1,sizeof(h1));
if(h1.r_no()==r)
flag=0;
cin>>ch;
if(ch=='n')
fout.write((char*)&h1,sizeof(h1));
else
fout.write((char*)&h1,sizeof(h1));
};
if(flag==1)
fin.close();
fout.close();
remove("hot.txt");
rename("st.txt","hot.txt");
getch();
edit();
}
void hotel::bill(int r)
clrscr();
float p,q;
ifstream f1;
f1.open("hot.txt",ios::in|ios::binary);
cin>>r;
if(!f1)
cout<<"cannot open";
else
f1.read((char*)&h1,sizeof (hotel));
while(f1)
{
f1.read((char*)&h1,sizeof(hotel));
if (h1.r_no() == r)
if(h1.r_no()>=1&&h1.r_no()<=30)
cout<<"YOUR BILL:"<<endl;
cout<<"ADDITIONAL CHARGES"<<endl;
p=(h1.n_days*2000);
q=p*0.08;
cout<<"TOTAL BILL:"<<p+q+q<<endl;;
else if (h1.r_no()>=35&&h1.r_no()<=45)
cout<<"YOUR BILL:"<<endl;
cout<<"ADDITIONAL CHARGES"<<endl;
p=(h1.n_days*5000);
q=p*0.08;
cout<<"TOTAL BILL:"<<p+q+q<<endl;;
else
cout<<"YOUR BILL:"<<endl;
cout<<"ADDITIONAL CHARGES"<<endl;
cout<<"SGST -> 8%"<<endl;
p=(h1.n_days*7000);
q=p*0.08;
cout<<"TOTAL BILL:"<<p+q+q<<endl;;
else
f1.close();
getch();
main_menu();
void hotel::about()
clrscr();
cout<<"Breakfast Time will be at 9:00am"<<endl;
cout<<"PHONE NO:9213119209"<<endl;
getch();
main_menu();
return room_no;
void main()
hotel h;
clrscr();
cout<<"\n\t\t\t****************************";
cout<<"\n\t\t\t* HOTEL MANAGEMENT PROJECT *";
cout<<"\n\t\t\t****************************";
cout<<"\n\t\t\t | | ";
cout<<"\n\t\t\t | _ _ _ _ | ";
cout<<"\n\t\t\t | _ _ _ _ | ";
cout<<"\n\t\t\t | _ _ _ _ | ";
cout<<"\n\t\t\t | __ | ";
cout<<"\n\t\t\t | | | | ";
cout<<"\n\n\t\tDeveloped By:";
getch();
clrscr();
char username[10],password[10];
gets(username);
gets(password);
if((strcmp(username,"abhinav")==0)&&(strcmp(password,"jakas101")=
=0))
cout<<"\n\t\t\tWELCOME ABHINAV!!!";
getch();
h.main_menu();
else
if((strcmp(username,"khushi")==0)&&(strcmp(password,"jakas102")==
0))
cout<<"\n\t\t\tWELCOME KHUSHI!!!";
getch();
h.main_menu();
}
else
if((strcmp(username,"mayank")==0)&&(strcmp(password,"jakas103")=
=0))
cout<<"\n\t\t\tWELCOME MAYANK!!!";
getch();
h.main_menu();
else
if((strcmp(username,"sudhanshu")==0)&&(strcmp(password,"jakas104"
)==0))
cout<<"\n\t\t\tWELCOME SUDHANSHU!!!";
getch();
h.main_menu();
else
}
getch();
getch();
}
OUTPUT SCREENS