-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path02RESORT.CPP
More file actions
54 lines (49 loc) · 826 Bytes
/
Copy path02RESORT.CPP
File metadata and controls
54 lines (49 loc) · 826 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/* Resort Expense Calculator */
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
class resort
{
private :
int rno;
char cname[30];
float chr,dayrate,total,a;
float compute()
{
a=chr*dayrate;
if (a>11000)
return (1.02*a);
else
return (a);
}
public :
void getinfo();
void display();
};
void resort::getinfo()
{
clrscr();
cout<<"Enter room no.: ";
cin>>rno;
cout<<"\nEnter customer name : ";
gets(cname);
cout<<"\nEnter no.of days of stay : ";
cin>>chr;
cout<<"\nEnter per day rate : ";
cin>>dayrate;
total=compute();
}
void resort::display()
{
clrscr();
cout<<"Room no.: "<<rno<<endl;
cout<<"Customer name : "<<cname<<endl;
cout<<"Total bill : "<<total<<endl;
}
void main()
{
resort r;
r.getinfo();
r.display();
getch();
}