Skip to content
TECHTRO
Be Unique
Welcome
NDA
Blog
o Education
Physics
CHEMISTRY
C++
Maths
OTHER
o Trending News
o Tech
o loot deals
Privacy Policy
About
Contact
C++ program on hotel management
On 23 Jan 2017 By Neeraj KholiyaIn C++, Projects
INDEX
1. INTRODUCTION
2. SYSTEM REQUIREMENTS
3. HEADER FILES
4. USER DEFINED FUNCTIONS
5. PROGRAM SOURCE CODE
6 . OUTPUT SCREEN SHOTS
7. LIMITATIONS
8. BIBLIOGRAPHY
INTRODUCTION
HOTEL MANAGEMENT project in C++ is a simple console application built without the
use of graphics. This project Hotel Management help in managing the record of the customer
according to the name, day of arrival ,day of staying and much more. In this project we tried
to enter all details of customer and tried to maintain all the possibility which may help the
user to enter more record if he/she requires.
1. Create record: This feature creates a new customer records. For this the information
to be provided are the date of arrival , no. of person, name, age, address, nationality,
days of staying and choice for AC or NON-AC .
2. Check status: this feature allow user to check the status of the total room available,
for AC or NON AC, cost of AC and NON AC.
3. To book a room: this feature is same as the above. This feature allow user to book a
room on the basics of the date of arrival ,no of person ,name ,age , address ,nationality
,days of staying and choice for AC or NON AC .
4. Delete Customer’s record: This feature deletes the record of a particular customer; it
first of all asks for the name of the customer whose record is to be deleted.
5. Search customer’s record: In Hotel Management project in C++, this feature is used
to search the record of a particular customer. It first ask for the customer’s name for
the searching of records . upon successful searching, the program displays the records
of a particular customer ,but on the unsuccessful searching it display the message
“Name not present in the record”.
6. Read all the record: TheRead () function in project in C++ has been used for this
feature. It basically shows the Room no, Name, Address, Nationality, Date of arrival .
7. To know the room bill: This feature show the bill of a particular customer. It
basically ask the room no of the hotel in which ot show the record.
8. To short the record: This feature short all the customer record. It first ask to short
Room no wise ,means it short on the basis of room no. then Name wise means it short
on the basis of name, Nationality wise means it short on the basis of Nationality, date
wise means it short on the basis of date ,no of days wise means it short on the basis of
days, bill wise means it short on the basis of bill .
9. To Exit: This feature allows the user to exit program. Ot basically terminate the
program.
REQUIREMENTS
PROCESSOR Pentium 233 MH or higher processor Pentium 111 recommended.
OPERATING SYSTEM Microsoft windows 98/7/8/HP/window HP recommended.
MEMORY 4 GB RAM (minimum), 128 MB recommended.
DISK SPACE
120 MB including 115 MB of available space on hard disk that contains the opera
ting system.
DISK DRIVE CDROM devices.
PRINTING/EDITING DEVICES Default keyboard.
MONITOR Super VGA (800 x 6000) or high resolution. With 265 Colors.
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*******************
*** HEADER FILES***
*******************
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
#include<stdio.h>
#include<fstream.h>
#include<ctype.h>
#include<dos.h>
#include<process.h>
#include<string.h>
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**********************
*** GLOBAL VARIABLE ***
**********************
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
int ac=50;
int non_ac=50;
int no_of_room=100;
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*****************
*** STRUCTURE ***
*****************
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
struct hotel
int day,year,month;
int no_of_person;
int no_of_room;
char name[30];
char nationality[20];
int ac;
int room_no;
int non_ac;
int no_of_day;
char address[20];
}h;
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
***************
*** WELCOME ***
***************
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
void welcome()
cout<<“\n\n\n\n\n\n\n\t\t\t|*****************************|”;
cout<<“\n\t\t\t !!!! PROJECT MADE BY !!!! \n”;
cout<<“\n\t\t\t LOKESH YADAV\n\n\t\t NAVEEN KUMAR YADAV
“;
cout<<“\n\t\t\t|*****************************|”;
getch(); clrscr();
cout<<“\n\n\n\n\n\n\n\t\t\t*****************************”;
cout<<“\n\t\t\t !!!!HOTEL MANAGEMENT!!!!\n”;
cout<<“\t\t\t*****************************”;
getch();
cout<<“\n\n\n\n\n\t\tPress any key to continue………………”;
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**************
*** CREATE ***
**************
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
void create()
clrscr();
char ch;
ofstream fo(“[Link]”,ios::app);
cout<<“\t\t\nCREATING FILE”;
cout<<“\nDate of Arrival: “;
cin>>[Link];
cout<<“\nMonth: “;
cin>>[Link];
cout<<“\nYear: “;
cin>>[Link];
cout<<“\nNo_of_person: “;
cin>>h.no_of_person;
cout<<“\nName: “;
gets([Link]);
cout<<“\nAddress: “;
gets([Link]);
cout<<“\nNationality: “;
gets([Link]);
if(no_of_room>0)
cout<<“\nEnter choice (a/A for ac & n/N for non_ac): “;
cin>>ch;
if(ch==’a’||ch==’A’)
if(ac>0)
cout<<“\nENTER ROOM NO: “;
cin>>h.room_no;
ac=ac-1;
no_of_room=no_of_room-1;
cout<<“\nNow total room available: “<<no_of_room;
}
else
if(non_ac>0)
cout<<“\nENTER ROOM NO : “;
cin>>h.room_no;
non_ac=non_ac-1;
no_of_room=no_of_room-1;
cout<<“\nNow total room available: “<<no_of_room;
[Link]((char *)&h,sizeof(h));
[Link]();
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**************
*** INTIAL ***
**************
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
void intial()
clrscr();
[Link]=50;
h.no_of_room=100;
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**************
*** STATUS ***
**************
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
void status()
clrscr();
ifstream fi(“[Link]”,ios::binary|ios::app|ios::in);
cout<<“\t\t\tSTATUS”;
while(![Link]())
[Link]((char*)&h,sizeof(h));
}
[Link]();
cout<<“\n\n\n\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~”;
cout<<“\n ~ ~”;
cout<<“\n ~ No of AC room : “<<ac<<” ~”;
cout<<“\n ~ No. of NON – AC room : “<<non_ac<<” ~”;
cout<<“\n ~ No. of room available in the Hotel :
“<<no_of_room<<” ~”;
cout<<“\n ~ ~”;
cout<<“\n ~ ~”;
cout<<“\n ~ ~”;
cout<<“\n ~ ~”;
cout<<“\n ~ ~”;
cout<<“\n ~ ~”;
cout<<“\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~”;
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**************
**** READ ****
**************
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
void read()
clrscr();
int y=12;
ifstream fi(“[Link]”,ios::binary|ios::app|ios::in);
gotoxy(32,5);
cprintf(“PEOPLE STAYING IN THE HOTEL”);
gotoxy(6,6);
cprintf(“=========================================================
===============”);
textcolor(YELLOW);
gotoxy(10,7);
cprintf(“ROOM NO.”);
gotoxy(25,7);
cprintf(“NAME”);
gotoxy(35,7);
cprintf(“ADDRESS”);
gotoxy(50,7);
cprintf(“NATIONALITY”);
gotoxy(65,7);
cprintf(“DATE”);
gotoxy(6,9);
cprintf(“=========================================================
===============”);
while([Link]((char*)&h,sizeof(h)))
gotoxy(10,y);
cout<<h.room_no;
gotoxy(25,y);
cout<<[Link];
gotoxy(35,y);
cout<<[Link];
gotoxy(50,y);
cout<<[Link];
gotoxy(65,y);
cout<<[Link]<<“/”<<[Link]<<“/”<<[Link];
cout<<endl;
y=y+1;
getch();
[Link]();
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**************
*** SEARCH ***
**************
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
void search()
clrscr();
int f=0;
char n[20];
ifstream fi(“[Link]”,ios::binary|ios::app|ios::in);
cout<<“\nEnter name to whose record to be search: “;
gets(n);
while([Link]((char*)&h,sizeof(h)))
if(strcmp(n,[Link])==0)
cout<<“\n\t\tRecord FOUND”;
cout<<“\n\n”;
cout<<“\t\tDetails of record”<<endl;
cout<<“\n\tName: “<<[Link];
cout<<“\n\tNationality: “<<[Link];
cout<<“\n\tDate of Arrival:”<<[Link]<<‘-‘<<[Link]<<‘-‘<<[Link];
cout<<“\n\tNo. of person:”<<h.no_of_person;
f=1;
break;
}
}
if(f==0)
cout<<“Record DOES NOT exist”;
[Link]();
getch();
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**************
*** MODIFY ***
**************
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
void modify()
clrscr();
int a=0;
char n[20];
fstream fo;
[Link](“[Link]”,ios::out|ios::in);
cout<<“\t\tMODIFY”;
cout<<“\nEnter name of person whose record is to be modify: “;
gets(n);
while([Link]((char*)&h,sizeof(h)))
if(strcmp(n,[Link])==0)
long p=[Link]()-sizeof(h);
cout<<“\n\tEnter new detail”;
cout<<“\nEnter no_of_person: “;
cin>>h.no_of_person;
cout<<“\nEnter Name: “;
gets([Link]);
cout<<“\nEnter Address: “;
gets([Link]);
cout<<“\nEnter Nationality: “;
gets([Link]);
a=1;
[Link](p,ios::beg);
[Link]((char*)&h,sizeof(h));
break;
if(a==0)
cout<<“EMPTY RECORD”;
[Link]();
getch();
}
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**************
*** DELETE ***
**************
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
void delet()
clrscr();
int f=0;
char c;
char n[30];
fstream fi;
[Link](“[Link]”,ios::in);
fstream fo;
[Link](“[Link]”,ios::out);
clrscr();
cout<<“\t\t\tDELETE”;
cout<<“\nEnter name of person whose record is to be deleted : “;
gets(n);
while([Link]((char*)&h,sizeof(h)))
if(strcmp(n,[Link])==0)
{
f=1;
cout<<“\nDetail of person: “;
cout<<[Link]<<‘\n’;
cout<<[Link]<<‘\n’;
cout<<[Link]<<‘\n’;
cout<<“\nDate of Arrival:”<<[Link]<<“/”<<[Link]<<“/” <<[Link];
else
[Link]((char*)&h,sizeof(h));
[Link]();
[Link]();
if(f==0)
cout<<“Record DOES NOT exist”;
remove(“[Link]”);
rename(“[Link]”,”[Link]”);
getch();
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
************
*** MAIN ***
************
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
void main()
clrscr();
welcome();
int c;
char ch;
do
clrscr();
cout<<“\t\t”;
for(int i=0;i<20;i++)
cout<<‘-‘;
cout<<“\n\n\t\tMAIN MENU\n\n”;
cout<<“\t\t”;
for(i=0;i<20;i++)
{
cout<<‘-‘;
cout<<“\n\n\n\t\t”;
for(i=0;i<40;i++)
cout<<‘-‘;
cout<<“\n\n\t\tPress:(1) to Create….”
<<“\n\t\t (2) to Check status….”
<<“\n\t\t (3) to Delete a record….”
<<“\n\t\t (4) to Modify a record….”
<<“\n\t\t (5) to Search a record….”
<<“\n\t\t (6) to Read all the records….”
<<“\n\t\t (7) to Exit….”;
cout<<“\n\n\n\t\t”;
for(i=0;i<40;i++)
cout<<‘-‘;
}
textcolor(14);
cout<<“\n\n\n\t\t\t\tEnter your choice: “;
cin>>c;
switch(c)
case 1:
create();
break;
case 2:
intial();
status();
break;
case 3:
delet();
break;
case 4:
modify();
break;
case 5:
search();
break;
case 6:
read();
break;
case 7:
clrscr();
cout<<“\n\n\n”;
cout<<“\t\t\t\tPLEASE WAIT….. “;
cout<<“\n\n\n”;
cout<<“\t\t\t\t EXITING”;
delay(1500);
exit(0);
default:
clrscr();
cout<<“\n\n\t\t\t\t!!Invalid choice!!”;
cout<<“\n\n\n”;
cout<<“\t\t\t\t EXITING”;
delay(2000);
exit(0);
cout<<“\n\nWant to continue(Y/N)…”;
cin>>ch;
}while(ch==’y’||ch==’Y’);
getch();
}
WELCOME SCREEN
MAIN MENU SCREEN
CREATE SCREEN
STATUS SREEN
BOOKING SCREEN
DELEATING SREEN
MODIFING SCREEN
SEARCHING SCREEN
SHORTING SCREEN
BILL SCREEN
Limitations
Does not support mouse.
It is platform dependent (works in windows and not in Linux).
Output on screen changes with change in resolution.
If some string is gives as input i.e. in place where integer should have been input, the
program crashes and data file gets spoiled.
The program as such cannot be used as a software but after some modifications it may
be used as a full fledge software.
Bibliography
Sumita arora class 12
Move fast with C++ class 12
Arihant of C++ class 12
Website: [Link]
[Link]
INDEX
1. INTRODUCTION
2. SYSTEM REQUIREMENTS
3. HEADER FILES
4. USER DEFINED FUNCTIONS
5. PROGRAM SOURCE CODE
6 . OUTPUT SCREEN SHOTS
7. LIMITATIONS
8. BIBLIOGRAPHY
INTRODUCTION
HOTEL MANAGEMENT project in C++ is a simple console application built without the
use of graphics. This project Hotel Management help in managing the record of the customer
according to the name, day of arrival ,day of staying and much more. In this project we tried
to enter all details of customer and tried to maintain all the possibility which may help the
user to enter more record if he/she requires.
1. Create record: This feature creates a new customer records. For this the information
to be provided are the date of arrival , no. of person, name, age, address, nationality,
days of staying and choice for AC or NON-AC .
2. Check status: this feature allow user to check the status of the total room available,
for AC or NON AC, cost of AC and NON AC.
3. To book a room: this feature is same as the above. This feature allow user to book a
room on the basics of the date of arrival ,no of person ,name ,age , address ,nationality
,days of staying and choice for AC or NON AC .
4. Delete Customer’s record: This feature deletes the record of a particular customer; it
first of all asks for the name of the customer whose record is to be deleted.
5. Search customer’s record: In Hotel Management project in C++, this feature is used
to search the record of a particular customer. It first ask for the customer’s name for
the searching of records . upon successful searching, the program displays the records
of a particular customer ,but on the unsuccessful searching it display the message
“Name not present in the record”.
6. Read all the record: TheRead () function in project in C++ has been used for this
feature. It basically shows the Room no, Name, Address, Nationality, Date of arrival .
7. To know the room bill: This feature show the bill of a particular customer. It
basically ask the room no of the hotel in which ot show the record.
8. To short the record: This feature short all the customer record. It first ask to short
Room no wise ,means it short on the basis of room no. then Name wise means it short
on the basis of name, Nationality wise means it short on the basis of Nationality, date
wise means it short on the basis of date ,no of days wise means it short on the basis of
days, bill wise means it short on the basis of bill .
9. To Exit: This feature allows the user to exit program. Ot basically terminate the
program.
REQUIREMENTS
PROCESSOR Pentium 233 MH or higher processor Pentium 111 recommended.
OPERATING SYSTEM Microsoft windows 98/7/8/HP/window HP recommended.
MEMORY 4 GB RAM (minimum), 128 MB recommended.
DISK SPACE
120 MB including 115 MB of available space on hard disk that contains the opera
ting system.
DISK DRIVE CDROM devices.
PRINTING/EDITING DEVICES Default keyboard.
MONITOR Super VGA (800 x 6000) or high resolution. With 265 Colors.
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*******************
*** HEADER FILES***
*******************
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
#include<stdio.h>
#include<fstream.h>
#include<ctype.h>
#include<dos.h>
#include<process.h>
#include<string.h>
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**********************
*** GLOBAL VARIABLE ***
**********************
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
int ac=50;
int non_ac=50;
int no_of_room=100;
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*****************
*** STRUCTURE ***
*****************
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
struct hotel
{
int day,year,month;
int no_of_person;
int no_of_room;
char name[30];
char nationality[20];
int ac;
int room_no;
int non_ac;
int no_of_day;
char address[20];
}h;
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
***************
*** WELCOME ***
***************
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
void welcome()
{
cout<<“\n\n\n\n\n\n\n\t\t\t|*****************************|”;
cout<<“\n\t\t\t !!!! PROJECT MADE BY !!!! \n”;
cout<<“\n\t\t\t LOKESH YADAV\n\n\t\t NAVEEN KUMAR YADAV
“;
cout<<“\n\t\t\t|*****************************|”;
getch(); clrscr();
cout<<“\n\n\n\n\n\n\n\t\t\t*****************************”;
cout<<“\n\t\t\t !!!!HOTEL MANAGEMENT!!!!\n”;
cout<<“\t\t\t*****************************”;
getch();
cout<<“\n\n\n\n\n\t\tPress any key to continue………………”;
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**************
*** CREATE ***
**************
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
void create()
{
clrscr();
char ch;
ofstream fo(“[Link]”,ios::app);
cout<<“\t\t\nCREATING FILE”;
cout<<“\nDate of Arrival: “;
cin>>[Link];
cout<<“\nMonth: “;
cin>>[Link];
cout<<“\nYear: “;
cin>>[Link];
cout<<“\nNo_of_person: “;
cin>>h.no_of_person;
cout<<“\nName: “;
gets([Link]);
cout<<“\nAddress: “;
gets([Link]);
cout<<“\nNationality: “;
gets([Link]);
if(no_of_room>0)
cout<<“\nEnter choice (a/A for ac & n/N for non_ac): “;
cin>>ch;
if(ch==’a’||ch==’A’)
if(ac>0)
{
cout<<“\nENTER ROOM NO: “;
cin>>h.room_no;
ac=ac-1;
no_of_room=no_of_room-1;
cout<<“\nNow total room available: “<<no_of_room;
else
if(non_ac>0)
cout<<“\nENTER ROOM NO : “;
cin>>h.room_no;
non_ac=non_ac-1;
no_of_room=no_of_room-1;
cout<<“\nNow total room available: “<<no_of_room;
[Link]((char *)&h,sizeof(h));
[Link]();
}
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**************
*** INTIAL ***
**************
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
void intial()
clrscr();
[Link]=50;
h.no_of_room=100;
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**************
*** STATUS ***
**************
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
void status()
clrscr();
ifstream fi(“[Link]”,ios::binary|ios::app|ios::in);
cout<<“\t\t\tSTATUS”;
while(![Link]())
[Link]((char*)&h,sizeof(h));
[Link]();
cout<<“\n\n\n\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~”;
cout<<“\n ~ ~”;
cout<<“\n ~ No of AC room : “<<ac<<” ~”;
cout<<“\n ~ No. of NON – AC room : “<<non_ac<<” ~”;
cout<<“\n ~ No. of room available in the Hotel :
“<<no_of_room<<” ~”;
cout<<“\n ~ ~”;
cout<<“\n ~ ~”;
cout<<“\n ~ ~”;
cout<<“\n ~ ~”;
cout<<“\n ~ ~”;
cout<<“\n ~ ~”;
cout<<“\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~”;
}
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**************
**** READ ****
**************
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
void read()
clrscr();
int y=12;
ifstream fi(“[Link]”,ios::binary|ios::app|ios::in);
gotoxy(32,5);
cprintf(“PEOPLE STAYING IN THE HOTEL”);
gotoxy(6,6);
cprintf(“=========================================================
===============”);
textcolor(YELLOW);
gotoxy(10,7);
cprintf(“ROOM NO.”);
gotoxy(25,7);
cprintf(“NAME”);
gotoxy(35,7);
cprintf(“ADDRESS”);
gotoxy(50,7);
cprintf(“NATIONALITY”);
gotoxy(65,7);
cprintf(“DATE”);
gotoxy(6,9);
cprintf(“=========================================================
===============”);
while([Link]((char*)&h,sizeof(h)))
gotoxy(10,y);
cout<<h.room_no;
gotoxy(25,y);
cout<<[Link];
gotoxy(35,y);
cout<<[Link];
gotoxy(50,y);
cout<<[Link];
gotoxy(65,y);
cout<<[Link]<<“/”<<[Link]<<“/”<<[Link];
cout<<endl;
y=y+1;
getch();
}
[Link]();
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**************
*** SEARCH ***
**************
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
void search()
clrscr();
int f=0;
char n[20];
ifstream fi(“[Link]”,ios::binary|ios::app|ios::in);
cout<<“\nEnter name to whose record to be search: “;
gets(n);
while([Link]((char*)&h,sizeof(h)))
if(strcmp(n,[Link])==0)
cout<<“\n\t\tRecord FOUND”;
cout<<“\n\n”;
cout<<“\t\tDetails of record”<<endl;
cout<<“\n\tName: “<<[Link];
cout<<“\n\tNationality: “<<[Link];
cout<<“\n\tDate of Arrival:”<<[Link]<<‘-‘<<[Link]<<‘-‘<<[Link];
cout<<“\n\tNo. of person:”<<h.no_of_person;
f=1;
break;
if(f==0)
cout<<“Record DOES NOT exist”;
[Link]();
getch();
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**************
*** MODIFY ***
**************
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
void modify()
{
clrscr();
int a=0;
char n[20];
fstream fo;
[Link](“[Link]”,ios::out|ios::in);
cout<<“\t\tMODIFY”;
cout<<“\nEnter name of person whose record is to be modify: “;
gets(n);
while([Link]((char*)&h,sizeof(h)))
if(strcmp(n,[Link])==0)
long p=[Link]()-sizeof(h);
cout<<“\n\tEnter new detail”;
cout<<“\nEnter no_of_person: “;
cin>>h.no_of_person;
cout<<“\nEnter Name: “;
gets([Link]);
cout<<“\nEnter Address: “;
gets([Link]);
cout<<“\nEnter Nationality: “;
gets([Link]);
a=1;
[Link](p,ios::beg);
[Link]((char*)&h,sizeof(h));
break;
if(a==0)
cout<<“EMPTY RECORD”;
[Link]();
getch();
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**************
*** DELETE ***
**************
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
void delet()
clrscr();
int f=0;
char c;
char n[30];
fstream fi;
[Link](“[Link]”,ios::in);
fstream fo;
[Link](“[Link]”,ios::out);
clrscr();
cout<<“\t\t\tDELETE”;
cout<<“\nEnter name of person whose record is to be deleted : “;
gets(n);
while([Link]((char*)&h,sizeof(h)))
if(strcmp(n,[Link])==0)
f=1;
cout<<“\nDetail of person: “;
cout<<[Link]<<‘\n’;
cout<<[Link]<<‘\n’;
cout<<[Link]<<‘\n’;
cout<<“\nDate of Arrival:”<<[Link]<<“/”<<[Link]<<“/” <<[Link];
else
[Link]((char*)&h,sizeof(h));
[Link]();
[Link]();
if(f==0)
cout<<“Record DOES NOT exist”;
remove(“[Link]”);
rename(“[Link]”,”[Link]”);
getch();
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
************
*** MAIN ***
************
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
void main()
clrscr();
welcome();
int c;
char ch;
do
clrscr();
cout<<“\t\t”;
for(int i=0;i<20;i++)
{
cout<<‘-‘;
cout<<“\n\n\t\tMAIN MENU\n\n”;
cout<<“\t\t”;
for(i=0;i<20;i++)
cout<<‘-‘;
cout<<“\n\n\n\t\t”;
for(i=0;i<40;i++)
cout<<‘-‘;
cout<<“\n\n\t\tPress:(1) to Create….”
<<“\n\t\t (2) to Check status….”
<<“\n\t\t (3) to Delete a record….”
<<“\n\t\t (4) to Modify a record….”
<<“\n\t\t (5) to Search a record….”
<<“\n\t\t (6) to Read all the records….”
<<“\n\t\t (7) to Exit….”;
cout<<“\n\n\n\t\t”;
for(i=0;i<40;i++)
cout<<‘-‘;
textcolor(14);
cout<<“\n\n\n\t\t\t\tEnter your choice: “;
cin>>c;
switch(c)
case 1:
create();
break;
case 2:
intial();
status();
break;
case 3:
delet();
break;
case 4:
modify();
break;
case 5:
search();
break;
case 6:
read();
break;
case 7:
clrscr();
cout<<“\n\n\n”;
cout<<“\t\t\t\tPLEASE WAIT….. “;
cout<<“\n\n\n”;
cout<<“\t\t\t\t EXITING”;
delay(1500);
exit(0);
default:
clrscr();
cout<<“\n\n\t\t\t\t!!Invalid choice!!”;
cout<<“\n\n\n”;
cout<<“\t\t\t\t EXITING”;
delay(2000);
exit(0);
cout<<“\n\nWant to continue(Y/N)…”;
cin>>ch;
}while(ch==’y’||ch==’Y’);
getch();
WELCOME SCREEN
MAIN MENU SCREEN
CREATE SCREEN
STATUS SREEN
BOOKING SCREEN
DELEATING SREEN
MODIFING SCREEN
SEARCHING SCREEN
SHORTING SCREEN
BILL SCREEN
Limitations
Does not support mouse.
It is platform dependent (works in windows and not in Linux).
Output on screen changes with change in resolution.
If some string is gives as input i.e. in place where integer should have been input, the
program crashes and data file gets spoiled.
The program as such cannot be used as a software but after some modifications it may
be used as a full fledge software.
Bibliography
Sumita arora class 12
Move fast with C++ class 12
Arihant of C++ class 12
Website: [Link]
[Link]
Advertisement
Advertisements
Report this ad
Report this ad
Share this:
Twitter
Facebook
Google
Related
Student Database Management System
In "C++"
CBSE class 12th result will be declare on 28 May, How to check? Read full...
In "Education"
CBSE Class XII Result date? And reason for delay?
In "Chemistry"
c+ project cbse class 12c++ program cbsec++ program cbse class 12.c++ programsc++
projectc++ project class 12c++ project class 12 cbsecbse c++ class 12 project
Post navigation
Previous
Mi Launches VR in India – VR Features
Next
physics project on laser sensitive alarm
Leave a Reply
Search for:
TechFun
TechFun
Advertisements
Report this ad
Latest post
The basic trigonometry for NDA: 5 Feb 2018
CBSE Class XII Result date? And reason for delay? 25 May 2017
CBSE class 12th result will be declare on 28 May, How to check? Read full… 24
May 2017
Mumbai Indian beats Rising Pune Supergaints and establishe new records tonight…
21 May 2017
TravelKida App: Refer Friends and Get Free Trips To Goa or Manali 21 May 2017
Publisher
adarshhhh
anshrana
Αηυbhαν Sιηgh
OMi Shah
Raaz
Neeraj Kholiya
Follow Blog via Email
Enter your email address to follow this blog and receive notifications of new posts by email.
Join 4,537 other followers
Social
Report this ad