hotel management project

103
MARUDHAR ENGINEERING MARUDHAR ENGINEERING COLLEGE COLLEGE A PROJECT ON HOTEL MANAGEMENT Submited to Submitted by: Ms. Anjali singh NEHA KHATRI 1 Lect. Deptt. Of C.S. Engg .

Upload: meena-sharma

Post on 20-Feb-2015

214 views

Category:

Documents


10 download

TRANSCRIPT

Page 1: Hotel Management Project

MARUDHAR ENGINEERINGMARUDHAR ENGINEERING COLLEGECOLLEGE

A PROJECT

ON

HOTEL MANAGEMENT

Submited to Submitted by:

Ms. Anjali singh NEHA KHATRI 1 Lect. Deptt. Of C.S. Engg .

Page 2: Hotel Management Project

ACKNOWLEDGEMENT

We have to express our thanks unreserved by towards Ms. Anjali Singh

for the expert and valuable guidance lent to us in completing this project

work assigned to us. The tips provided by them stood us to good stead in

accomplishing our work to the best of level form our side. Our heart goes

out with deep gratitude to them, for the perennial patronage in our studies

and especially this project work. We are sure to be largely helped by the

experience of the project worked in the time to come.

NEHA KHATRI

1

Page 3: Hotel Management Project

PREFACE

Computer Programming is an art. It is a way of explaining how a specific task is to be performed by

a given computer driven by speedy development in the underlying hardware, compile programs have

become considerably complex and bigger.

Contrary to popular belief computer programming can be both fun and an excellent opportunity to

exercise your mind, creativity and imagination. It gives us the power to instruct computers according

to our will. With highly powerful work horses at disposal, there is no limit to what we can do with the

help of programming languages. The only limit being our own imagination.

Computer programming is that art which creates an artist in you and increase the capability of

imagination…

We again convey our thanks to Ms. Anjali Singh for their great guidance and precious time without

this it is impossible for us to complete the project.

Page 4: Hotel Management Project

Contents

Introduction

Objectives

Scope

H/W & S/W Requirements

System Development life cycle(SDLC)

Phases of SDL

Project category.

Analysis (DFDs, ER Diagrams, Class Diagrams etc.)

Coding

Screens(forms)

Implementation & testing

A complete structure which includes :

(i) Number of modules and their description to provide an estimation of the student’s effort on the project .

(ii) Data Structures as per the project requirements for all the modules.

(iii) Process Logic of each module.

(iv) Report generation.

Security and Validation Checks..

Conclusions

Bibliography

Page 5: Hotel Management Project

HOTEL MANAGEMENT SYSTEM

INTRODUCTION

This project is aimed at developing a system that is an easy to operate user friendly,economically priced

software that commited to meet the all requirements to manage small,medium and big scale hotels..I have tried

my best to make the complicated process of Hotel Management System as simple

as possible using Structured & Modular technique & Menu oriented interface. I have tried

to design the software in such a way that user may not have any difficulty in using this

package & further expansion is possible without much effort. Even though I cannot claim

that this work to be entirely exhaustive, the main purpose of my exercise is perform each

Employee’s activity in computerized way rather than manually which is time consuming.

I am confident that this software package can be readily used by non-programming

personal avoiding human handled chance of error. This project is used by two types of

users

i. Online Users.

ii. Administrator (management of the Hotel).

Online users can see the required articles or news

Administrator can maintain daily updates in the hotel records. Administrator is must be

an authorized user. He can further change the password. There is the facility for password

Page 6: Hotel Management Project

recovery, logout etc.

The main aim of the entire activity is to automate the process of day to day activities of

Hotel like Room activities, Admission of a New Customer, Assign a room according to

customer’s demand, checkout of a computer and releasing the room and finally compute

the bill etc.

The limited time and resources have restricted us to incorporate, in this project, only a

main activities that are performed in a HOTEL Management System, but utmost care has

been taken to make the system efficient and user friendly. “HOTEL Management

System” has been designed to computerized the following functions that are performed

by the system:

Room Detail Functions

Opening a New Room

Modification to room assigned

Check-in and check-out Detail Functions

Admission of New customer

Check-out of customer

Room assigning related to customer’s need.

Statement of Customer Details

Check-in customer

Check-out customer

Room Details

Total number of Customers in the Hotel

Individual customer Report

OBJECTIVE

During the past several decades personnel function has been transformed from a

relatively obscure record keeping staff to central and top level management function.

There are many factors that have influenced this transformation like technological

advances, professionalism, and general recognition of human beings as most important

resources.

A computer based management system is designed to handle all the primary

information required to calculate monthly statements. Separate database is

maintained to handle all the details required for the correct statement calculation

and generation.

This project intends to introduce more user friendliness in the various activities

such as record updation, maintenance, and searching.

The searching of record has been made quite simple as all the details of the

customer can be obtained by simply keying in the identification of that customer.

Similarly, record maintenance and updation can also be accomplished by using

the identification of the customer with all the details being automatically

Page 7: Hotel Management Project

generated. These details are also being promptly automatically updated in the

master file thus keeping the record absolutely up-to-date.

The entire information has maintained in the database or Files and whoever wants

to retrieve can’t retrieve, only authorization user can retrieve the necessary

information which can be easily be accessible from the file.

The main objective of the entire activity is to automate the process of day to day

activities of Hotel like:

1. Room activities,

2. Admission of a New Customer,

3. Assign a room according to customer’s demand,

4. Checkout of a computer and releasing the room

5. Finally compute the bill etc.

6. Packages available.

7. Advance online bookings.

8. Online Cancellation.

9. List of Regular customers.

10. Email facility.

11. Feedbacks

This project have some more features:

System Connectivity

No data duplication

No Paper Work Required

Time Efficient

Cost Efficient

Automatic data validation

User friendly environment

Data security and reliability

Fast data insertion & retrieval

Easy performance check

SCOPE

I have designed the given proposed system in the JSP to automate the process of Hotels.

This project is useful for the authorities which keep track of all the users registered in a

particular state .The authority can add hotel packages, room details, availability of rooms,

online booking etc.

The following steps that give the detailed information of the need of proposed system are:

Performance: During past several decades, the records are supposed to be manually

handled for all activities. The manual handling of the record is time consuming and

highly prone to error. To improve the performance of the Hotel Management System, the

Page 8: Hotel Management Project

computerized system is to be undertaken. This project is fully computerized and user

friendly even that any of the members can see the report and status of the company.

Efficiency: The basic need of this website is efficiency. The website should be efficient

so that whenever a new user submits his/her details the website is updated automatically.

This record will be useful for other users instantly.

Control: The complete control of the project is under the hands of authorized person who

has the password to access this project and illegal access is not supposed to deal with. All

the control is under the administrator and the other members have the rights to just see

the records not to change any transaction or entry.

Security: Security is the main criteria for the proposed system. Since illegal access may corrupt the database.

So security has to be given in this project.

Scope of Future Application

This project can be used in the hotel after adding some more useful modules in the

project for which hotel are providing services.

Utmost care and back-up procedures must be established to ensure 100% successful

implementation of the computerized hotel system. In case of system failure, the

organization should be in a position to process the transaction with another organization

or if the worst comes to the worst, it should be in a position to complete it manually.

Scope of Improvement

Now a days hotel are providing many other facilities, this project can also be improved

with the improvement in the Hotels.

Utmost care and back-up procedures must be established to ensure 100% successful

implementation of the computerized banking system. In case of system failure, the

organization should be in a position to process the transaction with another organization

or if the worst comes to the worst, it should be in a position to complete it manually.

SOFTWARE & HARDWARE REQIREMENT:

I used TURBO C and Windows XP with using Microsoft World to develop this software. So I have tested this

on the above configuration. But it can be run on any system which contains following requirements.

Minimum Software Requirements :

1. Windows 98 or Higher (Windows XP or 2000).

2.turbo c.

3. MicroSoft Office Picture Editor.

Minimum Hardware Requirements:

Page 9: Hotel Management Project

1. 3MB free Space on Harddisk (for Software)

2. Mouse & Keyboard (For Software Instruction)

3. CD-Rom or Any Installation Media

4. VGA or SVGA for Graphics

SYSTEM DEVELOPMENT LIFE CYCLE

The systems development life cycle is a project management technique that divides complex projects

into smaller, more easily managed segments or phases. Segmenting projects allows managers to verify the

successful completion of project phases before allocating resource to subsequent phases. Software

development projects typically include initiation, planning, design, development, testing, implementation, and

maintenance phases. However, the phases may be divided differently depending on the organization involved.

For example, initial project activities might be designated as request, requirements-definition, and planning

phases, or initiation, concept-development, and planning phases. End users of the system under development

should be involved in reviewing the output of each phase to ensure the system is being built phase to ensure the

system is being built to deliver the needed functionality.

Page 10: Hotel Management Project

.

Page 11: Hotel Management Project

Phases Of System Development Life Cycle

Initiation Phase

The Initiation Phase begins when a business sponsor identifies a need or an opportunity. The purpose of the

Initiation Phase is to:

1>Identify and validate an opportunity to improve business accomplishments of the organization or a

deficiency related to a business need.

2>Identify significant assumptions and constraints on solutions to that need.

3>Recommend the exploration of alternative concepts and methods to satisfy the need including

questioning the need for technology, i.e., will a change in the business process offer a solution?

4>Assure executive business and executive technical sponsorship.

The Sponsor designates a Project Manager and the business need is documented in a Concept Proposal.

The Concept Proposal includes information about the business process and the relationship to the

Agency/Organization Infrastructure and the Strategic Plan.

A successful Concept Proposal results in a Project Management Charter which outlines the authority of the

project manager to begin the project.

Careful oversight is required to ensure projects support strategic business objectives and resources are

effectively implemented into an organization's enterprise architecture. The initiation phase begins when an

opportunity to add, improve, or correct a system is identified and formally requested through the presentation

of a business case. The business case should, at a minimum, describe a proposal’s purpose, identify expected

benefits, and explain how the proposed system supports one of the organization’s business strategies.

The business case should also identify alternative solutions and detail as many informational, functional, and

network requirements as possible.

System Concept Development Phase

The System Concept Development Phase begins after a business need or opportunity is validated by the

Agency/Organization Program Leadership and the Agency/Organization CIO.

The purpose of the System Concept Development Phase is to:

1>Determine the feasibility and appropriateness of the alternatives.

2>Identify system interfaces.

3>Identify basic functional and data requirements to satisfy the business need. Establish system boundaries,

identify goals, objectives, critical success factors, and performance measures.

4>Evaluate costs and benefits of alternative approaches to satisfy the basic functional requirements .

5>Assess project risks.

Page 12: Hotel Management Project

6>Identify and initiate risk mitigation actions, and

7>Develop high-level technical architecture, process models, data models, and a concept of operations.

This phase explores potential ,technical solutions within the context of the business need.

It may include several trade-off decisions such as the decision to use COTS software products as opposed to

developing custom software or reusing software components, or the decision to use an incremental delivery

versus a complete, one- time deployment. Construction of executable prototypes is encouraged to evaluate

technology to support the business process.

The System Boundary Document serves as an important reference document to support the Information

Technology Project Request (ITPR) process. The ITPR must be approved by the

State CIO before the project can move forward.

Page 13: Hotel Management Project

Planning Phase The planning phase is the most critical step in completing development, acquisition, and maintenance projects.

Careful planning, particularly in the early stages of a project, is necessary to coordinate activities and manage

project risks effectively. The depth and formality of project plans should be commensurate with the

characteristics and risks of a given project.

Project plans refine the information gathered during the initiation phase by further identifying the specific

activities and resources required to complete a project. A critical part of a project manager’s job is to

Page 14: Hotel Management Project

coordinate discussions between user, audit, security, design, development, and network personnel to identify

and document as many functional, security, and network

requirements as possible.

During this phase, a plan is developed that documents the approach to be used and includes a discussion of

methods, tools, tasks, resources, project schedules, and user input.

Personnel assignments, costs, project schedule, and target dates are established.

A Project Management Plan is created with components related to acquisition planning, configuration

management planning, quality assurance

planning, concept of operations, system security, verification and validation and systems engineering

management planning.

Requirements Analysis Phase

This phase formally defines the detailed functional user requirements using high-level requirements identified

in the Initiation, System Concept, and Planning phases. It also delineates the requirements in terms of data,

system

performance, security, and maintainability requirements for the system. The requirements are defined in this

phase to a level of detail sufficient for systems design to proceed.

They need to be measurable, testable, and relate to the business need or opportunity identified in the Initiation

Phase. The requirements that will be used to determine acceptance of the system are captured in the Test and

Evaluation Master Plan. The purposes of this phase are to:

1>Further define and refine the functional

and data requirements and document them

in the Requirements Document,

2>Complete business process reengineering of the functions to be supported (i.e., verify what information

drives the business process, what information is generated,

who generates it, where does the information go, and who processes it),

3>Develop detailed data and process models (system inputs, outputs, and the process.

Page 15: Hotel Management Project

4>Develop the test and evaluation requirements that will be used to determine acceptable system

performance.

Design Phase

The design phase involves converting the informational, functional, and network requirements identified

during the initiation and planning phases into unified design specifications that developers use to script

programs during the development phase. Program designs are c onstructed in various ways. Using a top-down

approach, designers first identify and link major program components and interfaces, then expand design

layouts as they identify and link smaller subsystems and connections. Using a bottom-up approach, designers

first identify and link minor program components and interfaces, then expand design layouts as they identify

and link larger systems and connections.

Contemporary design techniques often use prototyping tools that build mock-up designs of items such as

application screens, database layouts, and system architectures. End users, designers, developers, database

managers, and network administrators should review and refine the prototyped designs in an iterative process

until they agree on an acceptable design. Audit, security, and quality assurance personnel should be involved in

the review and approval process.

During this phase, the system is designed to satisfy the functional requirements identified in the previous

phase. Since problems in the design phase could be very expensive to solve in the later stage of the software

development, a variety of elements are considered in the design to mitigate risk. These include:

1> Identifying potential risks and defining design features.

2> Performing a security risk assessment.

3> Developing a conversion plan to migrate current data to the new system.

4> Determining the operating environment.

5> Defining major subsystems and their inputs and outputs.

6> Allocating processes to resources.

7> Preparing detailed logic specifications for each software module.

The result is a draft System Design Document which captures the preliminary design for the system.

Everything requiring user input or approval is documented and reviewed by the user.

Once these documents have been approved by the Agency CIO and Business Sponsor, the final System Design

Document is created to serve as the Critical/Detailed Design for the system. This document receives a rigorous

review by Agency technical and functional representatives to ensure that it satisfies the business requirements.

Concurrent with the development of the system design, the Agency Project Manager begins development of

the Implementation Plan, Operations and Maintenance Manual, and the Training Plan.

Development Phase

The development phase involves converting design specifications

Page 16: Hotel Management Project

into executable programs. Effective development standards include requirements that programmers and other

project participants discuss design specifications before programming begins. The procedures help ensure

programmers clearly understand program designs and functional requirements.

Programmers use various techniques to develop computer programs. The large

transaction-oriented programs associated with financial institutions have traditionally been developed using

procedural programming

techniques.

Procedural programming involves the line-by-line scripting of logical instructions that are combined to form a

program.

Effective completion of the previous stages is a key factor in the success of the Development phase. The

Development phase consists of:

1>Translating the detailed requirements and

design into system components.

2>Testing individual elements (units) for

usability.

3>Preparing for integration and testing of the IT system.

PROJECT CATEGORY

This Project is coupled with material on how to use the various tool, subsets available in

JSP, SERVLETS AND MY SQL.

The need of today’s software development is competence in a GUI based front-end tool,

which can connect to Relational Database engines. This gives the programmer the

opportunity to develop client server based commercial applications.

These applications give users the power and ease of a GUI with the multi user

capabilities of Novell, UNIX or WinNT based RDBMS engines such as MY SQL .

All the important coding techniques used by programmers, in OOPS based coding is

brought out in full and in great detail.

Page 17: Hotel Management Project

System Study & Analysis

PRINCIPLES OF SYSTEM ANALYSIS

1. Understand the problem before you begin to create the analysis model.

2. Develop prototypes that enable a user to understand how human machine interaction

will occur.

3. Record the origin of and the reason for every requirement.

4. Use multiple views of requirements like building data, function and behavioral models.

5. Work to eliminate ambiguity.

ENTITY RELATIONSHIP DIAGRAM (ERD)

Entity – Relationship Diagram: This depicts relationship between data objects.

The attribute of each data objects noted in the entity- relationship diagram can be

described using a data object description. Data flow diagram serves two

purposes:

1. To provide an indication of how data are transformed as they move through

the system.

2. To depict the functions that transformation the data flow.

Data Objects: A data object is a representation of almost any composite

information that must be understood by the software. By composite information,

we mean something that has a number of different properties or attributes. A

data object encapsulates data only there is no reference within a data object to

operations that act on the data.

Attributes: Attributes define the properties of a data object and take on one of

three different characteristics. They can be used to:

Name an instance of data object.

Describe the instance.

Make reference to another instance in other table.

13

Relationships: Data objects are connected to one another in a variety of

different ways. We can define a set of object relationship pairs that define the

Page 18: Hotel Management Project

relevant relationships.

Page 19: Hotel Management Project
Page 20: Hotel Management Project
Page 21: Hotel Management Project
Page 22: Hotel Management Project
Page 23: Hotel Management Project
Page 24: Hotel Management Project

Screens

Page 25: Hotel Management Project
Page 26: Hotel Management Project
Page 27: Hotel Management Project
Page 28: Hotel Management Project

CODING:

#include<iostream.h>

#include<conio.h>

#include<stdio.h>

#include<string.h>

#include<stdio.h>

#include<process.h>

#include<fstream.h>

#include<ctype.h>

class menu

{

private :

void edit_records(void) ;

void report(void) ;

void roomf(void) ;

void customerf(void) ;

Page 29: Hotel Management Project

public :

void overview(void) ;

void main_menu(void) ;

void enter_password(void) ;

} ;

class room

{

private :

int recordno(int) ;

void display_record(int) ;

int roomno ;

char roomcode[5] , status ;

float tariff ;

public :

void add (void) ;

void modify(void) ;

void deletion(void) ;

void display_room_record(int) ;

void display_list(void) ;

int room_found( int ) ;

void change_status(int,char) ;

char room_status(int) ;

float get_data(int) ;

} ;

class customer

{

private :

Page 30: Hotel Management Project

int recordno(int) ;

void display_record(int) ;

void delete_record(int) ;

int roomno ;

char name[21] , phone[8] ;

float advance , misc , room_srv ;

public :

void add (void) ;

void modify(void) ;

void deletion(void) ;

void display_list(void) ;

void display_customer_record(int) ;

} ;

void menu :: main_menu(void)

{ int l;

char ch ;

clrscr();

gotoxy(3,2);

cout<<"SHANGRI-LA EROS HOTEL";

gotoxy(3,3);

cout<<"_____________________";

gotoxy(9,4);

cout<<"NEW DELHI";

gotoxy(55,2);

cout<<"19 Ashoka Road";

gotoxy(55,3);

cout<<"Cannaught Place";

Page 31: Hotel Management Project

gotoxy(55,4);

cout<<"New Delhi 110001,India";

gotoxy(55,5);

cout<<"T:(+9111) 4119 1919";

gotoxy(55,2);

cout<<"19 Ashoka Road";

gotoxy(30,11) ;

cout<<"1. EDIT RECORDS" ;

gotoxy(30,13) ;

cout<<"2. DISPLAY ROOM RECORDS" ;

gotoxy(30,15) ;

cout<<"3. DISPLAY CUSTOMER RECORDS" ;

gotoxy(30,17) ;

cout<<"4. EXIT TO DOS";

gotoxy(30,23) ;

cout<<"Enter your choice : " ;

cin>>ch;

if ( ch == '3' )

{

char ans;

do

{

clrscr();

cout<<"enter the room of customer to be displayed";

cin>>l;

customer c ;

c.display_customer_record(l) ;

cout<<"\ndo you wish to see more records(Y OR N)";

cin>>ans;

Page 32: Hotel Management Project

}while(ans=='Y');

main_menu();

}

else

if ( ch == '2' )

{

char ans1;

do

{

clrscr();

int m;

cout<<"enter room to be displayed";

cin>>m;

room r ;

r.display_room_record(m) ;

cout<<"\ndo u wish to see more reccords";

cin>>ans1;

} while(ans1=='Y');

main_menu();

}

else

if ( ch == '1' )

edit_records() ;

if ( ch == '4' )

{

clrscr();

gotoxy(26,10);

cout<<" THANK U FOR USING OUR PROJECT ";

Page 33: Hotel Management Project

getch();

gotoxy(32,12);

cout<<" HAVE A NICE DAY " ;

getch();

exit(0);

}

}

void menu :: edit_records(void)

{

int ch ;

while(ch!=3)

{

clrscr() ;

gotoxy(34,4) ;

cout<<" EDIT" ;

gotoxy(30,8) ;

cout<<"1. ROOM RECORDS" ;

gotoxy(30,10) ;

cout<<"2. CUSTOMER RECORDS" ;

gotoxy(30,12) ;

cout<<"3. BACK" ;

gotoxy(30,15) ;

cout<<"Enter your choice : " ;

cin>>ch;

getch() ;

if ( ch == 1 )

roomf() ;

else

Page 34: Hotel Management Project

if ( ch == 2 )

customerf() ;

else

if ( ch == 3 )

main_menu();

}

}

void menu :: roomf(void)

{

int ch ;

while(1)

{

clrscr() ;

gotoxy(34,4);

cout<<"EDIT ROOM";

gotoxy(30,8) ;

cout<<"1. ADD ROOM RECORDS" ;

gotoxy(30,10) ;

cout<<"2. MODIFY ROOM RECORDS" ;

gotoxy(30,12) ;

cout<<"3. DELETE ROOM RECORDS" ;

gotoxy(30,14) ;

cout<<"4. BACK" ;

gotoxy(30,17) ;

cout<<"Enter your choice : " ;

cin>>ch;

getch();

if ( ch == 1 )

Page 35: Hotel Management Project

{

room r;

r.add();

}

if ( ch == 2 )

{

room r ;

r. modify() ;

}

else

if ( ch == 3 )

{

room r ;

r.deletion() ;

}

else

if ( ch == 4 )

break ;

}

}

void menu :: customerf(void)

{

int ch ;

while(ch!=4)

{

clrscr() ;

gotoxy(34,4);

cout<<"EDIT CUSTOMER";

gotoxy(30,8) ;

Page 36: Hotel Management Project

cout<<"1. ADD CUSTOMER RECORDS" ;

gotoxy(30,10) ;

cout<<"2. MODIFY CUSTOMER RECORDS" ;

gotoxy(30,12) ;

cout<<"3. DElETE" ;

gotoxy(30,14) ;

cout<<"4. BACK" ;

gotoxy(30,17) ;

cout<<"Enter your choice : " ;

cin>>ch;

getch() ;

if ( ch == 1 )

{

customer c ;

c.add() ;

}

else

if ( ch == 2 )

{

customer c ;

c.modify() ;

}

/* else

if ( ch== 3 )

{

customer c ;

c.deletion() ;

}

else */

Page 37: Hotel Management Project

if(ch== 4 )

{

break;

}

}

}

void room :: add (void)

{

char ch ;

char x;

char t_rcode[5] ;

int t_roomno ;

char t_status ;

float t_tariff ;

do

{

fstream file ;

file.open("ROOM.DAT", ios::out | ios::app ) ;

clrscr() ;

gotoxy(1,1) ;

cout<<"Enter the details for the room" ;

gotoxy(1,3) ;

cout<<"Code : " ;

gotoxy(1,4) ;

cout<<"Room no. : " ;

gotoxy(1,5) ;

cout<<"Status : " ;

gotoxy(1,6) ;

cout<<"Tariff : " ;

Page 38: Hotel Management Project

gotoxy(20,11) ;

cout<<"SS : SINGLE SUITE" ;

gotoxy(20,12) ;

cout<<"DSS : DELUXE SUITE (Single Bed) " ;

gotoxy(20,13) ;

cout<<"DSD : DELUXE SUITE (Double Bed) " ;

gotoxy(20,14) ;

cout<<"PS : PRESIDENTIAL SUITE" ;

int valid = 0 ;

do

{

valid = 1 ;

gotoxy(1,25) ;

cout<<"ENTER THE ROOM CODE (SS/DSS/DSD/PS)" ;

gotoxy(13,3) ;

gets(t_rcode) ;

int result;

char string[3],string1[3],string2[3],string3[3];

strcpy(string,"SS");

strcpy(string1,"DSS");

strcpy(string2,"DSD");

strcpy(string3,"PS");

if(strcmp(t_rcode,string)==0||strcmp(t_rcode,string1)==0||strcmp(t_rcode,string2)==0||

strcmp(t_rcode,string3)==0)

{

result=0;

}

else

{

Page 39: Hotel Management Project

result=1;

}

if (result==1)

{

valid = 0 ;

gotoxy(1,25) ; clreol() ;

gotoxy(1,24) ;

cout<<"INVALID CODE" ;

gotoxy(1,25) ;

cout<<"Press any key to continue..." ;

getch() ;

gotoxy(1,24) ; clreol() ;

gotoxy(1,25) ; clreol() ;

gotoxy(13,3) ; clreol() ;

}

} while ( valid == 0 ) ;

for ( int i=11; i<=14; i++ )

{

gotoxy(1,i) ; clreol() ;

}

do

{

valid = 1 ;

gotoxy(1,25) ; clreol() ;

gotoxy(1,25) ;

cout<<"ENTER THE ROOM NUMBER" ;

gotoxy(13,4) ;

cin>>t_roomno ;

getch();

Page 40: Hotel Management Project

if ( t_roomno <= 0 || t_roomno > 900 )

{

valid = 0 ;

gotoxy(1,25) ; clreol() ;

gotoxy(1,24) ;

cout<<"IT SHOULD NOT BE NEGATIVE OR ZERO OR GREATER THAN

900" ;

gotoxy(1,25) ;

cout<<"Press any key to continue..." ;

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

cout<<"ROOM NO. ALREADY EXIST" ;

gotoxy(1,25) ;

cout<<"Press any key to continue..." ;

getch() ;

gotoxy(1,24) ; clreol() ;

gotoxy(1,25) ; clreol() ;

gotoxy(13,4) ; clreol() ;

}

} while ( valid!=1 ) ;

do

Page 41: Hotel Management Project

{

valid = 1 ;

gotoxy(1,25) ; clreol() ;

gotoxy(1,25) ;

cout<<"ENTER THE ROOM STATUS : V=vacant, O=occupied" ;

gotoxy(13,5) ;

cin>>t_status ;

t_status = toupper(t_status) ;

if (t_status != 'O' && t_status != 'V')

{

valid = 0 ;

gotoxy(1,25) ; clreol() ;

gotoxy(1,24) ;

cout<<"INVALID DATA ENTERED" ;

gotoxy(1,25) ;

cout<<"Press any key to continue..." ;

getch() ;

gotoxy(1,24) ; clreol() ;

gotoxy(1,25) ; clreol() ;

gotoxy(13,5) ; clreol() ;

}

} while ( valid!=1 ) ;

do

{

valid = 1 ;

gotoxy(1,25) ; clreol() ;

gotoxy(1,25) ;

cout<<"ENTER THE TARIFF FOR THE ROOM" ;

gotoxy(13,6) ;

Page 42: Hotel Management Project

cin>>t_tariff ;

getch();

if ( t_tariff <= 0 )

{

valid = 0 ;

gotoxy(1,25) ; clreol() ;

gotoxy(1,24) ;

cout<<"IT SHOULD NOT BE NEGATIVE OR ZERO" ;

gotoxy(1,25) ;

cout<<"Press any key to continue..." ;

getch() ;

gotoxy(1,24) ; clreol() ;

gotoxy(1,25) ; clreol() ;

gotoxy(13,6) ; clreol() ;

}

} while ( valid!=1 ) ;

gotoxy(1,8) ;

cout<<"Do you want to save the record (y/n) : " ;

do

{

valid = 1 ;

gotoxy(42,8) ;

cin>>ch;

getch() ;

ch = toupper(ch) ;

if (ch != 'Y' && ch != 'N')

{

valid = 0 ;

gotoxy(42,8) ; clreol() ;

Page 43: Hotel Management Project

}

} while ( valid!=1 ) ;

if (ch == 'Y')

{

strcpy(roomcode,t_rcode) ;

roomno = t_roomno ;

status = t_status ;

tariff = t_tariff ;

file.write((char *) this, sizeof(room)) ;

}

gotoxy(1,9) ;

cout<<"Do you want to add more records (y/n) : " ;

do

{

valid = 1 ;

gotoxy(42,9) ;

cin>>ch;

getch() ;

ch = toupper(ch) ;

if (ch != 'Y' && ch != 'N')

{

valid = 0 ;

gotoxy(42,9) ; clreol() ;

}

} while ( valid!=1 ) ;

file.close () ;

} while ( ch == 'Y') ;

} void room :: modify(void)

{

Page 44: Hotel Management Project

clrscr() ;

int valid ;

char ch ;

char t_rcode[5] ;

int t_roomno , tr ;

char t_status ;

float t_tariff ;

gotoxy(1,3) ;

cout<<"Enter the Room no. to be modified " ;

cin>>tr ;

getch();

if ( room_found( tr )!=1 )

{

gotoxy(1,25) ; clreol() ;

gotoxy(1,24) ;

cout<<"ROOM NO. NOT FOUND" ;

gotoxy(1,25) ;

cout<<"Press any key to continue..." ;

getch() ;

return ;

}

display_record(tr) ;

gotoxy(1,10) ;

cout<<"Do you want to modify this Room Record (y/n) : " ;

do

{

valid = 1 ;

gotoxy(48,10) ;

cin>>ch;

Page 45: Hotel Management Project

getch() ;

ch = toupper(ch) ;

if (ch != 'Y' && ch != 'N')

{

valid = 0 ;

gotoxy(42,9) ; clreol() ;

}

} while ( valid!=1 ) ;

if (ch == 'N')

return ;

gotoxy(1,12) ;

cout<<"ENTER THE NEW DATA FOR THE ROOM" ;

gotoxy(1,14) ;

cout<<"Code : " ;

gotoxy(1,15) ;

cout<<"Room no. : " ;

gotoxy(1,16) ;

cout<<"Status : " ;

gotoxy(1,17) ;

cout<<"Tariff : " ;

do

{

valid = 1 ;

gotoxy(1,25) ;

cout<<"ENTER THE ROOM CODE (SS/DSS/DSD/PS)" ;

gotoxy(13,14) ;

gets(t_rcode) ;

int result;

char string[3],string1[3],string2[3],string3[3];

Page 46: Hotel Management Project

strcpy(string,"SS");

strcpy(string1,"DSS");

strcpy(string2,"DSD");

strcpy(string3,"PS");

if(strcmp(t_rcode,string)==0||strcmp(t_rcode,string1)==0||strcmp(t_rcode,string2)==0||

strcmp(t_rcode,string3)==0)

{

result=0;

}

else

{

result=1;

}

if (result==1)

{

valid = 0 ;

gotoxy(1,25) ; clreol() ;

gotoxy(1,24) ;

cout<<"INVALID CODE" ;

gotoxy(1,25) ;

cout<<"Press any key to continue..." ;

getch() ;

gotoxy(1,24) ; clreol() ;

gotoxy(1,25) ; clreol() ;

gotoxy(13,14) ; clreol() ;

}

} while ( valid == 0 );

do

Page 47: Hotel Management Project

{

valid = 1 ;

gotoxy(1,25) ; clreol() ;

gotoxy(1,25) ;

cout<<"ENTER THE ROOM NUMBER" ;

gotoxy(13,15) ;

cin>>t_roomno ;

getch();

if ( t_roomno <= 0 || t_roomno > 900 )

{

valid = 0 ;

gotoxy(1,25) ; clreol() ;

gotoxy(1,24) ;

cout<<"IT SHOULD NOT BE NEGATIVE OR ZERO OR GREATER THAN

900" ;

gotoxy(1,25) ;

cout<<"Press any key to continue..." ;

getch() ;

gotoxy(1,24) ; clreol() ;

gotoxy(1,25) ; clreol() ;

gotoxy(13,15) ; clreol() ;

}

if ( room_found( t_roomno ) && t_roomno != tr )

{

valid = 0 ;

gotoxy(1,25) ; clreol() ;

gotoxy(1,24) ;

cout<<"ROOM NO. ALREADY EXIST" ;

gotoxy(1,25) ;

Page 48: Hotel Management Project

cout<<"Press any key to continue..." ;

getch() ;

gotoxy(1,24) ; clreol() ;

gotoxy(1,25) ; clreol() ;

gotoxy(13,15) ; clreol() ;

}

} while ( valid!=1 ) ;

do

{

valid = 1 ;

gotoxy(1,25) ; clreol() ;

gotoxy(1,25) ;

cout<<"ENTER THE ROOM STATUS : V=vacant, O=occupied" ;

gotoxy(13,16) ;

cin>>t_status ;

getch();

t_status = toupper(t_status) ;

if (t_status != 'O' && t_status != 'V')

{

valid = 0 ;

gotoxy(1,25) ; clreol() ;

gotoxy(1,24) ;

cout<<"INVALID DATA ENTERED" ;

gotoxy(1,25) ;

cout<<"Press any key to continue..." ;

getch() ;

gotoxy(1,24) ; clreol() ;

gotoxy(1,25) ; clreol() ;

gotoxy(13,16) ; clreol() ;

Page 49: Hotel Management Project

}

} while ( valid!=1 ) ;

do

{

valid = 1 ;

gotoxy(1,25) ; clreol() ;

gotoxy(1,25) ;

cout<<"ENTER THE TARIFF FOR THE ROOM" ;

gotoxy(13,17) ;

cin>>t_tariff ;

getch();

if ( t_tariff <= 0 )

{

valid = 0 ;

gotoxy(1,25) ; clreol() ;

gotoxy(1,24) ;

cout<<"IT SHOULD NOT BE NEGATIVE OR ZERO" ;

gotoxy(1,25) ;

cout<<"Press any key to continue..." ;

getch() ;

gotoxy(1,24) ; clreol() ;

gotoxy(1,25) ; clreol() ;

gotoxy(13,17) ; clreol() ;

}

} while ( valid!=1 ) ;

gotoxy(1,19) ;

cout<<"Do you want to save the record (y/n) : " ;

cin>>ch;

do

Page 50: Hotel Management Project

{

valid = 1 ;

gotoxy(42,19) ;

ch = getch() ;

ch = toupper(ch) ;

if (ch != 'Y' && ch != 'N')

{

valid = 0 ;

gotoxy(42,19) ; clreol() ;

}

} while ( valid!=1 ) ;

if (ch == 'Y')

{

fstream file ;

file.open("ROOM.DAT", ios::in) ;

fstream temp ;

temp.open("temp.dat", ios::out) ;

while ( !file.eof() )

{

file.read((char *) this, sizeof(room)) ;

if ( roomno == tr )

{

strcpy(roomcode,t_rcode);

roomno=t_roomno;

status=t_status;

tariff=t_tariff;

Page 51: Hotel Management Project

temp.write((char *) this, sizeof(room)) ;

}

else

{

temp.write((char *) this,sizeof(room));

}

}

file.close() ;

temp.close() ;

file.open("ROOM.DAT", ios::out) ;

temp.open("temp.dat", ios::in) ;

temp.seekg(0) ;

while ( !temp.eof() )

{

temp.read((char *) this, sizeof(room)) ;

file.write((char *) this, sizeof(room)) ;

}

file.close() ;

temp.close() ;

remove("temp.dat");

}

}

void room :: deletion(void)

{

clrscr() ;

int valid ;

char ch ;

int t_roomno ;

Page 52: Hotel Management Project

gotoxy(1,3) ;

cout<<"Enter the Room no. to be deleted " ;

cin>>t_roomno ;

if ( !room_found( t_roomno ) )

{

gotoxy(1,25) ; clreol() ;

gotoxy(1,24) ;

cout<<"ROOM NO. NOT FOUND" ;

gotoxy(1,25) ;

cout<<"Press any key to continue..." ;

getch() ;

return ;

}

display_record(t_roomno) ;

gotoxy(1,10) ;

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

do

{

valid = 1 ;

gotoxy(48,10) ;

cin>>ch ;

getch() ;

ch = toupper(ch) ;

if (ch != 'Y' && ch != 'N')

{

valid = 0 ;

gotoxy(42,9) ; clreol() ;

}

} while ( !valid ) ;

Page 53: Hotel Management Project

if (ch == 'N')

return ;

fstream file ;

file.open("ROOM.DAT", ios::in) ;

fstream temp ;

temp.open("temp.dat", ios::out) ;

while ( !file.eof() )

{

file.read((char *) this, sizeof(room)) ;

if ( roomno == t_roomno )

{

}

else

{

temp.write((char *) this,sizeof(room));

}

}

file.close() ;

temp.close() ;

file.open("ROOM.DAT", ios::out) ;

temp.open("temp.dat", ios::in) ;

temp.seekg(0) ;

while ( !temp.eof() )

{

temp.read((char *) this, sizeof(room)) ;

file.write((char *) this, sizeof(room)) ;

Page 54: Hotel Management Project

}

file.close() ;

temp.close() ;

remove("temp.dat");

}

int room :: room_found ( int t_roomno )

{

fstream file ;

file.open("ROOM.DAT", ios::in) ;

file.seekg(0) ;

int found = 0 ;

while (file.read((char *) this, sizeof(room)))

{

if ( roomno == t_roomno )

found = 1 ;

}

file.close() ;

return found ;

}

void room :: display_record(int t_roomno)

{

fstream file ;

file.open("ROOM.DAT", ios::in) ;

file.seekg(0) ;

int found = 0 ;

while (file.read((char *) this, sizeof(room)) && !found)

{

if (t_roomno == roomno)

Page 55: Hotel Management Project

{

found = 1 ;

gotoxy(1,5) ;

cout<<"Room code : " <<roomcode ;

gotoxy(1,6) ;

cout<<"Room no. : " <<roomno ;

gotoxy(1,7) ;

cout<<"Status : " <<status ;

gotoxy(1,8) ;

cout<<"Tariff : " <<tariff ;

}

}

file.close () ;

}

void room :: display_room_record(int t_roomno)

{

fstream file ;

file.open("ROOM.DAT", ios::in) ;

file.seekg(0) ;

int found = 0 ;

while (file.read((char *) this, sizeof(room)) && !found)

{

if (t_roomno == roomno)

{

found = 1 ;

gotoxy(1,5) ;

cout<<"Room code : " <<roomcode ;

gotoxy(1,6) ;

cout<<"Room no. : " <<roomno ;

Page 56: Hotel Management Project

gotoxy(1,7) ;

cout<<"Status : " <<status ;

gotoxy(1,8) ;

cout<<"Tariff : " <<tariff ;

}

}

file.close () ;

}

void customer :: add(void)

{

room r ;

menu m1;

char ch ;

int valid = 1 ;

int t_roomno , t_no_cust ;

char t_name[21] , t_address[35] , t_phone[8] , t_nation[16] , t_passport[30] ;

float t_advance , t_misc , t_room_srv ;

clrscr() ;

gotoxy(1,1) ;

cout<<"Enter the details of the Customer" ;

gotoxy(1,3) ;

cout<<"Room no. : " ;

gotoxy(1,4) ;

cout<<"Name : " ;

gotoxy(1,5) ;

cout<<"No. of guests : " ;

gotoxy(1,6) ;

Page 57: Hotel Management Project

cout<<"Address : " ;

gotoxy(1,7) ;

cout<<"Phone : " ;

gotoxy(1,8) ;

cout<<"Nationality : " ;

gotoxy(1,9) ;

cout<<"Passport no. : " ;

gotoxy(1,11) ;

cout<<"Advance : " ;

gotoxy(1,12) ;

cout<<"Miscellineous : " ;

gotoxy(1,13) ;

cout<<"Room service : " ;

char t_status;

do

{

valid=1;

gotoxy(20,3) ;

cin>>t_roomno ;

t_status = r.room_status(t_roomno) ;

if (!r.room_found(t_roomno) || t_status == 'O')

{ valid=0;

gotoxy(1,25) ; clreol() ;

gotoxy(1,24) ;

cout<<"ROOM NO. NOT FOUND OR NOT VACANT" ;

gotoxy(1,25) ;

cout<<"Press any key to continue..." ;

getch() ;

Page 58: Hotel Management Project

gotoxy(1,24) ; clreol() ;

gotoxy(1,25) ; clreol() ;

gotoxy(20,3) ; clreol() ;

}

}while(!valid);

do

{

valid = 1 ;

gotoxy(1,25) ; clreol() ;

gotoxy(1,25) ;

cout<<"ENTER THE NAME OF THE CUSTOMER" ;

gotoxy(20,4) ;

gets(t_name) ;

if ((strlen(t_name) <= 0) || (strlen(t_name) > 20))

{

valid = 0 ;

gotoxy(1,25) ; clreol() ;

gotoxy(1,24) ;

cout<<"LENGTH SHOULD NOT BE ZERO OR GREATER THAN 20" ;

gotoxy(1,25) ;

cout<<"Press any key to continue..." ;

getch() ;

gotoxy(1,24) ; clreol() ;

gotoxy(1,25) ; clreol() ;

gotoxy(20,4) ; clreol() ;

}

} while ( !valid ) ;

do

{

Page 59: Hotel Management Project

valid = 1 ;

gotoxy(1,25) ; clreol() ;

gotoxy(1,25) ;

cout<<"ENTER THE NO. OF GUESTS WITH THE CUSTOMER" ;

gotoxy(20,5) ;

cin>>t_no_cust ;

if ((t_no_cust < 0) || (t_no_cust > 4))

{

valid = 0 ;

gotoxy(1,25) ; clreol() ;

gotoxy(1,24) ;

cout<<"GUESTS SHOULD NOT BE LESS THAN 0 OR GREATER THAN 4" ;

gotoxy(1,25) ;

cout<<"Press any key to continue..." ;

getch() ;

gotoxy(1,24) ; clreol() ;

gotoxy(1,25) ; clreol() ;

gotoxy(20,5) ; clreol() ;

}

} while ( !valid ) ;

do

{

valid = 1 ;

gotoxy(1,25) ; clreol() ;

gotoxy(1,25) ;

cout<<"ENTER THE ADDRESS OF THE CUSTOMER" ;

gotoxy(20,6) ;

gets(t_address) ;

Page 60: Hotel Management Project

if ((strlen(t_address) <= 0) || (strlen(t_address) > 50))

{

valid = 0 ;

gotoxy(1,25) ; clreol() ;

gotoxy(1,24) ;

cout<<"LENGTH SHOULD NOT BE ZERO OR GREATER THAN 50" ;

gotoxy(1,25) ;

cout<<"Press any key to continue..." ;

getch() ;

gotoxy(1,24) ; clreol() ;

gotoxy(1,25) ; clreol() ;

gotoxy(20,6) ; 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,7) ;

cin>>t_phone ;

if ((strlen(t_phone) < 8 && strlen(t_phone) > 1) || (strlen(t_phone) > 8))

{

valid = 0 ;

gotoxy(1,25) ; clreol() ;

gotoxy(1,24) ;

cout<<"LENGTH SHOULD NOT LESS THAN 8 OR GREATER THAN 8" ;

Page 61: Hotel Management Project

gotoxy(1,25) ;

cout<<"Press any key to continue..." ;

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

cout<<"ENTER NATIONALITY OF THE CUSTOMER" ;

gotoxy(20,8) ;

gets(t_nation) ;

if ((strlen(t_nation) <= 0) || (strlen(t_nation) > 15))

{

valid = 0 ;

gotoxy(1,25) ; clreol() ;

gotoxy(1,24) ;

cout<<"LENGTH SHOULD NOT LESS THAN ZERO OR GREATER THAN

15" ;

gotoxy(1,25) ;

cout<<"Press any key to continue..." ;

getch() ;

gotoxy(1,24) ; clreol() ;

gotoxy(1,25) ; clreol() ;

Page 62: Hotel Management Project

gotoxy(20,8) ; clreol() ;

}

} while ( !valid ) ;

do

{

valid = 1 ;

gotoxy(1,25) ; clreol() ;

gotoxy(1,25) ;

cout<<"ENTER PASSPORT NO. OF THE CUSTOMER" ;

gotoxy(20,9) ;

gets(t_passport) ;

if ((strlen(t_passport) <= 0) || (strlen(t_passport) > 15))

{

valid = 0 ;

gotoxy(1,25) ; clreol() ;

gotoxy(1,24) ;

cout<<"LENGTH SHOULD NOT LESS THAN ZERO OR GREATER THAN

15" ;

gotoxy(1,25) ;

cout<<"Press any key to continue..." ;

getch() ;

gotoxy(1,24) ; clreol() ;

gotoxy(1,25) ; clreol() ;

gotoxy(20,9) ; clreol() ;

}

} while ( !valid ) ;

do

{

valid = 1 ;

Page 63: Hotel Management Project

gotoxy(1,25) ; clreol() ;

gotoxy(1,25) ;

cout<<"ENTER THE ADVANCE IN RS. " ;

gotoxy(20,11) ;

cin>>t_advance ;

if (t_advance < 0)

{

valid = 0 ;

gotoxy(1,25) ; clreol() ;

gotoxy(1,24) ;

cout<<"SHOULD NOT LESS THAN ZERO" ;

gotoxy(1,25) ;

cout<<"Press any key to continue..." ;

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

cout<<"ENTER THE MISCELLENIOUS CHARGES" ;

gotoxy(20,12) ;

cin>>t_misc ;

if (t_misc < 0)

{

Page 64: Hotel Management Project

valid = 0 ;

gotoxy(1,25) ; clreol() ;

gotoxy(1,24) ;

cout<<"SHOULD NOT LESS THAN ZERO" ;

gotoxy(1,25) ;

cout<<"Press any key to continue..." ;

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

cout<<"ENTER THE ROOM SERVICE CHARGES" ;

gotoxy(20,13) ;

cin>>t_room_srv ;

getch();

if (t_room_srv < 0)

{

valid = 0 ;

gotoxy(1,25) ; clreol() ;

gotoxy(1,24) ;

cout<<"SHOULD NOT LESS THAN ZERO" ;

gotoxy(1,25) ;

cout<<"Press any key to continue..." ;

Page 65: Hotel Management Project

getch() ;

gotoxy(1,24) ; clreol() ;

gotoxy(1,25) ; clreol() ;

gotoxy(20,13) ; clreol() ;

}

} while ( !valid ) ;

gotoxy(1,15) ;

cout<<"Do you want to save the record (y/n) : " ;

do

{

valid = 1 ;

gotoxy(42,15) ;

cin>>ch;

getch() ;

ch = toupper(ch) ;

if (ch != 'Y' && ch != 'N')

{

valid = 0 ;

gotoxy(42,15) ; clreol() ;

}

} while ( !valid ) ;

if (ch == 'Y')

{

r.change_status(t_roomno,'O') ;

fstream file ;

file.open("CUSTOMER.DAT", ios::out | ios::app ) ;

roomno = t_roomno ;

strcpy(name,t_name) ;

strcpy(phone,t_phone) ;

Page 66: Hotel Management Project

advance = t_advance ;

misc = t_misc ;

room_srv = t_room_srv ;

file.write((char*) this, sizeof(customer)) ;

file.close() ;

}

m1.main_menu() ;

}

void customer :: modify(void)

{

clrscr() ;

room r ;

int valid ;

char ch ;

int t_roomno , tr ;

char t_name[21] , t_phone[8] ;

float t_advance , t_misc , t_room_srv ;

fstream file ;

file.open("CUSTOMER.DAT", ios::ate) ;

gotoxy(1,3) ;

cout<<"Enter the Room no. of the customer to be modified " ;

cin>>tr ;

getch();

char t_status ;

t_status = r.room_status(tr) ;

if (!r.room_found(tr) || t_status == 'V')

{

gotoxy(1,25) ; clreol() ;

Page 67: Hotel Management Project

gotoxy(1,24) ;

cout<<"ROOM NO. NOT FOUND OR ROOM IS VACANT" ;

gotoxy(1,25) ;

cout<<"Press any key to continue..." ;

getch() ;

return ;

}

display_record(tr) ;

gotoxy(1,12) ;

cout<<"Do you want to modify this Room Record (y/n) : " ;

do

{

valid = 1 ;

gotoxy(48,12) ;

cin>>ch;

getch() ;

ch = toupper(ch) ;

if (ch != 'Y' && ch != 'N')

{

valid = 0 ;

gotoxy(42,12) ; clreol() ;

}

} while ( !valid ) ;

if (ch == 'N')

return ;

gotoxy(1,14) ;

cout<<"ENTER THE NEW DATA FOR THE CUSTOMER" ;

gotoxy(1,16) ;

cout<<"Room no. : " ;

Page 68: Hotel Management Project

gotoxy(1,17) ;

cout<<"Name : " ;

gotoxy(1,18) ;

cout<<"Phone : " ;

gotoxy(1,19) ;

cout<<"Advance : " ;

gotoxy(1,20) ;

cout<<"Miscellineous : " ;

gotoxy(1,21) ;

cout<<"Room service : " ;

do

{

valid = 1 ;

gotoxy(1,25) ; clreol() ;

gotoxy(1,25) ;

cout<<"ENTER THE ROOM NUMBER FOR CUSTOMER : " ;

gotoxy(20,16) ;

cin>>t_roomno ;

getch();

t_status = r.room_status(t_roomno) ;

if ((!r.room_found(t_roomno)) || (r.room_found(t_roomno) && t_roomno != tr &&

t_status == 'O'))

{

valid = 0 ;

gotoxy(1,25) ; clreol() ;

gotoxy(1,24) ;

cout<<"ROOM NO. NOT EXIST OR NOT VACANT" ;

gotoxy(1,25) ;

cout<<"Press any key to continue..." ;

Page 69: Hotel Management Project

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

cout<<"ENTER THE NAME OF THE CUSTOMER : " ;

gotoxy(20,17) ;

gets(t_name) ;

getch();

strupr(t_name) ;

fflush(stdin) ;

if ((strlen(t_name) <= 0) || (strlen(t_name) > 20))

{

valid = 0 ;

gotoxy(1,25) ; clreol() ;

gotoxy(1,24) ;

cout<<"LENGTH SHOULD NOT BE ZERO OR GREATER THAN 20" ;

gotoxy(1,25) ;

cout<<"Press any key to continue..." ;

getch() ;

gotoxy(1,24) ; clreol() ;

gotoxy(1,25) ; clreol() ;

gotoxy(20,17) ; clreol() ;

Page 70: Hotel Management Project

}

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

if ((strlen(t_phone) < 8 && strlen(t_phone) > 1) || (strlen(t_phone) > 8))

{

valid = 0 ;

gotoxy(1,25) ; clreol() ;

gotoxy(1,24) ;

cout<<"LENGTH SHOULD NOT LESS THAN 8 OR GREATER THAN 8" ;

gotoxy(1,25) ;

cout<<"Press any key to continue..." ;

getch() ;

gotoxy(1,24) ; clreol() ;

gotoxy(1,25) ; clreol() ;

gotoxy(20,18) ; clreol() ;

}

} while ( !valid ) ;

do

{

valid = 1 ;

gotoxy(1,25) ; clreol() ;

Page 71: Hotel Management Project

gotoxy(1,25) ;

cout<<"ENTER THE ADVANCE RS. " ;

gotoxy(20,19) ;

cin>>t_advance ;

getch();

if (t_advance < 0)

{

valid = 0 ;

gotoxy(1,25) ; clreol() ;

gotoxy(1,24) ;

cout<<"SHOULD NOT LESS THAN ZERO" ;

gotoxy(1,25) ;

cout<<"Press any key to continue..." ;

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

cout<<"ENTER THE MISCALLENIOUS CHARGES" ;

gotoxy(20,20) ;

cin>>t_misc ;

getch();

if (t_misc < 0)

Page 72: Hotel Management Project

{

valid = 0 ;

gotoxy(1,25) ; clreol() ;

gotoxy(1,24) ;

cout<<"SHOULD NOT LESS THAN ZERO" ;

gotoxy(1,25) ;

cout<<"Press any key to continue..." ;

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

cout<<"ENTER THE ROOM SERVICE CHARGES" ;

gotoxy(20,21) ;

cin>>t_room_srv ;

getch();

if (t_room_srv < 0)

{

valid = 0 ;

gotoxy(1,25) ; clreol() ;

gotoxy(1,24) ;

cout<<"SHOULD NOT LESS THAN ZERO" ;

gotoxy(1,25) ;

Page 73: Hotel Management Project

cout<<"Press any key to continue..." ;

getch() ;

gotoxy(1,24) ; clreol() ;

gotoxy(1,25) ; clreol() ;

gotoxy(20,21) ; clreol() ;

}

} while ( !valid ) ;

gotoxy(1,23) ;

cout<<"Do you want to save the record (y/n) : " ;

do

{

valid = 1 ;

gotoxy(42,23) ;

cin>>ch;

getch() ;

ch = toupper(ch) ;

if (ch != 'Y' && ch != 'N')

{

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

}

Page 74: Hotel Management Project

int recno ;

recno = recordno(tr) ;

int location ;

location = (recno-1) * sizeof(customer) ;

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 ;

file.write((char *) this, sizeof(customer)) ;

}

file.close () ;

}

void customer :: delete_record(int t_roomno)

{

fstream file ;

file.open("CUSTOMER.DAT", ios::in) ;

fstream temp ;

temp.open("temp.dat", ios::out) ;

while ( !file.eof() )

{

file.read((char *) this, sizeof(customer)) ;

if ( file.eof() )

break ;

if ( roomno != t_roomno )

temp.write((char *) this, sizeof(customer)) ;

}

Page 75: Hotel Management Project

file.close() ;

temp.close() ;

file.open("CUSTOMER.DAT", ios::out) ;

temp.open("temp.dat", ios::in) ;

temp.seekg(0) ;

while ( !temp.eof() )

{

temp.read((char *) this, sizeof(customer)) ;

if ( temp.eof() )

break ;

file.write((char *) this, sizeof(customer)) ;

}

file.close() ;

temp.close() ;

}

void customer :: deletion(void)

{

clrscr() ;

room r ;

int valid ;

char ch ;

int t_roomno ;

gotoxy(1,3) ;

cout<<"Enter the Room no. of the customer to be deleted " ;

cin>>t_roomno ;

char t_status ;

t_status = r.room_status(t_roomno) ;

if (!r.room_found(t_roomno) || t_status == 'V')

{

Page 76: Hotel Management Project

gotoxy(1,25) ; clreol() ;

gotoxy(1,24) ;

cout<<"ROOM NO. NOT FOUND OR ROOM IS VACANT" ;

gotoxy(1,25) ;

cout<<"Press any key to continue..." ;

getch() ;

return ;

}

display_record(t_roomno) ;

gotoxy(1,15) ;

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

do

{

valid = 1 ;

gotoxy(52,15) ;

cin>>ch ;

getch() ;

ch = toupper(ch) ;

if (ch != 'Y' && ch != 'N')

{

valid = 0 ;

gotoxy(52,15) ; clreol() ;

}

} while ( !valid ) ;

if (ch == 'N')

return ;

r.change_status(t_roomno,'V') ;

delete_record(t_roomno) ;

}

Page 77: Hotel Management Project

char room :: room_status(int t_roomno)

{

fstream file ;

file.open("ROOM.DAT", ios::in) ;

file.seekg(0) ;

int found = 0 ;

char t_status ;

while (file.read((char *) this, sizeof(room)) && !found)

{

if (t_roomno == roomno)

{

found = 1 ;

t_status = status ;

}

}

file.close () ;

return t_status ;

}

void room :: change_status(int t_roomno , char t_status)

{

int recno ;

recno = recordno(t_roomno) ;

fstream file ;

file.open("ROOM.DAT", ios::out | ios::ate) ;

int location ;

location = (recno-1) * sizeof(room) ;

file.seekp(location) ;

status = t_status ;

file.write((char *) this, sizeof(room)) ;

Page 78: Hotel Management Project

file.close () ;

}

void customer :: display_record(int t_roomno)

{

fstream file ;

file.open("CUSTOMER.DAT", ios::in) ;

file.seekg(0) ;

int found = 0 ;

while (file.read((char *) this, sizeof(customer)) && !found)

{

if (t_roomno == roomno)

{

found = 1 ;

gotoxy(1,5) ;

cout<<"Room no. : " <<roomno ;

gotoxy(1,6) ;

cout<<"Customer Name : " <<name ;

gotoxy(1,7) ;

cout<<"Phone no. : " <<phone ;

gotoxy(1,8) ;

cout<<"Advance : " <<advance ;

gotoxy(1,9) ;

cout<<"Misc. charges : " <<misc ;

gotoxy(1,10) ;

cout<<"Room Service Charges : " <<room_srv ;

}

}

file.close () ;

}

Page 79: Hotel Management Project

void customer :: display_customer_record(int t_roomno)

{

fstream file ;

file.open("CUSTOMER.DAT", ios::in) ;

file.seekg(0) ;

int found = 0 ;

while (file.read((char *) this, sizeof(customer)) && !found)

{

if (t_roomno == roomno)

{

found = 1 ;

gotoxy(1,5) ;

cout<<"Room no. : " <<roomno ;

gotoxy(1,6) ;

cout<<"Customer Name : " <<name ;

gotoxy(1,7) ;

cout<<"Phone no. : " <<phone ;

gotoxy(1,8) ;

cout<<"Advance : " <<advance ;

gotoxy(1,9) ;

cout<<"Misc. charges : " <<misc ;

gotoxy(1,10) ;

cout<<"Room Service Charges : " <<room_srv ;

}

}

file.close () ;

}

int customer :: recordno(int t_roomno)

{

Page 80: Hotel Management Project

fstream file ;

file.open("CUSTOMER.DAT", ios::in) ;

file.seekg(0) ;

int count = 0 ;

while (file.read((char *) this, sizeof(customer)))

{

count++ ;

if (t_roomno == roomno)

break ;

}

file.close() ;

return count ;

}

int room :: recordno(int t_roomno)

{

fstream file ;

file.open("ROOM.DAT", ios::in) ;

file.seekg(0) ;

int count = 0 ;

while (file.read((char *) this, sizeof(room)))

{

count++ ;

if (t_roomno == roomno)

break ;

}

file.close() ;

return count ;

}

void main ( void )

Page 81: Hotel Management Project

{ clrscr();

menu m ;

textmode(C80);

textbackground(WHITE);

textcolor(RED);

m.main_menu();

getch();

}

END OF PROGRAM

Integration and Test Phase :-

Subsystem integration, system, security, and user acceptance testing is conducted during the integration and

test phase. The user, with those responsible for quality assurance, validates that the functional requirements, as

defined in the functional

requirements document, are satisfied by the developed or modified system. OIT Security staff assess the

system security and issue a security certification and accreditation prior to installation/implementation.

Multiple levels of testing are performed, including:

1>Testing at the development facility by the contractor and possibly supported by end users.

2> Testing as a deployed system with end users working together with contract personnel.

3> Operational testing by the end user alone performing all functions.

Requirements are traced throughout testing,

a final Independent Verification & Validation evaluation is performed and all documentation is reviewed and

accepted prior to acceptance of the system.

Implementation Phase:-This phase is initiated after the system has been tested and accepted by the user. In this phase, the system is

installed to support the intended business functions.

System performance is compared to performance objectives established during the planning phase.

Implementation includes user notification, user training, installation of hardware, installation of software onto

Page 82: Hotel Management Project

production computers, and integration of the system into daily work processes. This phase continues until the

system is operating in production in accordance with the defined user requirements.

Operations and Maintenance Phase :-

The system operation is ongoing. The system is monitored for continued performance in accordance with user

requirements and needed system

modifications are incorporated. Operations continue as long as the system can be effectively adapted to

respond to the organization’s needs. When modifications or changes are identified, the system may reenter the

planning phase. The purpose of this phase is to:

1>Operate, maintain, and enhance the system .

2>Certify that the system can process sensitive information.

3>Conduct periodic assessments of the system to ensure the functional requirements continue to be satisfied.

4>Determine when the system needs to be modernized, replaced, or retired.

OUTPUT UNIT

Function Details

The basic objective of HOTEL MANAGEMENT SYSTEM is to generalize and

simplify the monthly or day to day activities of Hotel like Room activities, Check in of

New Customer, Check out of customer, Assigning a room according to customer

requirement, and finally compute the bill etc. which has to be performed repeatedly on

regular basis. To provide efficient, fast, reliable and user-friendly system is the basic

motto behind this exercise.

Let us now discuss how different functions handle the structure and data files:

1.Password

In this module, this website is for multiple users. If a User enters a password and the

software checks its validity. If the password is valid then option is given to change the

password, otherwise “Invalid

User/Password” message is displayed. There is an option for password recovery, log out,

login, new users sign in. The Administrator can also update changes in the site after

login.

2 Creating new Entity (Hotel, Room, Customers,Members etc.)

This is used to add a new employee details, delete entity details and view the details. In

that screen, the automatic item is created.

Page 83: Hotel Management Project

In this function, whenever a new entity is required to be added the corresponding forms

are opened and the database is manipulated to check whether the data is already existing

or not. If it already exists, then it prompts that “Entry already existing” and if not than the

data is entered with the various validation checks.

3.Function NEW_ROOM()

This is the function used to open a new room for a customer so that he/she can

assign a separate room . In that screen, the automatic room number is created.

After opening a new room for the customer, finally a room is assigned to a

customer and the room records are appended in the data file.

4.Function CHECKIN_CUSTOMER()

This function is used to admit a customer in our Hotel after entering his all

personal details like Name, Address, Phone, Sex and then he/she is assigned a

room from NEW_ROOM() function.

5.Function CHECKOUT_CUSTOMER()

This function is used to checkout the customer details from database. When the

user inputs his room number, the same room number will be checked in the

database, if the room number is matched in the database, then the customer will

be check-out from the database and transferred the record of the checkout to

another table of database so that the Hotel Management has the record of

customers who have check-out to fulfill his legal liabilities.

6.Function GENERATE_BILL()

When any customer check-out, his/her bill is generated automatically by

calculated check-out date minus check-in date and getting multiplied it by daily

room charge plus other charges and the bill has to be saved in the table in the

database.

7.Function DISPLAY_RECORD()

This function is used to display all the transaction including the customer name, address,

phone, bed number, and doctor assigned to him/her in the screen. This is a global repor to

display all the transaction records in the screen.

8 Validation of Data Entered by the User & Error Handling

In this function, the validity of data entered by the user during the various business

processes is checked through various validation checks. For example, there should not be

any characters entered in the numeric fields, likewise if there is any error occurs than it

should handle that particular error and give the required messages.

10 Searching

In this function, room, customer well as members can search details from the database

according to their authentications.

11.Report Generation

In this function reports are generated for the following entities:

Page 84: Hotel Management Project

a) Customer Details.

b) Requirements of the Customers

c) Rooms Details

d) Bill Details

e) Check in Reports

f) Booking Details

g) Online Bookings

h) Checkout Details

i) Membership Details

j) Packages Available.

CONCLUSION

This project is designed to meet the requirements of Hotel Management. It has

been developed in JSP, Servlets keeping in mind the specifications of the system.

For designing the system we have used simple data flow diagrams.

Overall the project teaches us the essential skills like:

Using system analysis and design techniques like data flow diagram in designing the

system.

Understanding the database handling and query processing.

Page 85: Hotel Management Project

Bibliography

Faculty guidance:

Ms.ANJALI SINGH.

Book Guidance:

Object Oriented Programming with C++

by Sumita Arora.

E.Balagurusamy

Website Guidance:

www.google.co.in