-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot.cpp
More file actions
45 lines (44 loc) · 753 Bytes
/
plot.cpp
File metadata and controls
45 lines (44 loc) · 753 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
#include<iostream>
using namespace std;
class Plot
{
private:
float length, breadth;
float cost1, cost2;
public:
void input()
{
cout<<"\nEnter length of the plot: ";
cin>>length;
cout<<"\nEnter breadth of the plot: ";
cin>>breadth;
}
float fencing(float rate)
{
cout<<"\nEnter rate for fencing: ";
cin>>rate;
cost1=2*(length+breadth)*rate;
cout<<"\nThe cost of fencing is Rs:"<<cost1<<endl;
}
float flooring(float rate)
{
cout<<"\nEnter rate for flooring: ";
cin>>rate;
cost2=length*breadth*rate;
cout<<"\nThe cost of flooring is Rs:"<<cost2<<endl;
}
Plot()
{
cost1=0;
cost2=0;
}
};
int main()
{
Plot p;
float rate;
p.input();
p.fencing(rate);
p.flooring(rate);
return 0;
}