You are on page 1of 12

 NAME - Anuj Srivastava

 CLASS - XIth A (Science)


 S. Teacher - Mr. Anupam Tiwari
 School - Allahabad Public School & College

TEACHER’S SIGNATURE -
 INTRODUCTION

 ACKNOWLEDGEMENT

 PLATFORM USED

 PROJECT SHEDULE

 CODING

 OUTPUT
This project is designed for hotel’s booking in C++. The title of the
project is Hotel management System. This program is very useful
in real life situation for providing instant booking for hotel rooms.
It also stores the information about booker’s Name, Address and
phone number.

In this C++ program we can easily modify, add, delete, recall and
list the records.
We would like to thanks our computer sir Mr. Anupam Tiwari, who provided us
this opportunity to make a project on “Hotel Management System” which really
helped us to understand the concepts of C++ computer programming.

To make this project we have taken a concept view from a book “Computer
science With C++” written by Sumita Arora and a website
“www.thecrazyprogrammer.com”.

Lastly we would like to thank our family members whose support were very
worthy for us to make our project.
PLATFORM USED
TURBO C++, M.S PAINT, MS
OFFICE, NOTEPAD++.
ISP: RELIANCE JIO
WEB BROWSER: GOOGLE
CHROME
PROJECT SHEDULE

Work Start Date End date Responsibility

Design view 3-01-2017 4-12-2017 Myself

Design final 5-01-2017 8-01-2017 Members

Design fixes 9-01-2017 14-01-2017 Myself

Coding 15-01-2017 18-01-2017 Myself


selection
Coding final 19-01-2017 7-02-2017 Members

Coding fixes 8-02-2017 12-02-2017 Myself

Final testing 13-02-2017 13-02-2017 Members

Final fixes 14-02-2017 15-02-2017 Myself

Review 16-02-2017 17-02-2017 Members

SOURCE CODE
#include<iostream.h>

#include<conio.h>

#include<stdio.h>

#include<process.h>

#include<dos.h>

void main_menu(); //To display Main menu

void addroom(); //To book a room

void crec(); //To display the customer record

void rooms(); //To display all allotted rooms

void edit(); //To edit the customer record

void modify(); //To modify the record

void input(); //Input of Data

void display(int); //To display the data

void del(); //To delete the record

struct hotel

{ int r; //Room no.

char phone[20];

char name[20];

char address[50];

} h;

hotel room_no[100];

void main_menu()

{ int choice,here; char ch; here: clrscr();

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

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

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

cout<<"\n\n\n 1.Book a Room";

cout<<"\n 2.Customer Records";

cout<<"\n 3.Rooms Allotted";

cout<<"\n 4.Edit Details";

cout<<"\n 5.Exit";
cout<<"\n\n Enter your choice: ";

cin>>choice;

switch(choice)

{ case 1: addroom(); break;

case 2: crec(); break;

case 3: rooms(); break;

case 4: edit(); break;

case 5:

{ cout<<"\n\t\t Do you want to Exit(y/n): ";

cin>>ch;

if ((ch=='y')||(ch=='Y')) exit(0);

else if ((ch=='n')||(ch=='N')) goto here;

else

{ cout<<"\n Invalid keyword!!"; sleep(2);

goto here; } } break;

default:

{ cout<<"\n\n\t\tWrong choice!!!";

cout<<"\n\t\tPress any key to continue!!"; getch(); goto here; }

void addroom()

{ int i=0,y; char ch; clrscr();

do

{ cout<<"\n\n Enter customer Details";

cout<<"\n~~~~~~~~~~~~~~~~~~~~~~";

input(); ++i;

cout<<"\n\n Do you want to book more ?(y/n).. ";

cin>>ch;

if ((ch=='n')||(ch=='N')) goto y;

clrscr();

} while(i<100);

y: main_menu();

}
void input()

{ int i;

cout<<"\n Enter your Room no: ";

cin>>room_no[i].r;

cout<<"\n Name: ";

gets(room_no[i].name);

cout<<"\n Address: ";

gets(room_no[i].address);

cout<<"\n Phone: ";

cin>>room_no[i].phone;

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

void display(int a)

cout<<"\n Name: "; puts(room_no[a].name);

cout<<" Address: "; puts(room_no[a].address);

cout<<" Phone no: "<<room_no[a].phone;

return ;

void crec()

{ clrscr(); int i,ro; char ch;

do {

cout<<"\n Customer Details";

cout<<"\n~~~~~~~~~~~~~~~~~~~";

cout<<"\n Enter your Room no: ";

cin>>ro;

for(i=0;i<100;++i)

{ if(room_no[i].r==ro)

{ display(i); break; }

if(room_no[i].r!=ro)

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


cout<<"\n\n Do you want to find more(y/n).. ";

cin>>ch;

} while((ch=='y')||(ch=='Y')); main_menu();

void rooms()

{ clrscr(); int i=0;

cout<<"\n\t\t\t List of rooms Allotted";

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

cout<<"\n\n Room No.\tName\t\t\tAddress\t\t Phone No.\n";

while(i<100)

{ if(room_no[i].r==0) goto x;

cout<<"\n\n "<<room_no[i].r<<"\t\t";

printf(room_no[i].name);

cout<<"\t\t"; printf(room_no[i].address);

cout<<"\t\t"<<room_no[i].phone;

++i;

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

getch(); main_menu();

void edit()

{ int choice,i,ro,here,flag=0; clrscr();

cout<<"\n EDIT MENU";

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

cout<<"\n Enter your room no: ";

cin>>ro;

for(i=0;i<100;++i)

{ if(room_no[i].r==ro)

{ here: clrscr(); cout<<"\n EDIT MENU";

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

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

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


cout<<"\n 3.Cancel ";

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

cin>>choice;

switch(choice)

{ case 1: modify(); break;

case 2: del(); break;

case 3: main_menu();

default: cout<<"\n Wrong Choice!!"; getch(); goto here; }

flag=1; break; }

if(!flag)

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

getch(); main_menu();

void modify()

{ int i;

cout<<"\n Enter New Details";

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

cout<<"\n Name: ";

gets(room_no[i].name);

cout<<" Address: ";

gets(room_no[i].address);

cout<<" Phone no: ";

cin>>room_no[i].phone;

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

void del()

{ char ch; int i,x;

cout<<"\n Name: "; printf(room_no[i].name);

cout<<"\n Address: "; printf(room_no[i].address);

cout<<"\n Phone no: "<<room_no[i].phone;

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


x: cin>>ch;

if((ch=='n')||(ch=='N'))

main_menu();

else if((ch=='y')||(ch=='Y'))

{ room_no[i].r=0;

cout<<"\n RECORD DELETED "; getch(); main_menu();

else { cout<<"\nInvalid keyword\n Press again(y/n).."; goto x; }

void main()

{ clrscr(); textbackground(BLUE); textcolor(RED);

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

cout<<"\n\t\t\t*** HOTEL MANAGEMENT SYSTEM ***";

cout<<"\n\t\t\t*******************************"; sleep(2);

cout<<"\n\n\n\n\n\t Created By: Anuj Srivastava"; sleep(1);

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

getch(); main_menu();

You might also like