You are on page 1of 40

COMPUTER SCIENCE

PROJECT

HOTEL MANAGEMENT

SUBMITTED TO: SUBMITTED BY:

MRS.SHWETA MITTAL NAME: KHUSHI PRUTHI

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

SUBMITTED TO: MRS. SHWETA MITTAL

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.

PURPOSE OF THE SYSTEM

The hotel management system aims to make simpler a


staff’s interaction with the various modules of the hotel
and ease the process of acquiring information and
providing services. The system can be accessed by the
admin and customers but the highest priority is given to
the admin that are allocated a login id and password.it
will also allow cutting the operational costs of hotel.
SCOPE

In this system we will make extensive use of filesystem in


c++. We will have a login id system initially.in this sytem
we will be having separate functions for:-
 Getting the information of the user
 Getting customer information who are logged in
 Allocating the room to the customer
 Checking the availability
 Displaying the features of a room
 Modifying the customer details
 Preparing the billing function for the customer
according to his room no.
 Displaying the food procedure to the customer
CONTENTS

1. HEADER FILES USED………………………………………………….


2. FILES GENERATED…………………………………………………….
3. CODING…………………………………………………………………….
4. OUTPUT SCREENS……………………………………………………..
HEADER FILES USED

 <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 PRESTIGIOUS HOTEL ";

cout<<"\n\t\t\t********************************";

cout<<"\n\t\t\t BOLE TO EK DUM JAKAS HOTEL!!";

cout<<"\n\t\t\t********************************";

cout<<"\n\t\t\t * MAIN MENU *";

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\t5.To know about food procedure";

cout<<"\n\t\t\t6.Exit";

cout<<"\n\n\t\t\tEnter Your Choice: ";

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\n Room no: ";

cout<<"\n Total no. of Rooms - 60";

cout<<"\n Ordinary Rooms from 1 - 30";

cout<<"\n Luxuary Rooms from 31 - 50";

cout<<"\n Royal Rooms from 51 - 60";

cout <<"\n Enter The Room no. you want to stay in :- ";

cin>>r;

flag=check(r);

if(flag)

cout<<"\n Sorry..!!!Room is already booked";

else

h1.room_no=r;
cout<<" Name: ";

gets(h1.name);

cout<<" Address: ";

gets(h1.address);

cout<<" Phone No: ";

gets(h1.phone);

cout<<" No. of days you want to stay: ";

cin>>h1.n_days;

cout<<" Arrival Date: ";

gets(h1.ar_date);

cout<<" Departure Date: ";

gets(h1.dep_date);

cout<<" Booking ID: ";

cin>>h1.b_id;

fout.write((char*)&h1,sizeof(h1));

cout<<"\n Room is booked...!!!";

}
cout<<"\n Press any key to continue.....!!";

getch();

fout.close();

main_menu();

//function to display details

void hotel::display()

clrscr();

ifstream fin("hot.txt",ios::in);

int r,flag;

cout<<"\n Enter room no. for a particular customer`s details :- ";

cin>>r;

while(!fin.eof())

fin.read((char*)&h1,sizeof(h1));

if(h1.r_no()==r)
{

clrscr();

cout<<"\n Customer Details";

cout<<"\n Room no: "<<h1.room_no;

cout<<"\n Name: "<<h1.name;

cout<<"\n Address: "<<h1.address;

cout<<"\n Phone no: "<<h1.phone;

cout<<"\n no. of days: "<<h1.n_days;

cout<<"\n Arrival Date: "<<h1.ar_date;

cout<<"\n Departure Date: "<<h1.dep_date;

cout<<"\n Booking ID: "<<h1.b_id;

flag=1;

break;

if(flag==0)

cout<<"\n Sorry Room no. not found or vacant....!!";


cout<<"\n\n Press any key to continue....!!";

getch();

fin.close();

main_menu();

//function to call edit menu which has functions

//of delete and modify

void hotel::edit()

clrscr();

int choice,r;

cout<<"\n EDIT MENU";

cout<<"\n ---------";

cout<<"\n\n 1.Modify Customer Record";

cout<<"\n 2.Delete Customer Record";

cout<<"\n 3.Return back to main menu";

cout<<"\n Enter your choice: ";


cin>>choice;

clrscr();

switch(choice)

case 1: modify(r);

break;

case 2: delete_rec(r);

break;

case 3: main_menu();

break;

default: cout<<"\n Wrong Choice.....!!";

cout<<"\n Press any key to continue....!!!";


getch();

// function to check the room no

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);

//function to modify the details of customer

void hotel::modify(int r)

long pos,flag=0;

fstream file("hot.txt",ios::in|ios::out|ios::binary);

cout<<"\n\nEnter the room no whose details u want to modify:-";

cin>>r;

while(!file.eof())

{
pos=file.tellg();

file.read((char*)&h1,sizeof(h1));

if(h1.r_no()==r)

cout<<"\n Enter New Details";

cout<<"\n -----------------";

cout<<"\n Name:";

cin>>h1.name;

cout<<"Address:";

cin>>h1.address;

cout<<"Phone no:";

cin>>h1.phone;

cout<<"No. of days you want to stay:";

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));

cout<<"\n Record is modified....!!";

flag=1;

break;

if(flag==0)

cout<<"\n Sorry Room no. not found or vacant...!!";

cout<<"\n Press any key to return back to edit menu";

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);

cout<<"\n\nEnter the room no whose details you want to delete:-";

cin>>r;

while(!fin.eof())

fin.read((char*)&h1,sizeof(h1));

if(h1.r_no()==r)

flag=0;

cout<<"\n Name: "<<h1.name;

cout<<"\n Address: "<<h1.address;

cout<<"\n Phone No: "<<h1.phone;

cout<<"\n No. of days: "<<h1.n_days;

cout<<"\n Arrival Date: "<<h1.ar_date;


cout<<"\n Departure Date: "<<h1.dep_date;

cout<<"\n Booking ID:" <<h1.b_id;

cout<<"\n\n Do you want to delete this record(y/n): ";

cin>>ch;

if(ch=='n')

fout.write((char*)&h1,sizeof(h1));

else

fout.write((char*)&h1,sizeof(h1));

};

if(flag==1)

cout<<"\n Sorry room no. not found or vacant...!!";

fin.close();

fout.close();

remove("hot.txt");

rename("st.txt","hot.txt");

cout<<"\n Your details are deleted";

cout<<"\n Press any key to return back to edit menu";

getch();

edit();
}

//function to print the bill of the customer

void hotel::bill(int r)

clrscr();

float p,q;

ifstream f1;

f1.open("hot.txt",ios::in|ios::binary);

cout<<"Enter the room no whose bill you want:-";

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<<"NO OF DAYS OF STAY :"<<h1.n_days<<endl;

cout<<"COST OF ROOM FOR SINGLE DAY is 2000"<<endl;

cout<<"ADDITIONAL CHARGES"<<endl;

cout<<"SGST -> 8%"<<endl;

cout<<"CGST -> 8%"<<endl;

p=(h1.n_days*2000);

q=p*0.08;

cout<<"TOTAL BILL:"<<p+q+q<<endl;;

cout<<"THANK U FOR VISITING US!!!"<<endl;


}

else if (h1.r_no()>=35&&h1.r_no()<=45)

cout<<"YOUR BILL:"<<endl;

cout<<"NO OF DAYS OF STAY :"<<h1.n_days<<endl;

cout<<"COST OF ROOM FOR SINGLE DAY is 5000"<<endl;

cout<<"ADDITIONAL CHARGES"<<endl;

cout<<"SGST -> 8% "<<endl;

cout<<"CGST -> 8% "<<endl;

p=(h1.n_days*5000);

q=p*0.08;

cout<<"TOTAL BILL:"<<p+q+q<<endl;;

cout<<"THANK U FOR VISITING US!!!"<<endl;

else

cout<<"YOUR BILL:"<<endl;

cout<<"NO OF DAYS OF STAY :"<<h1.n_days<<endl;

cout<<"COST OF ROOM FOR SINGLE DAY is 7000"<<endl;

cout<<"ADDITIONAL CHARGES"<<endl;
cout<<"SGST -> 8%"<<endl;

cout<<"CGST -> 8%"<<endl;

p=(h1.n_days*7000);

q=p*0.08;

cout<<"TOTAL BILL:"<<p+q+q<<endl;;

cout<<"THANK U FOR VISITING US!!!"<<endl;

else

{ cout<<"room no. not found";}

f1.close();

getch();

main_menu();

void hotel::about()

clrscr();
cout<<"Breakfast Time will be at 9:00am"<<endl;

cout<<"Lunch Time will be at 3:00pm"<<endl;

cout<<"Dinner Time wil be at 9:00pm onwards"<endl;

cout<<"\n OUR MEALS ARE PREPARED BY SPECIALISED CHEF!!"<<endl;

cout<<"ENJOY YOUR MEAL!!!!"<<endl;

cout<<"IF ANY PROBLEM CONTACT TO MR. SHAYAM LAL"<<endl;

cout<<"PHONE NO:9213119209"<<endl;

cout<<"Press any key to return back to main menu";

getch();

main_menu();

int hotel :: r_no()

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 | @@PRESTIGIOUS | ";

cout<<"\n\t\t\t | HOTEL@@ | ";

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\t\t\t | | | | ";

cout<<"\n\t\t\t |_______|__|______| ";

cout<<"\n\n\t\tDeveloped By:";

cout<<"\t desi crew";

cout<<"\n\n\n\n\n\n\n\t\t\t\t\tPress any key to continue....!!";

getch();
clrscr();

char username[10],password[10];

cout<<"\n\n\t\t\tENTER YOUR USERNAME: ";

gets(username);

cout<<"\n\t\t\tENTER YOUR PASSWORD: ";

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

cout<<"\n\t\t\tENTER VALID USERNAME AND PASSWORD";

cout<<"\n\t\t\tYOU CANNOT PROCEED FURTHER";

}
getch();

getch();

}
OUTPUT SCREENS

You might also like