0 added
0 removed
Original
2026-01-01
Modified
2026-03-09
1
<p>While you were working on the online store, Muffin decided to build a house. He began to write a configurator to calculate the area and cost of construction, but he got tired. And the truth is, why write the code yourself if there are developers who can do it for you?</p>
1
<p>While you were working on the online store, Muffin decided to build a house. He began to write a configurator to calculate the area and cost of construction, but he got tired. And the truth is, why write the code yourself if there are developers who can do it for you?</p>
2
<blockquote><p>Meow! Finish the configurator for me. I created the house object and assigned several properties to it: rooms (number of rooms), floors (number of floors), material (material for walls), coefficient (the average area of each room).</p>
2
<blockquote><p>Meow! Finish the configurator for me. I created the house object and assigned several properties to it: rooms (number of rooms), floors (number of floors), material (material for walls), coefficient (the average area of each room).</p>
3
<p>I also created the materialPrice map where the cost of any possible construction material is recorded.</p>
3
<p>I also created the materialPrice map where the cost of any possible construction material is recorded.</p>
4
<p>Add to the object two methods: calculateSquare, which will return the house area, and calculatePrice, which will return the cost of construction.</p>
4
<p>Add to the object two methods: calculateSquare, which will return the house area, and calculatePrice, which will return the cost of construction.</p>
5
<p>Calculate area as follows: multiply the number of rooms by the coefficient and the number of floors in the house.</p>
5
<p>Calculate area as follows: multiply the number of rooms by the coefficient and the number of floors in the house.</p>
6
<p>The price of construction is the product of the area and the cost of the material to build the house.</p>
6
<p>The price of construction is the product of the area and the cost of the material to build the house.</p>
7
<p>I’m waiting for the result! Maybe I’ll invite you to the housewarming party.</p>
7
<p>I’m waiting for the result! Maybe I’ll invite you to the housewarming party.</p>
8
</blockquote><p>Press Hey boss, here’s your program! to call the Boss. It’ll change the values in the object and find out how much construction will cost. Good luck!</p>
8
</blockquote><p>Press Hey boss, here’s your program! to call the Boss. It’ll change the values in the object and find out how much construction will cost. Good luck!</p>