SlideShare a Scribd company logo
1 of 22
FILE GENERATED
DATA FILES
HOTEL.DAT
PROGRAMME TITLE
HOTEL MANAGEMENT.CPP
OBJECT FILE
HOTEL.OBJ
EXECUTION FILE
HOTEL.EXE
CONTENT
1. HEADER FILE USED…………………
2. FILE GENERATED ……………………
3. WORKING DESCRIPTION …………..
4. CODING…………………………………
5. OUTPUT SCREENS…………………...
6. CONCLUSION ………………………..
7. BIBLIOGRAPHY………………………
CERTIFICATE
This is to certify that AMIT KUMAR YADAV of class – XII
has prepared the computer science assignment for the year
2018-19 on the project entitled “ HOTEL MANAGEMENT ”.
the project is the result of his effort & endeavor the
project is found worthy of acceptance as final project
report for the subject computer science of class - XII. He
is prepared the project under my guidance.
SIGNATURE OF PRINCIPAL
SIGNATURE OF INTERNAL EXAMINER SGNATURE OF EXTERNAL EXAMINER
ACKNOWLEDGEMENT
I would like to express a deep sense of thanks & gratitude to my
project guide MR. PARMENDRA MANGAL sir for guiding me
immensely through the course of the project. He always evinced keen
interest in my work. His constructive advice and constant motivation
have been responsible for the successful completion of this project .
My sincere thanks goes to MR. ANIL KUMAR, our principal sir for
his co-ordination in extending every possible support for the
completion of this project.
I also thanks for my parent for their motivation and support . I must
thanks for my classmates for their timely help and support for
compilation for these project .
Last but not the least, I would like to thanks all those who had helped directly or
inirectly towards the completion for this project.
AMIT KUMAR YADAV
CLASS - XII
CODING
// HOTEL MANAGEMENT SYSTEM
//SUBMITTED BY AMIT KUMAR YADAV
#include<iostream.h>
#include<conio.h>
#include<fstream.h>
#include<stdio.h>
#include<dos.h>
class hotel
{
int room_no;
char name[30];
char address[50];
char phone[10];
public:
void main_menu();//to dispay the main menu
void add(); //to book a room
void display(); //to display the customer record
void rooms(); //to display alloted rooms
void edit(); //to edit the customer record
int check(int); //to check room status
void modify(int);//to modify the record
void delete_rec(int); //to delete the record
};
void hotel::main_menu()
{
int choice;
while(choice!=5)
{
clrscr();
cout<<"ntttt*************";
cout<<"ntttt* MAIN MENU *";
cout<<"ntttt*************";
cout<<"nnnttt1.Book A Room";
cout<<"nttt2.Customer Record";
cout<<"nttt3.Rooms Allotted";
cout<<"nttt4.Edit Record";
cout<<"nttt5.Exit";
cout<<"nntttEnter Your Choice: ";
cin>>choice;
switch(choice)
{
case 1: add();
break;
case 2: display();
break;
case 3: rooms();
break;
case 4: edit();
break;
case 5: break;
default:
{
cout<<"nntttWrong choice!!!";
cout<<"ntttPress any key to
continue!!";
getch();
}
}
}
}
void hotel::add()
{
clrscr();
int r,flag;
ofstream fout("Record.dat",ios::app);
cout<<"n Enter Customer Detalis";
cout<<"n **********************";
cout<<"nn Room no: ";
cin>>r;
flag=check(r);
if(flag)
cout<<"n Sorry..!!!Room is already booked";
else
{
room_no=r;
cout<<" Name: ";
gets(name);
cout<<" Address: ";
gets(address);
cout<<" Phone No: ";
gets(phone);
fout.write((char*)this,sizeof(hotel));
cout<<"n Room is booked!!!";
}
cout<<"n Press any key to continue!!";
getch();
fout.close();
}
void hotel::display()
{
clrscr();
ifstream fin("Record.dat",ios::in);
int r,flag;
cout<<"n Enter room no: ";
cin>>r;
while(!fin.eof())
{
fin.read((char*)this,sizeof(hotel));
if(room_no==r)
{
clrscr();
cout<<"n Cusromer Details";
cout<<"n ****************";
cout<<"nn Room no: "<<room_no;
cout<<"n Name: "<<name;
cout<<"n Address: "<<address;
cout<<"n Phone no: "<<phone;
flag=1;
break;
}
}
if(flag==0)
cout<<"n Sorry Room no. not found or vacant!!";
cout<<"nn Press any key to continue!!";
getch();
fin.close();
}
void hotel::rooms()
{
clrscr();
ifstream fin("Record.dat",ios::in);
cout<<"ntttList Of Rooms Allotted";
cout<<"nttt*********************";
cout<<"nn Room No.tNamettAddressttPhone No.n";
while(!fin.eof())
{
fin.read((char*)this,sizeof(hotel));
cout<<"nn "<<room_no<<"tt"<<name;
cout<<"tt"<<address<<"tt"<<phone;
}
cout<<"nnntttPress any key to continue!!";
getch();
fin.close();
}
void hotel::edit()
{
clrscr();
int choice,r;
cout<<"n EDIT MENU";
cout<<"n *********";
cout<<"nn 1.Modify Customer Record";
cout<<"n 2.Delete Customer Record";
cout<<"n Enter your choice: ";
cin>>choice;
clrscr();
cout<<"n Enter room no: ";
cin>>r;
switch(choice)
{
case 1: modify(r);
break;
case 2: delete_rec(r);
break;
default: cout<<"n Wrong Choice!!";
}
cout<<"n Press any key to continue!!!";
getch();
}
int hotel::check(int r)
{
int flag=0;
ifstream fin("Record.dat",ios::in);
while(!fin.eof())
{
fin.read((char*)this,sizeof(hotel));
if(room_no==r)
{
flag=1;
break;
}
}
fin.close();
return(flag);
}
void hotel::modify(int r)
{
long pos,flag=0;
fstream file("Record.dat",ios::in|ios::out|ios::binary);
while(!file.eof())
{
pos=file.tellg();
file.read((char*)this,sizeof(hotel));
if(room_no==r)
{
cout<<"n Enter New Details";
cout<<"n *****************";
cout<<"n Name: ";
gets(name);
cout<<" Address: ";
gets(address);
cout<<" Phone no: ";
gets(phone);
file.seekg(pos);
file.write((char*)this,sizeof(hotel));
cout<<"n Record is modified!!";
flag=1;
break;
}
}
if(flag==0)
cout<<"n Sorry Room no. not found or vacant!!";
file.close();
}
void hotel::delete_rec(int r)
{
int flag=0;
char ch;
ifstream fin("Record.dat",ios::in);
ofstream fout("temp.dat",ios::out);
while(!fin.eof())
{
fin.read((char*)this,sizeof(hotel));
if(room_no==r)
{
cout<<"n Name: "<<name;
cout<<"n Address: "<<address;
cout<<"n Pone No: "<<phone;
cout<<"nn Do you want to delete this record(y/n): ";
cin>>ch;
if(ch=='n')
fout.write((char*)this,sizeof(hotel));
flag=1;
}
else
fout.write((char*)this,sizeof(hotel));
}
fin.close();
fout.close();
if(flag==0)
cout<<"n Sorry room no. not found or vacant!!";
else
{
remove("Record.dat");
rename("temp.dat","Record.dat");
}
}
void main()
{
hotel h;
textmode(C80);
textbackground(WHITE);
textcolor(RED);
clrscr();
cout<<"nttt****************************";
cout<<"nttt* HOTEL MANAGEMENT PROJECT *";
cout<<"nttt****************************";
sleep(2);
cout<<"nnnnttMade By:";
sleep(2);
cout<<" AMIT KUMAR YADAV ";
sleep(2);
cout<<"nnnnnttttPress any key to continue!!";
getch();
h.main_menu();
}
BIBLIOGRAPHY
 https://www.google.com/
 https://en.wikipedia.org/
 www.botskool.com
 www.thecrazyprogrammer.com
 Computerscience with c++ by sumita arora
 Object oriented programme by Robert lafore.
HEADER FILE USED
 FSTREM.H -: for file handling , cin and cout.
 PROCESS.H -:for exist() function.
 CONIO.H -: for clrscr() and getch() function.
 STDIO.H -: for standard I/O operation.
 STRING.H -: for string handling.
 MATH.H -: for doing mathematical operations.
OUTPUT SCREEN
1. WELCOME SCREEN
2. MAIN MENU
3. BOOK A ROOM
4. DETAIL CUSTOMER
5 . ROOM ALLOTTED
6 . EDIT RECORD
7. TO EXIT
WORKING DESCRIPTION
This program is designed to keep the hotel’s record.
This program consist of five option as follows
1. Book room
2. Customer record
3. Room allotted
4. Edit record
5. Exit

More Related Content

Similar to Computer

Hotel Management Presentation by Aryan Singh Dhiman
Hotel Management Presentation by Aryan Singh DhimanHotel Management Presentation by Aryan Singh Dhiman
Hotel Management Presentation by Aryan Singh DhimanAryanSinghDhiman
 
Telephone billing system in c++
Telephone billing system in c++Telephone billing system in c++
Telephone billing system in c++vikram mahendra
 
Railway reservation(c++ project)
Railway reservation(c++ project)Railway reservation(c++ project)
Railway reservation(c++ project)Debashis Rath
 
C s investigatory project on telephone directory
C s  investigatory project on telephone directoryC s  investigatory project on telephone directory
C s investigatory project on telephone directorySHUBHAM YADAV
 
computerscience-170129081612.pdf
computerscience-170129081612.pdfcomputerscience-170129081612.pdf
computerscience-170129081612.pdfKiranKumari204016
 
Railway reservation(c++ project)
Railway reservation(c++ project)Railway reservation(c++ project)
Railway reservation(c++ project)Debashis Rath
 
OOP PPT Group H.pptx
OOP PPT Group H.pptxOOP PPT Group H.pptx
OOP PPT Group H.pptx20021519016
 
2014 computer science_question_paper
2014 computer science_question_paper2014 computer science_question_paper
2014 computer science_question_papervandna123
 
C++ and OOPS Crash Course by ACM DBIT | Grejo Joby
C++ and OOPS Crash Course by ACM DBIT | Grejo JobyC++ and OOPS Crash Course by ACM DBIT | Grejo Joby
C++ and OOPS Crash Course by ACM DBIT | Grejo JobyGrejoJoby1
 
Computer Investigatory Project
Computer Investigatory ProjectComputer Investigatory Project
Computer Investigatory ProjectNishant Jha
 
Computer Networks Lab File
Computer Networks Lab FileComputer Networks Lab File
Computer Networks Lab FileKandarp Tiwari
 
Computer Project For Class XII Topic - The Snake Game
Computer Project For Class XII Topic - The Snake Game Computer Project For Class XII Topic - The Snake Game
Computer Project For Class XII Topic - The Snake Game Pritam Samanta
 
Cs pritical file
Cs pritical fileCs pritical file
Cs pritical fileMitul Patel
 
Computer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market BillingComputer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market BillingHarsh Kumar
 
Workshop 1: Good practices in JavaScript
Workshop 1: Good practices in JavaScriptWorkshop 1: Good practices in JavaScript
Workshop 1: Good practices in JavaScriptVisual Engineering
 

Similar to Computer (20)

Hotel Management Presentation by Aryan Singh Dhiman
Hotel Management Presentation by Aryan Singh DhimanHotel Management Presentation by Aryan Singh Dhiman
Hotel Management Presentation by Aryan Singh Dhiman
 
Telephone billing system in c++
Telephone billing system in c++Telephone billing system in c++
Telephone billing system in c++
 
Durgesh
DurgeshDurgesh
Durgesh
 
Railway reservation(c++ project)
Railway reservation(c++ project)Railway reservation(c++ project)
Railway reservation(c++ project)
 
C s investigatory project on telephone directory
C s  investigatory project on telephone directoryC s  investigatory project on telephone directory
C s investigatory project on telephone directory
 
computerscience-170129081612.pdf
computerscience-170129081612.pdfcomputerscience-170129081612.pdf
computerscience-170129081612.pdf
 
Railway reservation(c++ project)
Railway reservation(c++ project)Railway reservation(c++ project)
Railway reservation(c++ project)
 
OOP PPT Group H.pptx
OOP PPT Group H.pptxOOP PPT Group H.pptx
OOP PPT Group H.pptx
 
2014 computer science_question_paper
2014 computer science_question_paper2014 computer science_question_paper
2014 computer science_question_paper
 
C++ and OOPS Crash Course by ACM DBIT | Grejo Joby
C++ and OOPS Crash Course by ACM DBIT | Grejo JobyC++ and OOPS Crash Course by ACM DBIT | Grejo Joby
C++ and OOPS Crash Course by ACM DBIT | Grejo Joby
 
Computer Investigatory Project
Computer Investigatory ProjectComputer Investigatory Project
Computer Investigatory Project
 
Computer Networks Lab File
Computer Networks Lab FileComputer Networks Lab File
Computer Networks Lab File
 
Lecture2.ppt
Lecture2.pptLecture2.ppt
Lecture2.ppt
 
Computer Project For Class XII Topic - The Snake Game
Computer Project For Class XII Topic - The Snake Game Computer Project For Class XII Topic - The Snake Game
Computer Project For Class XII Topic - The Snake Game
 
Managing console
Managing consoleManaging console
Managing console
 
CGI.ppt
CGI.pptCGI.ppt
CGI.ppt
 
Cs pritical file
Cs pritical fileCs pritical file
Cs pritical file
 
Computer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market BillingComputer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market Billing
 
C++ L01-Variables
C++ L01-VariablesC++ L01-Variables
C++ L01-Variables
 
Workshop 1: Good practices in JavaScript
Workshop 1: Good practices in JavaScriptWorkshop 1: Good practices in JavaScript
Workshop 1: Good practices in JavaScript
 

Recently uploaded

Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 

Recently uploaded (20)

Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 

Computer

  • 1.
  • 2. FILE GENERATED DATA FILES HOTEL.DAT PROGRAMME TITLE HOTEL MANAGEMENT.CPP OBJECT FILE HOTEL.OBJ EXECUTION FILE HOTEL.EXE
  • 3.
  • 4.
  • 5. CONTENT 1. HEADER FILE USED………………… 2. FILE GENERATED …………………… 3. WORKING DESCRIPTION ………….. 4. CODING………………………………… 5. OUTPUT SCREENS…………………... 6. CONCLUSION ……………………….. 7. BIBLIOGRAPHY………………………
  • 6. CERTIFICATE This is to certify that AMIT KUMAR YADAV of class – XII has prepared the computer science assignment for the year 2018-19 on the project entitled “ HOTEL MANAGEMENT ”. the project is the result of his effort & endeavor the project is found worthy of acceptance as final project report for the subject computer science of class - XII. He is prepared the project under my guidance. SIGNATURE OF PRINCIPAL SIGNATURE OF INTERNAL EXAMINER SGNATURE OF EXTERNAL EXAMINER
  • 7. ACKNOWLEDGEMENT I would like to express a deep sense of thanks & gratitude to my project guide MR. PARMENDRA MANGAL sir for guiding me immensely through the course of the project. He always evinced keen interest in my work. His constructive advice and constant motivation have been responsible for the successful completion of this project . My sincere thanks goes to MR. ANIL KUMAR, our principal sir for his co-ordination in extending every possible support for the completion of this project. I also thanks for my parent for their motivation and support . I must thanks for my classmates for their timely help and support for compilation for these project . Last but not the least, I would like to thanks all those who had helped directly or inirectly towards the completion for this project. AMIT KUMAR YADAV CLASS - XII
  • 8. CODING // HOTEL MANAGEMENT SYSTEM //SUBMITTED BY AMIT KUMAR YADAV #include<iostream.h> #include<conio.h> #include<fstream.h> #include<stdio.h> #include<dos.h> class hotel { int room_no; char name[30]; char address[50]; char phone[10]; public: void main_menu();//to dispay the main menu void add(); //to book a room void display(); //to display the customer record void rooms(); //to display alloted rooms void edit(); //to edit the customer record int check(int); //to check room status void modify(int);//to modify the record void delete_rec(int); //to delete the record }; void hotel::main_menu() { int choice; while(choice!=5) { clrscr(); cout<<"ntttt*************"; cout<<"ntttt* MAIN MENU *"; cout<<"ntttt*************"; cout<<"nnnttt1.Book A Room"; cout<<"nttt2.Customer Record"; cout<<"nttt3.Rooms Allotted"; cout<<"nttt4.Edit Record"; cout<<"nttt5.Exit"; cout<<"nntttEnter Your Choice: "; cin>>choice; switch(choice)
  • 9. { case 1: add(); break; case 2: display(); break; case 3: rooms(); break; case 4: edit(); break; case 5: break; default: { cout<<"nntttWrong choice!!!"; cout<<"ntttPress any key to continue!!"; getch(); } } } } void hotel::add() { clrscr(); int r,flag; ofstream fout("Record.dat",ios::app); cout<<"n Enter Customer Detalis"; cout<<"n **********************"; cout<<"nn Room no: "; cin>>r; flag=check(r); if(flag) cout<<"n Sorry..!!!Room is already booked"; else { room_no=r; cout<<" Name: "; gets(name); cout<<" Address: "; gets(address); cout<<" Phone No: "; gets(phone); fout.write((char*)this,sizeof(hotel)); cout<<"n Room is booked!!!"; } cout<<"n Press any key to continue!!"; getch(); fout.close(); } void hotel::display() { clrscr(); ifstream fin("Record.dat",ios::in); int r,flag;
  • 10. cout<<"n Enter room no: "; cin>>r; while(!fin.eof()) { fin.read((char*)this,sizeof(hotel)); if(room_no==r) { clrscr(); cout<<"n Cusromer Details"; cout<<"n ****************"; cout<<"nn Room no: "<<room_no; cout<<"n Name: "<<name; cout<<"n Address: "<<address; cout<<"n Phone no: "<<phone; flag=1; break; } } if(flag==0) cout<<"n Sorry Room no. not found or vacant!!"; cout<<"nn Press any key to continue!!"; getch(); fin.close(); } void hotel::rooms() { clrscr(); ifstream fin("Record.dat",ios::in); cout<<"ntttList Of Rooms Allotted"; cout<<"nttt*********************"; cout<<"nn Room No.tNamettAddressttPhone No.n"; while(!fin.eof()) { fin.read((char*)this,sizeof(hotel)); cout<<"nn "<<room_no<<"tt"<<name; cout<<"tt"<<address<<"tt"<<phone; } cout<<"nnntttPress any key to continue!!"; getch(); fin.close(); } void hotel::edit() { clrscr(); int choice,r; cout<<"n EDIT MENU"; cout<<"n *********"; cout<<"nn 1.Modify Customer Record"; cout<<"n 2.Delete Customer Record";
  • 11. cout<<"n Enter your choice: "; cin>>choice; clrscr(); cout<<"n Enter room no: "; cin>>r; switch(choice) { case 1: modify(r); break; case 2: delete_rec(r); break; default: cout<<"n Wrong Choice!!"; } cout<<"n Press any key to continue!!!"; getch(); } int hotel::check(int r) { int flag=0; ifstream fin("Record.dat",ios::in); while(!fin.eof()) { fin.read((char*)this,sizeof(hotel)); if(room_no==r) { flag=1; break; } } fin.close(); return(flag); } void hotel::modify(int r) { long pos,flag=0; fstream file("Record.dat",ios::in|ios::out|ios::binary); while(!file.eof()) { pos=file.tellg(); file.read((char*)this,sizeof(hotel)); if(room_no==r) { cout<<"n Enter New Details"; cout<<"n *****************"; cout<<"n Name: "; gets(name); cout<<" Address: "; gets(address); cout<<" Phone no: "; gets(phone);
  • 12. file.seekg(pos); file.write((char*)this,sizeof(hotel)); cout<<"n Record is modified!!"; flag=1; break; } } if(flag==0) cout<<"n Sorry Room no. not found or vacant!!"; file.close(); } void hotel::delete_rec(int r) { int flag=0; char ch; ifstream fin("Record.dat",ios::in); ofstream fout("temp.dat",ios::out); while(!fin.eof()) { fin.read((char*)this,sizeof(hotel)); if(room_no==r) { cout<<"n Name: "<<name; cout<<"n Address: "<<address; cout<<"n Pone No: "<<phone; cout<<"nn Do you want to delete this record(y/n): "; cin>>ch; if(ch=='n') fout.write((char*)this,sizeof(hotel)); flag=1; } else fout.write((char*)this,sizeof(hotel)); } fin.close(); fout.close(); if(flag==0) cout<<"n Sorry room no. not found or vacant!!"; else { remove("Record.dat"); rename("temp.dat","Record.dat"); } } void main() { hotel h; textmode(C80); textbackground(WHITE);
  • 13. textcolor(RED); clrscr(); cout<<"nttt****************************"; cout<<"nttt* HOTEL MANAGEMENT PROJECT *"; cout<<"nttt****************************"; sleep(2); cout<<"nnnnttMade By:"; sleep(2); cout<<" AMIT KUMAR YADAV "; sleep(2); cout<<"nnnnnttttPress any key to continue!!"; getch(); h.main_menu(); }
  • 15.  www.thecrazyprogrammer.com  Computerscience with c++ by sumita arora  Object oriented programme by Robert lafore.
  • 16. HEADER FILE USED  FSTREM.H -: for file handling , cin and cout.  PROCESS.H -:for exist() function.  CONIO.H -: for clrscr() and getch() function.  STDIO.H -: for standard I/O operation.  STRING.H -: for string handling.  MATH.H -: for doing mathematical operations.
  • 17. OUTPUT SCREEN 1. WELCOME SCREEN 2. MAIN MENU
  • 18.
  • 19. 3. BOOK A ROOM 4. DETAIL CUSTOMER
  • 20. 5 . ROOM ALLOTTED 6 . EDIT RECORD
  • 22. WORKING DESCRIPTION This program is designed to keep the hotel’s record. This program consist of five option as follows 1. Book room 2. Customer record 3. Room allotted 4. Edit record 5. Exit