A Project Report On
A Project Report On
“HOTEL MANAGEMENT SYSTEM” “HOTEL MANAGEMENT SYSTEM”
Submitted By Submitted By SHASHANK JAISWAL SHASHANK JAISWAL RICHY TOMY RICHY TOMY TEJDEEP TEJDEEP Batch No:
Batch No: RTOS-348RTOS-348
Under the guidance of M/s. ANVI
Under the guidance of M/s. ANVI
An ISO 9001 Co
An ISO 9001 Companympany
Cranes Software International Ltd. Cranes Software International Ltd. (Cranes Varsity - Training Division) (Cranes Varsity - Training Division) # 5, Service Road, Domlur Layout, # 5, Service Road, Domlur Layout, Airport Roa
Airport Road, Bangalored, Bangalore-560071.-560071. Ph: 25352636/37,
INDEX
INDEX
1.
1. Acknowledgem
Acknowledgement
ent
2. Abstract
2. Abstract
3. Class Diagrams
3. Class Diagrams
4. Description of the project
4. Description of the project
5. Source Code
5. Source Code
7. Conclusion
7. Conclusion
8. Bibliography
8. Bibliography
So, with gratitude we acknowledge all those who
So, with gratitude we acknowledge all those who guided and encouraged has served aguided and encouraged has served a beacon of light and crowned the
beacon of light and crowned the effect with success.effect with success. We would like to thank
We would like to thank Cranes Varsity International Cranes Varsity International for providing an opportunity tofor providing an opportunity to carry out the project successfully.
carry out the project successfully.
We would then like to thank M/s.
We would then like to thank M/s. ANVI ANVI who guided and provided the technical andwho guided and provided the technical and moral support throughout the project.
moral support throughout the project.
Next we would also to thank the entire faculty for
Next we would also to thank the entire faculty for their full co-operation.their full co-operation.
PROJECT ASSOCIATES PROJECT ASSOCIATES SHASHANK JAISWAL SHASHANK JAISWAL RICHY TOMY RICHY TOMY TEJDEEP DORNADULA TEJDEEP DORNADULA The
The ““HOTEL MANAGEMENT SYSTEM”HOTEL MANAGEMENT SYSTEM” project has been designed keeping inproject has been designed keeping in
mind both employee and guest. For a guest to avail room he simply has to book room and mind both employee and guest. For a guest to avail room he simply has to book room and then checking in or directly checking in to the hotel. The task of maintaining the hotel rooms then checking in or directly checking in to the hotel. The task of maintaining the hotel rooms lies with the
lies with the employee.employee.
The employee has to perform 3 basic tasks: (1) Adding of rooms to the database (2) The employee has to perform 3 basic tasks: (1) Adding of rooms to the database (2) Maintain the Hotel rooms (3) Re
Maintain the Hotel rooms (3) Reserve rooms for guests, and serve rooms for guests, and (4) Generate bill at the time of (4) Generate bill at the time of guests checking out of the hotel.
guests checking out of the hotel.
The hotel allows the guests to: (1) Checkin (2) Checkout, and (3) Book Room. These The hotel allows the guests to: (1) Checkin (2) Checkout, and (3) Book Room. These features have been represented by functions in the program.
User
User
- Name
- Name
- Address
- Address
- Phone_No
- Phone_No
+ Set_details
+ Set_details
+ Get_details
+ Get_details
Employee
Employee
- Employee_Id
- Employee_Id
+ Set_id
+ Set_id
+ file_write
+ file_write
+ get_details
+ get_details
Guest
Guest
-Struct ctime objin
-Struct ctime objin
-Struct ctime objout
-Struct ctime objout
+ Add_Guest
+ Add_Guest
+ Return_Name
+ Return_Name
+checkout_guestroom
+checkout_guestroom
+ Disp_guest
+ Disp_guest
+disp_det_chkout
+disp_det_chkout
Room
Room
-- Room_noRoom_no -- TypeType -- StatusStatus -- Room_rateRoom_rate -- GnameGname+ Add_room
+ Add_room
There are total seven operations that can
There are total seven operations that can be performed using this program be performed using this program efficiently.efficiently. They are as
They are as
follows:-EMPLOYEE OPERATIONS: EMPLOYEE OPERATIONS:
Adding New Rooms To The HotelAdding New Rooms To The Hotel: which requires assigning a room : which requires assigning a room number,number, type of room whether Air conditioned or non-air conditioned, current status of type of room whether Air conditioned or non-air conditioned, current status of room whether free or reserved and charges of room per day.
room whether free or reserved and charges of room per day.
Maintaining Rooms:Maintaining Rooms: In this option, employee can check the all information of allIn this option, employee can check the all information of all the rooms in hotel or a particular room
the rooms in hotel or a particular room by inputting room number and modify itsby inputting room number and modify its details, like changing status of room
details, like changing status of room or the charges.or the charges.
Reserving Room:Reserving Room: here, the employee can check if any fhere, the employee can check if any free rooms are available inree rooms are available in the hotel database and subsequently reserve it for
the hotel database and subsequently reserve it for a guest.a guest.
Generating Bill:Generating Bill: here, at the time of guest checking out, the employee will get thehere, at the time of guest checking out, the employee will get the number of days the guest stayed in a particular room and generate the bill to be number of days the guest stayed in a particular room and generate the bill to be paid by the guest.
paid by the guest.
GUEST OPERATIONS: GUEST OPERATIONS:
Checking In:Checking In: In this guest can enter his personal details in the database if itIn this guest can enter his personal details in the database if it wishes to stay in t
wishes to stay in the hotel. After inputting he hotel. After inputting name, address and contact number, thename, address and contact number, the guest details will be stored for future references.
Checking Out:Checking Out: In this option it will In this option it will first ask the guest for the room number itfirst ask the guest for the room number it wants to vacate and then the guest will be checked out of the room and checkout wants to vacate and then the guest will be checked out of the room and checkout time will
time will be displayed.be displayed.
Book Room:Book Room: Here, guest will be asked which type of room he wishes for and Here, guest will be asked which type of room he wishes for and if if that type of room is available then if
that type of room is available then if desired checking in procedure will bedesired checking in procedure will be initiated. initiated. #include<iostream> #include<iostream> #include<iomanip> #include<iomanip> #include<fstream> #include<fstream> /*function prototype
/*function prototypes required*/ s required*/ int edit_room_det(room *obj); int edit_room_det(room *obj); void Resv_Guest(); void Resv_Guest(); /*======= /*============================================*/ =====*/ using namespace std; using namespace std; struct ctime struct ctime { { int hr; int hr; int min; int min; int sec; int sec; }; }; /*USER CLASS*/ /*USER CLASS*/ class user class user { { protected: protected: char name[20]; char name[20]; char address[50]; char address[50]; char ph_no[15]; char ph_no[15]; public: public: void
void set_details(chaset_details(char r *n,char*ad*n,char*ad,char*p),char*p) {
{
strcpy(name,n); strcpy(name,n);
strcpy(address,ad); strcpy(address,ad); strcpy(ph_no,p); strcpy(ph_no,p); } }
virtual void get_details() virtual void get_details() {
{
cout<<"\n Name :"<<name; cout<<"\n Name :"<<name; cout<<"\n Address :
cout<<"\n Address :"<<address"<<address;; cout<<"\n phone no. :"<<ph_no; cout<<"\n phone no. :"<<ph_no; } } }; }; /*EMPLOYEE CLA /*EMPLOYEE CLASS*/ SS*/
class employee:public user class employee:public user
{ { protected: protected: int e_id; int e_id; public: public:
void Set_id(int ID) void Set_id(int ID) { { e_id=ID; e_id=ID; } } void get_details() void get_details() { {
cout<<"\n Name :"<<name; cout<<"\n Name :"<<name; cout<<"\n Address
cout<<"\n Address :"<<address;:"<<address; cout<<"\n phone no.
cout<<"\n phone no. :"<<ph_no;:"<<ph_no; cout<<"\nEmploy
cout<<"\nEmployee id ee id :"<<e_id;:"<<e_id; } } void filewrite() void filewrite() { { fstream efile; fstream efile; efile.open("employee.txt",ios::out|ios::app); efile.open("employee.txt",ios::out|ios::app); efile.write((char*)this,sizeof(employee)); efile.write((char*)this,sizeof(employee)); } } }; }; /*GUEST CLASS* /*GUEST CLASS*/ /
class guest:public user class guest:public user {
{
struct ctime objin,objout; struct ctime objin,objout;
public: public: void Add_Guest() void Add_Guest() { { struct tm *time1; struct tm *time1; time_t t1; time_t t1; cout<<"Enter Name"<<endl; cout<<"Enter Name"<<endl; cin>>name; cin>>name; cout<<"Enter
cout<<"Enter Address"<<eAddress"<<endl;ndl; cin>>address;
cin>>address;
cout<<"Enter Phone Number"<<endl; cout<<"Enter Phone Number"<<endl; cin>>ph_no; cin>>ph_no; t1=time(NULL); t1=time(NULL); time1=localtime(&t1); time1=localtime(&t1); objin.sec=time1->tm_sec; objin.sec=time1->tm_sec; objin.min=time1->tm_min; objin.min=time1->tm_min; objin.hr=time1->tm_hour; objin.hr=time1->tm_hour; } } char * Ret_Name() char * Ret_Name() { { return name; return name; } } void
void chkout_guechkout_guest_room()st_room() { { struct tm *time1; struct tm *time1; time_t t1; time_t t1; t1=time(NULL); t1=time(NULL); time1=localtime(&t1); time1=localtime(&t1); objout.sec=time1->tm_sec; objout.sec=time1->tm_sec; objout.min=time1->tm_min; objout.min=time1->tm_min; objout.hr=time1->tm_hour; objout.hr=time1->tm_hour; } } void Disp_Guest() void Disp_Guest() { { cout<<"Name:"<<name<<endl; cout<<"Name:"<<name<<endl; cout<<"Address:"<<address<<endl; cout<<"Address:"<<address<<endl; cout<<"Phone
cout<<"Phone No.:"<<ph_no<No.:"<<ph_no<<endl;<endl; cout<<"Time::"<<
cout<<"Time::"<<objin.hr<<":"<<objin.min<objin.hr<<":"<<objin.min<<":"<<objin.sec<":"<<objin.sec<<endl;<<endl; }
void
void disp_det_chkdisp_det_chkout()out() {
{
cout<<"Guest Checked Out"<<endl; cout<<"Guest Checked Out"<<endl; cout<<"Name:"<<name<<endl; cout<<"Name:"<<name<<endl; cout<<"Time::"<<
cout<<"Time::"<<objout.hr<<":"<<obobjout.hr<<":"<<objout.min<<":"<<objoujout.min<<":"<<objout.sec<<endl;t.sec<<endl; } } }; }; /*ROOM CLASS*/ /*ROOM CLASS*/ class room class room { { int room_no; int room_no; char status[15]; char status[15]; char type[20]; char type[20]; float room_rate; float room_rate; char Gname[20]; char Gname[20]; public: public: void Add_Room() void Add_Room() { { cout<<"Ente
cout<<"Enter Room r Room No: "<<endl;No: "<<endl; cin>>room_no;
cin>>room_no; cout<<"Ente
cout<<"Enter r Status:"<<endl;Status:"<<endl; cin>>status;
cin>>status; cout<<"Ente
cout<<"Enter r Type:"<<endl;Type:"<<endl; cin>>type;
cin>>type; cout<<"Ente
cout<<"Enter r Room Rate:"<<endl;Room Rate:"<<endl; cin>>room_rate; cin>>room_rate; } } void Set_Status(char *S) void Set_Status(char *S) { { strcpy(status,S); strcpy(status,S); cout<<"Status changed
cout<<"Status changed to:"<<status<<eto:"<<status<<endl;ndl; } } void Set_Charges(float C) void Set_Charges(float C) { { room_rate=C; room_rate=C;
cout<<"Room Charges Per Day
} } float Get_Charges() float Get_Charges() { { return room_rate; return room_rate; } } int Get_RoomNo() int Get_RoomNo() { { return room_no; return room_no; } } char * get_status() char * get_status() { { return status; return status; } } char *Get_Type() char *Get_Type() { { return type; return type; } } void
void Add_Guest_RoAdd_Guest_Room()om() {
{
cout<<"Ente
cout<<"Enter r Guest Name:"<<endl;Guest Name:"<<endl; cin>>Gname; cin>>Gname; } } void display_room() void display_room() { { cout<<"\nroom no.
cout<<"\nroom no. :"<<room_no<<:"<<room_no<<endl;endl; cout<<"Status:"<<status<<endl;
cout<<"Status:"<<status<<endl; cout<<"Type:"<<type<<endl; cout<<"Type:"<<type<<endl; cout<<"Room
cout<<"Room Rate:"<<room_rate<Rate:"<<room_rate<<endl;<endl; }
} };
};
/*CLASSES FINISH
/*CLASSES FINISHED*/ ED*/
/*FUNCTION TO WRI
/*FUNCTION TO WRITE ROOM DETAILS TO TE ROOM DETAILS TO DATABASE*/ DATABASE*/
void
void write_room_databwrite_room_database()ase() {
{
room R; room R;
R.Add_Room(); R.Add_Room(); fstream rfile; fstream rfile; rfile.open("rooms.txt",ios::out|ios::app); rfile.open("rooms.txt",ios::out|ios::app); rfile.write((char *)&R,sizeof(R)); rfile.write((char *)&R,sizeof(R)); rfile.close(); rfile.close(); } } /*FUNCTION TO EDI
/*FUNCTION TO EDIT ROOM DETAILS ANT ROOM DETAILS AND WRITING TO DATABASD WRITING TO DATABASE*/ E*/
void Edit_Room() void Edit_Room() { { room R; room R; int Rno; int Rno; fstream rfile,tfile; fstream rfile,tfile; rfile.open("rooms.txt",ios::in); rfile.open("rooms.txt",ios::in); tfile.open("test.txt",ios::out); tfile.open("test.txt",ios::out); rfile.seekg(ios::beg); rfile.seekg(ios::beg); cout<<"en
cout<<"enter ter room number:"<<endl;room number:"<<endl; fflush(stdin); fflush(stdin); cin>>Rno; cin>>Rno; while(rfile.read((char *)&R,sizeof(R))!=0) while(rfile.read((char *)&R,sizeof(R))!=0) { { if(R.Get_RoomNo()==Rno) if(R.Get_RoomNo()==Rno) { { cout<<"\nmatch found"<<endl; cout<<"\nmatch found"<<endl; R.display_room(); R.display_room(); edit_room_det(&R); edit_room_det(&R); tfile.write((char *)&R,sizeof(R)); tfile.write((char *)&R,sizeof(R)); } } else else tfile.write((char *)&R,sizeof(R)); tfile.write((char *)&R,sizeof(R)); } } remove("rooms.txt"); remove("rooms.txt"); rename("test.txt","rooms.txt"); rename("test.txt","rooms.txt"); rfile.close(); rfile.close(); tfile.close(); tfile.close(); } }
int edit_room_det(room *obj) int edit_room_det(room *obj) { { int ch3; int ch3; for(;;) for(;;) { {
cout<<"\t"<<"\t"<<"\t"<<"E
cout<<"\t"<<"\t"<<"\t"<<"Enter Choice nter Choice To Edit"<<endl;To Edit"<<endl; cout<<"\n\t"<<"\t"<<"\t"<<"1.Status"<<endl; cout<<"\n\t"<<"\t"<<"\t"<<"1.Status"<<endl; cout<<"\n\t"<<"\t"<<"\t"<<"2.Charges"<<endl; cout<<"\n\t"<<"\t"<<"\t"<<"2.Charges"<<endl; cout<<"\n\t"<<"\t"<<"\t"<<"3.Exit:"<<endl; cout<<"\n\t"<<"\t"<<"\t"<<"3.Exit:"<<endl; fflush(stdin); fflush(stdin); cin>>ch3; cin>>ch3; switch(ch3) switch(ch3) { {
case 1:cout<<"\t"<<"\t"<<"change status:"<<endl; case 1:cout<<"\t"<<"\t"<<"change status:"<<endl; char str[10]; char str[10]; cin>>str; cin>>str; (*obj).Set_Status(str); (*obj).Set_Status(str); break; break;
case 2:cout<<"\t"<<"\t"<<"change Room
case 2:cout<<"\t"<<"\t"<<"change Room charges:"<<encharges:"<<endl;dl; float charges; float charges; cin>>charges; cin>>charges; (*obj).Set_Charges(charges); (*obj).Set_Charges(charges); break; break; case 3:return 0; case 3:return 0; } } } } } } /*FUNCTION TO DIS
/*FUNCTION TO DISPLAY ALL ROOMS*PLAY ALL ROOMS*/ / void View_Rooms() void View_Rooms() { { room R; room R; fstream rfile; fstream rfile; rfile.open("rooms.txt",ios::in); rfile.open("rooms.txt",ios::in); rfile.seekg(ios::beg); rfile.seekg(ios::beg); while(rfile.read((char *)&R,sizeof(R))!=0) while(rfile.read((char *)&R,sizeof(R))!=0) { { R.display_room();sleeP(3); R.display_room();sleeP(3); } } rfile.close(); rfile.close(); } } /*FUNCTION TO RES
/*FUNCTION TO RESERVE A ROOM FOR ERVE A ROOM FOR GUEST*/ GUEST*/ void Resv_Room()
void Resv_Room() {
room R; room R; char str[10]; char str[10]; fstream rfile,tfile; fstream rfile,tfile; rfile.open("rooms.txt",ios::in); rfile.open("rooms.txt",ios::in); rfile.seekg(ios::beg); rfile.seekg(ios::beg); cout<<"en
cout<<"enter ter room status"<<endl;room status"<<endl; fflush(stdin); fflush(stdin); cin>>str; cin>>str; while(rfile.read((char *)&R,sizeof(R))!=0) while(rfile.read((char *)&R,sizeof(R))!=0) { { if(strcmp(R.get_status(),str)==0) if(strcmp(R.get_status(),str)==0) { { R.display_room(); R.display_room(); } } } } rfile.close(); rfile.close(); Resv_Guest(); Resv_Guest(); } } /*SUB FUNCTION OF
/*SUB FUNCTION OF RESERVING GUESTRESERVING GUEST*/ */
void Resv_Guest() void Resv_Guest() { { fstream froom,troom; fstream froom,troom; room R; room R; int Rno; int Rno; cout<<"Ente
cout<<"Enter Which r Which Room You Want Room You Want To Reserve:"<<endl;To Reserve:"<<endl; cin>>Rno; cin>>Rno; froom.open("rooms.txt",ios::in); froom.open("rooms.txt",ios::in); troom.open("test.txt",ios::out); troom.open("test.txt",ios::out); while(froom.read((char *)&R,sizeof(R))!=0) while(froom.read((char *)&R,sizeof(R))!=0) { { if(R.Get_RoomNo()==Rno) if(R.Get_RoomNo()==Rno) { { R.display_room(); R.display_room(); R.Set_Status("reserve"); R.Set_Status("reserve"); R.Add_Guest_Room(); R.Add_Guest_Room(); troom.write((char *)&R,sizeof(R)); troom.write((char *)&R,sizeof(R)); } } else else troom.write((char *)&R,sizeof(R)); troom.write((char *)&R,sizeof(R)); } } froom.close(); froom.close();
troom.close(); troom.close(); remove("rooms.txt"); remove("rooms.txt"); rename("test.txt","rooms.txt"); rename("test.txt","rooms.txt"); } } /*FUNCTION TO GE
/*FUNCTION TO GENERATE BILL*/ NERATE BILL*/
void Generate_Bill() void Generate_Bill() { { fstream froom,troom; fstream froom,troom; room R; room R; int Rno,Dno; int Rno,Dno; float Rate; float Rate; cout<<"Ente
cout<<"Enter Which Room r Which Room You Want To Genarate BiLL For:"<<endl;You Want To Genarate BiLL For:"<<endl; cin>>Rno;
cin>>Rno;
cout<<"No. Of Days
cout<<"No. Of Days Stayed:"<<endStayed:"<<endl;l; cin>>Dno; cin>>Dno; froom.open("rooms.txt",ios::in); froom.open("rooms.txt",ios::in); troom.open("test.txt",ios::out); troom.open("test.txt",ios::out); while(froom.read((char *)&R,sizeof(R))!=0) while(froom.read((char *)&R,sizeof(R))!=0) { { if(R.Get_RoomNo()==Rno) if(R.Get_RoomNo()==Rno) { { R.display_room(); R.display_room(); cout<<"==========="<<endl; cout<<"==========="<<endl; Rate=R.Get_Charges(); Rate=R.Get_Charges(); R.Set_Status("free"); R.Set_Status("free"); troom.write((char *)&R,sizeof(R)); troom.write((char *)&R,sizeof(R)); cout<<"Total Bill To Be Paid:"<<endl; cout<<"Total Bill To Be Paid:"<<endl; cout<<Rate*Dno<<endl; cout<<Rate*Dno<<endl; } } else else troom.write((char *)&R,sizeof(R)); troom.write((char *)&R,sizeof(R)); } } froom.close(); froom.close(); troom.close(); troom.close(); remove("rooms.txt"); remove("rooms.txt"); rename("test.txt","rooms.txt"); rename("test.txt","rooms.txt"); } }
/*EMPLOYEE MENU* /*EMPLOYEE MENU*/ / int emp_menu() int emp_menu() { { for(;;) for(;;) { { cout<<"\t"<<"\t"<<"\t"<<"\t"<<"
cout<<"\t"<<"\t"<<"\t"<<"\t"<<"Employee Employee Menu"<<endl;Menu"<<endl; cout<<"\t"<<"\t"<<"\t"<<"\t"<<"=
cout<<"\t"<<"\t"<<"\t"<<"\t"<<"======================"<<e====="<<endl;ndl; cout<<"\n\t"<<"\t"<<"\t"<<
cout<<"\n\t"<<"\t"<<"\t"<<"\t"<<"1.Add "\t"<<"1.Add Room"<<endl;Room"<<endl; cout<<"\n\t"<<"\t"<<"\t"<<
cout<<"\n\t"<<"\t"<<"\t"<<"\t"<<"2.View "\t"<<"2.View Rooms"<<endl;Rooms"<<endl; cout<<"\n\t"<<"\t"<<"\t"<<
cout<<"\n\t"<<"\t"<<"\t"<<"\t"<<"3.Edit "\t"<<"3.Edit Room"<<endRoom"<<endl;l; cout<<"\n\t"<<"\t"<<"\t"<<
cout<<"\n\t"<<"\t"<<"\t"<<"\t"<<"4.Reserve "\t"<<"4.Reserve Room"<<endl;Room"<<endl; cout<<"\n\t"<<"\t"<<"\t"<<
cout<<"\n\t"<<"\t"<<"\t"<<"\t"<<"5.Generate "\t"<<"5.Generate Bill"<<endl;Bill"<<endl; cout<<"\n\t"<<"\t"<<"\t"<<"\t"<<"6.Exit"<<endl; cout<<"\n\t"<<"\t"<<"\t"<<"\t"<<"6.Exit"<<endl; int ch1; int ch1; cin>>ch1; cin>>ch1; switch(ch1) switch(ch1) { { case
case 1:write_room_databas1:write_room_database();e(); break; break; case 2:View_Rooms(); case 2:View_Rooms(); break; break; case 3:Edit_Room(); case 3:Edit_Room(); break; break; case 4:Resv_Room(); case 4:Resv_Room(); break; break; case 5:Generate_Bill(); case 5:Generate_Bill(); break; break; case 6:return 0; case 6:return 0; } } } } } } /*GUEST FUNCTION /*GUEST FUNCTIONS*/ S*/ /*FUNCTION TO CHECK I
/*FUNCTION TO CHECK IN GUEST*/ N GUEST*/
void
void checkin_gucheckin_guest()est() {
guest G; guest G; G.Add_Guest(); G.Add_Guest(); G.Disp_Guest(); G.Disp_Guest();
cout<<"Guest Checked In"<<endl; cout<<"Guest Checked In"<<endl; R.Set_Status("reserve"); R.Set_Status("reserve"); fstream gfile; fstream gfile; gfile.open("guests.txt",ios::out|ios::app); gfile.open("guests.txt",ios::out|ios::app); gfile.write((char *)&G,sizeof(G)); gfile.write((char *)&G,sizeof(G)); gfile.close(); gfile.close(); } }
/*BOOKING ROOM FUNCTI
/*BOOKING ROOM FUNCTION*/ ON*/
void book_room() void book_room() { { char rtype[10]; char rtype[10]; cout<<"Ente
cout<<"Enter Room r Room Type You Type You Want:(AC/NAC)"<<enWant:(AC/NAC)"<<endl;dl; cin>>rtype; cin>>rtype; room R; room R; char ch4; char ch4; fstream froom,troom; fstream froom,troom; froom.open("rooms.txt",ios::in); froom.open("rooms.txt",ios::in); while(froom.read((char *)&R,sizeof(R))!=0) while(froom.read((char *)&R,sizeof(R))!=0) { { if(strcmp(R.Get_Type(),rtype)==0) if(strcmp(R.Get_Type(),rtype)==0) { { cout<<"Rooms
cout<<"Rooms Available"<<enAvailable"<<endl;dl; cout<<"Charge
cout<<"Charges:"<<R.Get_Chargs:"<<R.Get_Charges()<<endl;es()<<endl; }
} }
}
cout<<"Do You Want To
cout<<"Do You Want To Book Room?(Y/N)"<<endl;Book Room?(Y/N)"<<endl; cin>>ch4; cin>>ch4; if(ch4=='y'||ch4=='Y') if(ch4=='y'||ch4=='Y') { { checkin_guest(); checkin_guest(); } } froom.close(); froom.close(); } }
/*GUEST CHECKOU
/*GUEST CHECKOUT FUNCTION*/ T FUNCTION*/ void
void checkout_gcheckout_guest()uest() { { guest G; guest G; char str[20]; char str[20]; cout<<"Ente
cout<<"Enter r Name To Name To Find:"<<endl;Find:"<<endl; cin>>str;
cin>>str; fstream f
fstream fguest,tguesguest,tguest;t;
fguest.open("guests.txt",ios::in); fguest.open("guests.txt",ios::in); tguest.open("test.txt",ios::out); tguest.open("test.txt",ios::out);
while(fguest.read((ch
while(fguest.read((char ar *)&G,sizeof(G))!=0)*)&G,sizeof(G))!=0) { { if(strcmp(G.Ret_Name(),str)==0) if(strcmp(G.Ret_Name(),str)==0) { { G.chkout_guest_room(); G.chkout_guest_room(); G.disp_det_chkout(); G.disp_det_chkout(); tguest.write((char *)&G,sizeof(G)); tguest.write((char *)&G,sizeof(G)); } } else else tguest.write((char *)&G,sizeof(G)); tguest.write((char *)&G,sizeof(G)); } } fguest.close(); fguest.close(); tguest.close(); tguest.close(); remove("guests.txt"); remove("guests.txt"); rename("test.txt","guests.txt"); rename("test.txt","guests.txt"); } } /*GUEST MENU*/ /*GUEST MENU*/ int
int guest_menguest_menu()u() { { for(;;) for(;;) { { cout<<"\t"<<"Gue
cout<<"\t"<<"Guest st Menu"<<endl;Menu"<<endl; cout<<"\t"<<"1.Ch
cout<<"\t"<<"1.Check eck In"<<endl;In"<<endl; cout<<"\t"<<"2.Ch
cout<<"\t"<<"2.Check eck Out"<<endl;Out"<<endl; cout<<"\t"<<"3.Bo
cout<<"\t"<<"3.Book ok Room"<<endRoom"<<endl;l; cout<<"\t"<<"4.Exit"<<endl; cout<<"\t"<<"4.Exit"<<endl; int ch2; int ch2; cin>>ch2; cin>>ch2; switch(ch2) switch(ch2) { { case 1:checkin_guest(); case 1:checkin_guest(); break; break; case
case 2:checkout_gu2:checkout_guest();est(); break;
case 3:book_room(); case 3:book_room(); break; break; case 4:return 0; case 4:return 0; } } } } } } /* MAIN PROGRAM* /* MAIN PROGRAM*/ / int main() int main() { { employee
employee e1(1,"shashanke1(1,"shashank","delhi","123"),e2(2","delhi","123"),e2(2,"tejdeep","andhra","4,"tejdeep","andhra","456");56"); e1.filewrite(); e1.filewrite(); e2.filewrite(); e2.filewrite(); int ch; int ch; for(;;) for(;;) { { cout<<"\t"<<"\t"<<"\
cout<<"\t"<<"\t"<<"\t"<<"\t"<<"Hotel t"<<"\t"<<"Hotel Management System"<<endl;Management System"<<endl; cout<<"\t"<<"\t"<<"\
cout<<"\t"<<"\t"<<"\t"<<"\t"<<"=======t"<<"\t"<<"================================"<======="<<endl;<endl; cout<<"\n\t"<<"\t"<<"\
cout<<"\n\t"<<"\t"<<"\t"<<"\t"<<"Choose t"<<"\t"<<"Choose option"<<endl;option"<<endl; cout<<"\n\t"<<"\t"<<"\t"<<"\t"<<"1.EMPLOYEE"<<endl; cout<<"\n\t"<<"\t"<<"\t"<<"\t"<<"1.EMPLOYEE"<<endl; cout<<"\n\t"<<"\t"<<"\t"<<"\t"<<"2.GUEST"<<endl; cout<<"\n\t"<<"\t"<<"\t"<<"\t"<<"2.GUEST"<<endl; cout<<"\n\t"<<"\t"<<"\t"<<"\t"<<"3.EXIT"<<endl; cout<<"\n\t"<<"\t"<<"\t"<<"\t"<<"3.EXIT"<<endl; cin>>ch; cin>>ch; switch(ch) switch(ch) { { case 1:emp_menu(); case 1:emp_menu(); break; break; case 2:guest_menu(); case 2:guest_menu(); break; break; case 3:exit(0); case 3:exit(0); } } } } } } /* END OF PROJECT /* END OF PROJECT*/ */