I
I
Ivan2022-01-11 14:56:15
C++ / C#
Ivan, 2022-01-11 14:56:15

Create a console application in which the class Furniture is in a separate file for the class. How to do something like this?

Essence of the question

Create a console application in which the class Furniture is in a separate file for the class.
Then separate furniture objects will be created from this class.

table, chairs, armchair, wardrobe, sofa....
the table can have options - for example, kitchen, dining, folding, conference room
as well as chair, armchair, closet
objects will then be further divided, for example, garden, wood, metal, school.....

Be aware of the general properties of dimensions, weight, material, substance, color, use... these are actually internal variables that you set with the constructor.

Access and the ability to change some values ​​​​is carried out using the property creation method (get, set)

The class will also have methods, for example

find out how many chairs can fit in a room with some dimensions,
how much space should be in front of the closet to open the door (resizing)
the ability to rotate the furniture (this will change the required dimensions when placed on the surface)

Question: can you explain to me how to do something like this, suggest an idea or somehow explain?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Araya, 2022-01-11
@Gloriane

I would use - https://refactoring.guru/ru/design-patterns/abstra...
even the example in the article is similar to your case

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question