Easy there, pal!
To access the Objects challenges in the JavaScript programming, you need to sign up and subscribe first.
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?
Meow! Finish the configurator for me. I created the
houseobject 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).I also created the
materialPricemap where the cost of any possible construction material is recorded.Add to the object two methods:
calculateSquare, which will return the house area, andcalculatePrice, which will return the cost of construction.Calculate area as follows: multiply the number of rooms by the coefficient and the number of floors in the house.
The price of construction is the product of the area and the cost of the material to build the house.
I’m waiting for the result! Maybe I’ll invite you to the housewarming party.
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!
You’ve gone to a different page
Click inside the mini-browser to shift the focus onto this window.
To access the Objects challenges in the JavaScript programming, you need to sign up and subscribe first.
Have you forgotten your password or lost access to your profile? Enter your email connected to your profile and we will send you a link to restore access.
Forgot to connect your email to the profile? Email us and we’ll help.