SlideShare a Scribd company logo
1 of 13
OUTPUT FORMS:-
SOURCE CODE:-
#include<iostream.h>
#include<fstream.h>
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<conio.h>
class HOTEL
{
int room_no;
char Name [30];
char Address[50];
char Phone[10];
int days;
int n;
int Total_fare;
char Date_Of_Booking[10];
public:
void menu();
void details();
void search();
void rooms_alloted();
void Modify_data();
void Room_Charge();
int check(int);
void modify(int);
void Bill();
void fare()
{
if(n==1)
Total_fare=1600*days;
else if(n==2)
Total_fare=1800*days;
else if (n==3)
Total_fare=1300*days;
else if (n==4)
Total_fare=1500*days;
} };
void HOTEL::menu()
{
int choose;
while(choose!=6)
{
clrscr();
cout<<"ntttt################";
cout<<"ntttt** MAIN MENU **";
cout<<"ntttt################";
cout<<"nnnttt1. Book A Room";
cout<<"nttt2. Data";
cout<<"nttt3. Show all room alloted";
cout<<"nttt4. Edit record";
cout<<"nttt5. Room charge";
cout<<"nttt6.Exit";
cout<<"nnttEnter Your Choice:";
cin>>choose;
switch(choose)
{
case 1:details();
break;
case 2:search();
break;
case 3:rooms_alloted();
break;
case 4: Modify_data();
break;
case 5: Room_Charge();
break;
case 6:break;
default:cout<<"WRONG CHOICE";
cout<<"Press Any Key To Continue";
getch();
}
}
}
void HOTEL::details()
{
clrscr();
int r,flag;
ofstream fout("HOTEL.dat",ios::app);
cout<<"Enter Customer Details";
randomize();
r=100+random(400);
room_no=r;
cout<<"Name";
gets(Name);
cout<<"Address";
gets(Address);
cout<<"Phone";
gets(Phone);
cout<<"Date of booking";
gets(Date_Of_Booking);
cout<<"How many days you stay";
cin>>days;
fout.write((char*)this,sizeof(HOTEL));
cout<<"Your room has been booked";
cout<<"n Room no:"<<room_no;
cout<<"Press Any Key To Continue";
getch();
fout.close();
}
void HOTEL:: Room_Charge()
{
cout<<"How many days you stay";
cin>>days;
cout<<"t1.SINGLE BED WITH AC: Rs 1600n";
cout<<"t2.DOUBLE BED WITH AC: Rs 1800n";
cout<<"t3.SINGLE BED WITH FAN: Rs 1300n";
cout<<"t4.DOUBLE BED WITH FAN: Rs 1500n";
cout<<"Enter your choice";
cin>>n;
fare();
Bill();
cout<<"Press Any Key To Continue";
getch();
}
void HOTEL::search()
{
fstream fin("HOTEL.dat",ios::in);
int r,flag;
cout<<"Enter room no.";
cin>>r;
while(!fin.eof())
{
fin.read((char*)this,sizeof(HOTEL));
if(room_no==r)
{
clrscr();
cout<<"Customer details";
cout<<"n";
cout<<"nn";
cout<<"Room no:"<<room_no;
cout<<"n";
cout<<"Name:"<<Name;
cout<<"n";
cout<<"Address:"<<Address;
cout<<"n";
cout<<"Phone no:"<<Phone;
flag=1;
break;
}
}
if(flag==0)
cout<<"nn Sorry Room no. not found or vacant...!!!";
cout<<"nn";
cout<<"Press any key to continue...!!!";
getch();
fin.close();
}
void HOTEL::rooms_alloted()
{
clrscr();
ifstream fin("HOTEL.dat",ios::in);
cout<<"nttt List of Room Alloted";
cout<<"nttt-------------------";
cout<<"nnRoom No.tNamettAddressttttPhone No.n";
while(!fin.eof())
{
fin.read((char*)this,sizeof(HOTEL));
cout<<"nn"<<room_no<<"tt"<<Name;
cout<<"tt"<<Address<<"tt"<<Phone;
}
cout<<"nnnntttttt Press any key to continue..!!";
getch();
fin.close();
}
void HOTEL ::Modify_data()
{
clrscr();
int m;
cout<<"t1.MODIFY CUSTOMER RECORD";
cout<<"enter room no";
cin>>m;
modify(m);
cout<<"nnnntttttt Press any key to continue..!!";
getch();
}
int HOTEL::check(int r)
{
int flag=0;
ifstream fin("HOTEL.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("HOTEL.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";
cout<<"Enter New details:";
cout<<"n----------------";
cout<<"n";
cout<<"Name:";
gets(Name);
cout<<"nAddress:";
gets(Address);
cout<<"Phone no:";
gets(Phone);
file.seekg(pos);
file.write((char*)this,sizeof(HOTEL));
cout<<"nRecord is modified!!";
flag=1;
break;
}
}
if(flag==0)
cout<<"n";
else
cout<<"Room no is wrong";
}
void HOTEL::Bill()
{
search();
cout<<"your fare"<<Total_fare;
}
void main()
{
HOTEL h;
clrscr();
cout<<"ntttt*WELCOME TO VILLA*";
cout<<"nnttPress Any Key To Continue";
getch();
h.menu();
}

More Related Content

What's hot (12)

Newton's method for MATLAB Code
Newton's method for MATLAB CodeNewton's method for MATLAB Code
Newton's method for MATLAB Code
 
Real Life Uses of a Program (Tik Tok Toy Game) useing by C Programming
Real Life Uses of a Program (Tik Tok Toy Game) useing by C Programming Real Life Uses of a Program (Tik Tok Toy Game) useing by C Programming
Real Life Uses of a Program (Tik Tok Toy Game) useing by C Programming
 
basic programs in C++
basic programs in C++ basic programs in C++
basic programs in C++
 
oop Lecture 4
oop Lecture 4oop Lecture 4
oop Lecture 4
 
C
CC
C
 
An Introduction to Tinkerpop
An Introduction to TinkerpopAn Introduction to Tinkerpop
An Introduction to Tinkerpop
 
135
135135
135
 
Introduction to Processing and creative coding
Introduction to Processing and creative codingIntroduction to Processing and creative coding
Introduction to Processing and creative coding
 
Include
IncludeInclude
Include
 
Exp3
Exp3Exp3
Exp3
 
week-23x
week-23xweek-23x
week-23x
 
1 (1)
1 (1)1 (1)
1 (1)
 

Viewers also liked

Semita - Sourcing for Growth 2-15
Semita - Sourcing for Growth 2-15Semita - Sourcing for Growth 2-15
Semita - Sourcing for Growth 2-15
Edmund Tann
 
Carlos_Zamora_2016_Resume
Carlos_Zamora_2016_ResumeCarlos_Zamora_2016_Resume
Carlos_Zamora_2016_Resume
Carlos Zamora
 
College Retention Rate Research
College Retention Rate ResearchCollege Retention Rate Research
College Retention Rate Research
Qai Gordon
 
CurrencyManipulationAssignment
CurrencyManipulationAssignmentCurrencyManipulationAssignment
CurrencyManipulationAssignment
Chelsea Williams
 
PresentationPatterns_v2
PresentationPatterns_v2PresentationPatterns_v2
PresentationPatterns_v2
Maksym Tolstik
 
ADEWUYI REUBEN ADEBARE CV
ADEWUYI REUBEN ADEBARE CVADEWUYI REUBEN ADEBARE CV
ADEWUYI REUBEN ADEBARE CV
Reuben Adewuyi
 

Viewers also liked (19)

Clearwater DFC
Clearwater DFCClearwater DFC
Clearwater DFC
 
Metcalf Resume
Metcalf ResumeMetcalf Resume
Metcalf Resume
 
Screen Size and You
Screen Size and YouScreen Size and You
Screen Size and You
 
Semita - Sourcing for Growth 2-15
Semita - Sourcing for Growth 2-15Semita - Sourcing for Growth 2-15
Semita - Sourcing for Growth 2-15
 
Carlos_Zamora_2016_Resume
Carlos_Zamora_2016_ResumeCarlos_Zamora_2016_Resume
Carlos_Zamora_2016_Resume
 
2013 SS wardrobe LRES
2013 SS wardrobe LRES2013 SS wardrobe LRES
2013 SS wardrobe LRES
 
Meet the Team
Meet the TeamMeet the Team
Meet the Team
 
College Retention Rate Research
College Retention Rate ResearchCollege Retention Rate Research
College Retention Rate Research
 
Multicom's Brochure
Multicom's BrochureMulticom's Brochure
Multicom's Brochure
 
Cv 280616
Cv 280616Cv 280616
Cv 280616
 
CurrencyManipulationAssignment
CurrencyManipulationAssignmentCurrencyManipulationAssignment
CurrencyManipulationAssignment
 
PresentationPatterns_v2
PresentationPatterns_v2PresentationPatterns_v2
PresentationPatterns_v2
 
What’s new in version 5 of AskoziaPBX? - webinar 2016, English
What’s new in version 5 of AskoziaPBX? - webinar 2016, EnglishWhat’s new in version 5 of AskoziaPBX? - webinar 2016, English
What’s new in version 5 of AskoziaPBX? - webinar 2016, English
 
Ibm
IbmIbm
Ibm
 
ADEWUYI REUBEN ADEBARE CV
ADEWUYI REUBEN ADEBARE CVADEWUYI REUBEN ADEBARE CV
ADEWUYI REUBEN ADEBARE CV
 
Resume
ResumeResume
Resume
 
Estigma
EstigmaEstigma
Estigma
 
TAGD Bylaws Proposed Changes
TAGD Bylaws Proposed ChangesTAGD Bylaws Proposed Changes
TAGD Bylaws Proposed Changes
 
Resume Carolyn 2015
Resume Carolyn 2015Resume Carolyn 2015
Resume Carolyn 2015
 

Recently uploaded

Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
gajnagarg
 
Gartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptxGartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptx
chadhar227
 
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Klinik kandungan
 
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
Health
 
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...
HyderabadDolls
 
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
Bertram Ludäscher
 
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
wsppdmt
 
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
gajnagarg
 
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Riyadh +966572737505 get cytotec
 
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
gajnagarg
 

Recently uploaded (20)

Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
 
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With OrangePredicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
 
Gartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptxGartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptx
 
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
 
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
 
Ranking and Scoring Exercises for Research
Ranking and Scoring Exercises for ResearchRanking and Scoring Exercises for Research
Ranking and Scoring Exercises for Research
 
Aspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - AlmoraAspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - Almora
 
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...
 
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
 
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
 
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book nowVadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
 
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
 
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
 
Fun all Day Call Girls in Jaipur 9332606886 High Profile Call Girls You Ca...
Fun all Day Call Girls in Jaipur   9332606886  High Profile Call Girls You Ca...Fun all Day Call Girls in Jaipur   9332606886  High Profile Call Girls You Ca...
Fun all Day Call Girls in Jaipur 9332606886 High Profile Call Girls You Ca...
 
TrafficWave Generator Will Instantly drive targeted and engaging traffic back...
TrafficWave Generator Will Instantly drive targeted and engaging traffic back...TrafficWave Generator Will Instantly drive targeted and engaging traffic back...
TrafficWave Generator Will Instantly drive targeted and engaging traffic back...
 
Kings of Saudi Arabia, information about them
Kings of Saudi Arabia, information about themKings of Saudi Arabia, information about them
Kings of Saudi Arabia, information about them
 
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Research
 
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
 
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...
 

HOTEL MANGEMENT

  • 1.
  • 2.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8. SOURCE CODE:- #include<iostream.h> #include<fstream.h> #include<stdio.h> #include<string.h> #include<stdlib.h> #include<conio.h> class HOTEL { int room_no; char Name [30]; char Address[50]; char Phone[10]; int days; int n; int Total_fare; char Date_Of_Booking[10]; public: void menu(); void details(); void search(); void rooms_alloted();
  • 9. void Modify_data(); void Room_Charge(); int check(int); void modify(int); void Bill(); void fare() { if(n==1) Total_fare=1600*days; else if(n==2) Total_fare=1800*days; else if (n==3) Total_fare=1300*days; else if (n==4) Total_fare=1500*days; } }; void HOTEL::menu() { int choose; while(choose!=6) { clrscr(); cout<<"ntttt################"; cout<<"ntttt** MAIN MENU **"; cout<<"ntttt################"; cout<<"nnnttt1. Book A Room"; cout<<"nttt2. Data"; cout<<"nttt3. Show all room alloted"; cout<<"nttt4. Edit record"; cout<<"nttt5. Room charge"; cout<<"nttt6.Exit"; cout<<"nnttEnter Your Choice:"; cin>>choose; switch(choose) { case 1:details(); break; case 2:search(); break; case 3:rooms_alloted(); break; case 4: Modify_data(); break; case 5: Room_Charge(); break; case 6:break; default:cout<<"WRONG CHOICE"; cout<<"Press Any Key To Continue";
  • 10. getch(); } } } void HOTEL::details() { clrscr(); int r,flag; ofstream fout("HOTEL.dat",ios::app); cout<<"Enter Customer Details"; randomize(); r=100+random(400); room_no=r; cout<<"Name"; gets(Name); cout<<"Address"; gets(Address); cout<<"Phone"; gets(Phone); cout<<"Date of booking"; gets(Date_Of_Booking); cout<<"How many days you stay"; cin>>days; fout.write((char*)this,sizeof(HOTEL)); cout<<"Your room has been booked"; cout<<"n Room no:"<<room_no; cout<<"Press Any Key To Continue"; getch(); fout.close(); } void HOTEL:: Room_Charge() { cout<<"How many days you stay"; cin>>days; cout<<"t1.SINGLE BED WITH AC: Rs 1600n"; cout<<"t2.DOUBLE BED WITH AC: Rs 1800n"; cout<<"t3.SINGLE BED WITH FAN: Rs 1300n"; cout<<"t4.DOUBLE BED WITH FAN: Rs 1500n"; cout<<"Enter your choice"; cin>>n; fare(); Bill(); cout<<"Press Any Key To Continue"; getch(); } void HOTEL::search() { fstream fin("HOTEL.dat",ios::in); int r,flag; cout<<"Enter room no."; cin>>r;
  • 11. while(!fin.eof()) { fin.read((char*)this,sizeof(HOTEL)); if(room_no==r) { clrscr(); cout<<"Customer details"; cout<<"n"; cout<<"nn"; cout<<"Room no:"<<room_no; cout<<"n"; cout<<"Name:"<<Name; cout<<"n"; cout<<"Address:"<<Address; cout<<"n"; cout<<"Phone no:"<<Phone; flag=1; break; } } if(flag==0) cout<<"nn Sorry Room no. not found or vacant...!!!"; cout<<"nn"; cout<<"Press any key to continue...!!!"; getch(); fin.close(); } void HOTEL::rooms_alloted() { clrscr(); ifstream fin("HOTEL.dat",ios::in); cout<<"nttt List of Room Alloted"; cout<<"nttt-------------------"; cout<<"nnRoom No.tNamettAddressttttPhone No.n"; while(!fin.eof()) { fin.read((char*)this,sizeof(HOTEL)); cout<<"nn"<<room_no<<"tt"<<Name; cout<<"tt"<<Address<<"tt"<<Phone; } cout<<"nnnntttttt Press any key to continue..!!"; getch(); fin.close(); } void HOTEL ::Modify_data() { clrscr(); int m; cout<<"t1.MODIFY CUSTOMER RECORD";
  • 12. cout<<"enter room no"; cin>>m; modify(m); cout<<"nnnntttttt Press any key to continue..!!"; getch(); } int HOTEL::check(int r) { int flag=0; ifstream fin("HOTEL.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("HOTEL.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"; cout<<"Enter New details:"; cout<<"n----------------"; cout<<"n"; cout<<"Name:"; gets(Name); cout<<"nAddress:"; gets(Address); cout<<"Phone no:"; gets(Phone); file.seekg(pos); file.write((char*)this,sizeof(HOTEL)); cout<<"nRecord is modified!!"; flag=1; break;
  • 13. } } if(flag==0) cout<<"n"; else cout<<"Room no is wrong"; } void HOTEL::Bill() { search(); cout<<"your fare"<<Total_fare; } void main() { HOTEL h; clrscr(); cout<<"ntttt*WELCOME TO VILLA*"; cout<<"nnttPress Any Key To Continue"; getch(); h.menu(); }