Sunteți pe pagina 1din 27

TOPIC: HOTEL

MANAGEMENT SYSTEM

PROJECT REPORT PRESENTED


BY:
Sharu Sharma

12th
ARMY PUBLIC SCHOOL JANGLOT

Certificate
Acknowledgement
Introduction To C++
Important Features Of
C++
Hardware And Software
System Description At A
Glance
Data Base
Header Used And Their
Purpose
System Requirement
And Language Used
C++ Software

Program [Coding]
Output Of The Program

CERTIFICATE
THIS IS TO CERTIFY THAT
Satish chander
STUDENT OF CLASS XII OF ST. XAVIERS
CONVENT SCHOOL HAS SUCCESSFULLY
BEEN ABLE TO FINISH HIS PROJECT WORK
UNDER MY SUPERVISION.

Roll no.:
XII:

Class

Session:
board:
Candidate has done the project and signature
assigned in the project is genuine.
Teacher Incharge :
Principal :
Mr. DAISY SHARMA

I, Sharu Sharma student of class XITH St.


Army Public School Janglot feel immensely
gratified towards Miss. Daisy Sharma for
providing me such an environment to work on
my project Hotel Management system.
I am extremely thankful to my computer
teacher for assisting me in the respective

project and giving me valuable guidance,


encouragement as well as taking utmost
interest in my project.
Last but not the least, I would sincerely like
to express my gratitude towards my teacher
and school authorities who have been a great
source of encouragement to me.
Sharu Sharma
XIITH

The C++ programing language was developed


at
AT&T Bell Laboratories in early 1980s by
Bajarne Stroustrup. He found C lacking for
simulations and decided to extend the language by
adding features from his favourite language
SIMULA 67. Bajarne Stroustrup called it c with
classes originally. The name c++ was coined by
Rick Mascitti where ++ is the C increement
operator. Ever since its birth ++ evolved to cope
up with the problem encountered by users and
through discussions at AT&T. However, the
maturation of c++ language is attested to by the
recent events:
The formation of an ANSI(American National
Standard Institute) C++ committee.

The publication of The Annotated C++


Reference manual by Ellis and Stroustrup.
The Object Oriented Programing(OOPs) is regarded
as the ultimate paradigm for the modeling of the
information, be it data or logic and this oop is one
of the strongest feature of C++.

C++ has many features which are a part of the


OOP. Some of the features supported by C++
langage are given below:
DATA ABSTRACTION:
Data abstraction refers to the act of
representing
essential features without including the background
details and explanations.
DATA ENCAPSULATION:

The wrapping up of data and functions (that


operate on the data) into a single unit (called
classes) is known as data encapsulation.
MODULARITY:
Modularity is the property of system that has
been
decomposed into a set of cohesive and loosely
coupled modules.
INHERITANCE:
Inheritance is the capability of things to inherit
the
capabilities or properties from another class.
POLYMORPHISM:
Polymorphism is the ability for a message to be
processed in more than one form.

HARDWARE AND
SOFTWARE
REQUIREMENTS OF
THE PROGRAM
HARDWARE REQUIREMENTS:

Intel Pentium-II or Celeron

Processor(166MHZ or above)

VGA Monitor

Keyboard
32MB RAM
Hard disk

SOFTWARE REQUIREMENTS:

C++ Language
Window 98 or 95 or equivalent
MS_DOS Operating System

The hotel provides following services to its customer


Reservation
Room Status
Cancellation
Quit
RESERVATION :Any person can book a room by giving his particulars.
When he has to provide the check in date and a choice of
room. The room number is allotted automatically.
ROOM STATUS:-

When a person comes to the hotel, he has to check


in by giving a room number if he booked in advance.
CANCELLATION:This cancel the booking of nay room allotted to a
customer.
QUIT :This helps to come out of the output to be displayed.

HOTEL DAT
Name

Occupants Name

R Code

Room number

Contact

Contact No

In date

Check In date

Out date

Check out date

ROOM STATUS DAT


V Code

Room to be verified

C- rno

Room no. to be cancelled

S.N

Function

Function Description

o
1
2
3

Void get info()


Void Show info()
Void customer get

Function to get information


Function to show information
Function to get info about

info()
Void customer::Show

customer
Function to show info about

5
6

info()
Void reservation ()
Void Status ()

customer
Function to reserve a room.
Function to show status of Room

Void Cancellation ()

Allotted
Function for cancellation of Room

Reserved.

HEADER FILES USED


AND THEIR PURPOSE
1. FSTREAM.H for file handling, cin and
cout
2. PROCESS.H for exit() function
3. CONIO.H for clrscr() and getch()
4.
5.
6.
7.
8.

functions
STDIO.H for standard I/O operations
DOS.H for execution of program
STRING.H for string handling
GRAPHICS.H for graphical display
IOMANIP.Hfor C++ streams I/O
manipulators

System
Requirements
1.
2.
3.
4.

Window Xp
Ram 512
Hard Disk 80 GB
CD Rom

Language Used

1. C++

#include<iostream.h>
#include <stdio.h>

#include <conio.h>
#include <stdlib.h>
#include<fstream.h>

struct customer
{private: char name[20];
char indate[10], outdate[10];
char contact[15];
int rcode;
public: void getinfo();
void showinfo();

int roomcode()
{
return rcode;
}
}c;
void customer::getinfo()
{

cout<<"\n\n\n\n\t\t\t Enter Occupant's Name:";


gets(name);
cout<<"\n\n\t\t\t Enter Room Number. :";
cin>>rcode;

cout<<"\n\n\t\t\t Enter Contact No. :";


gets(contact);
cout<<"\n\n\t\t\t Enter CheckIn Date:";
gets(indate);
cout<<"\n\n\t\t\t Enter CheckOut Date:";
gets(outdate);
getch();
}
void customer::showinfo()
{
cout<<"\n\n\t\t\tRoom No.:"<<" "<<rcode;
cout<<"\n\n\t\t\tOccupant's Name:"<<" "<<name;
cout<<"\n\n\t\t\tContact No:"<<" "<<contact;
cout<<"\n\n\t\t\tCheckIn Date:"<<" "<<indate;
cout<<"\n\n\t\t\tCheckOut Date:"<<" "<<outdate;
getch();
}
void reservation()
{

ofstream f;
f.open("cust.dat",ios::out|ios::app|ios::binary);
c.getinfo();
cout<<"\n\n\t You have entered the following Details.";

c.showinfo();
f.write((char*)&c,sizeof(c));
f.close();
}

void status()
{

clrscr();
ifstream f3;
int flag=0;
int vcode;
cout<<"\n\n\n\n\t\t\tEnter Room No. to be Verified:";
cin>> vcode;
f3.open("cust.dat",ios::in|ios::binary);
if(!f3)
{cout<<"\n\n\n\t\t\t DATABASE ERROR!!..Try After Some Time.. ";
getch();
exit(0);
}
while(f3.read((char*)&c, sizeof(c)))
{
if(c.roomcode()==vcode)
{

cout<<"\n\n\n\t\t\t\t\t Reservation Found!";

c.showinfo();
flag=1;
}
}
if(flag==0)
{
cout<<"\n\n\t\t\t Sorry! Reservation doesn't exist.";
getch();
}
f3.close();
}

void cancellation(int vcode)


{

clrscr();
char found='f',confirm='n';
ifstream f1("cust.dat",ios::in|ios::binary);
ofstream f2("t.dat",ios::out|ios::app|ios::binary);
while(f1.read((char*)&c,sizeof(c)))
{
if(c.roomcode()==vcode)
{
cout<<"\n\n\t\t\t\t Reservation Found.";

c.showinfo();
found='t';
cout<<"\n\n\t\t\tAre u sure to Cancel? (y/n)..";
cin>>confirm;
if ((confirm=='y'||confirm=='Y'))
{
cout<<"\n\n\n\t\t\t Reservation Cancelled.";
}
else
{
f2.write((char*)&c,sizeof(c));
cout<<"\n\n\t\t\tCancellation Aborted by user.";
}
}
else
{
f2.write((char*)&c,sizeof(c));
}
}
if(found=='f')
cout<<"\n\n\t Sorry! Reservation not found. Please check your Room No.
and Try again.";

getch();
f1.close();
f2.close();
remove("cust.dat");
rename("t.dat","cust.dat");
}

void main()
{
int ch;
char d;
clrscr();
cout<<"\n\n\n\n\n\n\n\n\n\n\t\t\t*************************************";
cout<<"\n\t\t\t*************************************";
cout<<"\n\n\t\t\t
cout<<"\n\n\t\t\t

HOTEL MANAGEMENT SYSTEM


DESIGNED BY:

";

";

cout<<"\n\n\t\t\TSATISH CHANDER ";


cout<<"\n\n\t\t\t
cout<<"\n\n\t\t\t

Of

";

St. Xaviers Convent School

";

cout<<"\n\n\n\t\t\t Subject Teacher: Mr. Parveen & Rachit Gupta


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

";

getch();
clrscr();
label:
cout<<"\n\n\n\n\n\t\t\t MAIN MENU"<<endl;
cout<<"\n\t\t\t***********";
cout<<"\n\n\n\t\t\t1.RESERVATION:";
cout<<"\n\n\n\t\t\t2.ROOM STATUS:";
cout<<"\n\n\n\t\t\t3.CANCELLATION:";
cout<<"\n\n\n\t\t\t4.QUIT:";
cout<<"\n\n\n\t\t\tENTER YOUR CHOICE:";
cin>>ch;
{
switch(ch)
{
case 1: clrscr();
do
{

clrscr();
reservation();
cout<<"\n\n\t\tWant to continue(y/n)?..";
cin>>d;
clrscr();

}while(d=='y'||d=='Y');

goto label;
case 2:

do
{
status();
cout<<"\n\n\t\tWant to continue(y/n)?..";
cin>>d;
clrscr();
}while(d=='y'||d=='Y');
goto label;

case 3: int c_rno;


do
{

clrscr();
cout<<"\n\n\n\n\t\t\tEnter Room No. to be Cancelled:";
cin>> c_rno;
cancellation(c_rno);
cout<<"\n\n\t\tWant to continue(y/n)?..";
cin>>d;
clrscr();

}while(d=='y'||d=='Y');
goto label;
case 4: exit(0);
default:{cout<<"WRONG CHOICE..........TRY AGAIN";

goto label;
}}
}
}

S-ar putea să vă placă și