SlideShare una empresa de Scribd logo
1 de 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();
}

Más contenido relacionado

La actualidad más candente

La actualidad más candente (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)
 

Destacado

Clearwater DFC
Clearwater DFCClearwater DFC
Clearwater DFCBeth Hood
 
Semita - Sourcing for Growth 2-15
Semita - Sourcing for Growth 2-15Semita - Sourcing for Growth 2-15
Semita - Sourcing for Growth 2-15Edmund Tann
 
Carlos_Zamora_2016_Resume
Carlos_Zamora_2016_ResumeCarlos_Zamora_2016_Resume
Carlos_Zamora_2016_ResumeCarlos Zamora
 
College Retention Rate Research
College Retention Rate ResearchCollege Retention Rate Research
College Retention Rate ResearchQai Gordon
 
Multicom's Brochure
Multicom's BrochureMulticom's Brochure
Multicom's BrochureMulticom Srl
 
CurrencyManipulationAssignment
CurrencyManipulationAssignmentCurrencyManipulationAssignment
CurrencyManipulationAssignmentChelsea Williams
 
PresentationPatterns_v2
PresentationPatterns_v2PresentationPatterns_v2
PresentationPatterns_v2Maksym Tolstik
 
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, EnglishAskozia
 
ADEWUYI REUBEN ADEBARE CV
ADEWUYI REUBEN ADEBARE CVADEWUYI REUBEN ADEBARE CV
ADEWUYI REUBEN ADEBARE CVReuben Adewuyi
 
TAGD Bylaws Proposed Changes
TAGD Bylaws Proposed ChangesTAGD Bylaws Proposed Changes
TAGD Bylaws Proposed ChangesBeth Hood
 

Destacado (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
 

Último

Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...only4webmaster01
 
➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men 🔝mahisagar🔝 Esc...
➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men  🔝mahisagar🔝   Esc...➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men  🔝mahisagar🔝   Esc...
➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men 🔝mahisagar🔝 Esc...amitlee9823
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...amitlee9823
 
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangaloreamitlee9823
 
Call Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night StandCall Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
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...Elaine Werffeli
 
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Just Call Vip call girls Mysore Escorts ☎️9352988975 Two shot with one girl (...
Just Call Vip call girls Mysore Escorts ☎️9352988975 Two shot with one girl (...Just Call Vip call girls Mysore Escorts ☎️9352988975 Two shot with one girl (...
Just Call Vip call girls Mysore Escorts ☎️9352988975 Two shot with one girl (...gajnagarg
 
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...amitlee9823
 
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 - AlmoraGovindSinghDasila
 
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men 🔝Dindigul🔝 Escor...
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men  🔝Dindigul🔝   Escor...➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men  🔝Dindigul🔝   Escor...
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men 🔝Dindigul🔝 Escor...amitlee9823
 
Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...gajnagarg
 
➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men 🔝Sambalpur🔝 Esc...
➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men  🔝Sambalpur🔝   Esc...➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men  🔝Sambalpur🔝   Esc...
➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men 🔝Sambalpur🔝 Esc...amitlee9823
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...amitlee9823
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...amitlee9823
 
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night StandCall Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Just Call Vip call girls kakinada Escorts ☎️9352988975 Two shot with one girl...
Just Call Vip call girls kakinada Escorts ☎️9352988975 Two shot with one girl...Just Call Vip call girls kakinada Escorts ☎️9352988975 Two shot with one girl...
Just Call Vip call girls kakinada Escorts ☎️9352988975 Two shot with one girl...gajnagarg
 

Último (20)

Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
 
➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men 🔝mahisagar🔝 Esc...
➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men  🔝mahisagar🔝   Esc...➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men  🔝mahisagar🔝   Esc...
➥🔝 7737669865 🔝▻ mahisagar Call-girls in Women Seeking Men 🔝mahisagar🔝 Esc...
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
 
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
 
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
 
Call Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night StandCall Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Shivaji Nagar ☎ 7737669865 🥵 Book Your One night Stand
 
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...
 
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
 
Just Call Vip call girls Mysore Escorts ☎️9352988975 Two shot with one girl (...
Just Call Vip call girls Mysore Escorts ☎️9352988975 Two shot with one girl (...Just Call Vip call girls Mysore Escorts ☎️9352988975 Two shot with one girl (...
Just Call Vip call girls Mysore Escorts ☎️9352988975 Two shot with one girl (...
 
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
 
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
 
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men 🔝Dindigul🔝 Escor...
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men  🔝Dindigul🔝   Escor...➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men  🔝Dindigul🔝   Escor...
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men 🔝Dindigul🔝 Escor...
 
Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...
Just Call Vip call girls roorkee Escorts ☎️9352988975 Two shot with one girl ...
 
➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men 🔝Sambalpur🔝 Esc...
➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men  🔝Sambalpur🔝   Esc...➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men  🔝Sambalpur🔝   Esc...
➥🔝 7737669865 🔝▻ Sambalpur Call-girls in Women Seeking Men 🔝Sambalpur🔝 Esc...
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
 
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night StandCall Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
 
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Saket (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Just Call Vip call girls kakinada Escorts ☎️9352988975 Two shot with one girl...
Just Call Vip call girls kakinada Escorts ☎️9352988975 Two shot with one girl...Just Call Vip call girls kakinada Escorts ☎️9352988975 Two shot with one girl...
Just Call Vip call girls kakinada Escorts ☎️9352988975 Two shot with one girl...
 

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(); }