post  how to implement a class hierarchy??

andreif8 (2)   Link to this post
Hy there..
i need to implement a class hierarchy to configure the structure of a building..
a building got a nr. of floors,each floor got a nr. of flats,each flat got a nr. of rooms,each room got one door and a nr of windows..so..
1.i need to create a txt file to define the structure of this building
2.i need to read the txt file and to implement a class hierarchy to configure this structure

<building>1
<floor>1
<ap>1
<room>1</room>1
<room>2</room>1
<room>3</room>1
</ap>
<ap>2
<room>1</room>1
<room>2</room>1
</ap>
</floor>

<floor>2
<ap>1
<room>1</room>
<room>2</room>
<room>3</room>
<room>4</room>
</ap>
</floor>

</Bbuilding>

<building>2
<floor>1
<ap>1
<room>1</room>1
<room>2</room>1
<room>3</room>1
</ap>
<ap>2
<room>1</room>1
<room>2</room>1
</ap>
</floor>
</building>

i hope anyone can help me...i'm new in this and i would really appreciate any kind of help...10x's a lot
Bazzy (3183)   Link to this post
Is this what you are looking for?

class building with vector of floors
class floor with vector of rooms
... 
andreif8 (2)   Link to this post
probably...i'm not sure whar method should i use for this problem...
10x's again
firedraco (2048)   Link to this post
Classes containing other classes, exactly what Bazzy said

Registered users can post in this forum.