-
Notifications
You must be signed in to change notification settings - Fork 9
/
Land Survey.cpp
84 lines (73 loc) · 1.26 KB
/
Land Survey.cpp
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
//last two testcases not working
#include <iostream>
using namespace std;
class address
{
public:
int hno;
char cty[20], state[20];
public:
void getad()
{
cin >> hno >> cty >> state;
}
void putad()
{
cout << "House No=" << hno << '\n'
<< "City=" << cty << '\n'
<< "State=" << state << '\n';
}
};
class room
{
public:
int l, b, h;
public:
void getroom()
{
cin >> l >> b >> h;
}
void putroom()
{
cout << "Length=" << l << '\n'
<< "Breadth=" << b << '\n'
<< "Height=" << h << '\n';
}
};
class house
{
public:
char hname[20];
class address a;
class room r[10];
int size;
public:
void input()
{
cin >> hname;
a.getad();
cin >> size;
for (int i = 0; i < size; i++)
{
// cout<<"House Details"<<i+1<<'\n';
r[i].getroom();
}
}
void display()
{
cout << "House name=" << hname << '\n';
a.putad();
for (int i = 0; i < size; i++)
{
cout << "Details of Room " << i + 1 << '\n';
r[i].putroom();
}
}
};
int main()
{
house x;
x.input();
x.display();
return 0;
}