Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialIJ v B
248 PointsI DO NOT UNDERSTAND WHAT DO WRONG! Can some help me?
i would like to get help with this
// the height and width of a wall
let height = 120.0 // in inches
let width = 144.0 // in inches
let area = height * width
let areaInFeet = Area / 12
5 Answers
L B
28,323 PointsFirstly, you have capital A when calling area which is wrong. But thats not the main problem. You are trying to do the following:
(120 * 144) / 12 = 1440 : This is wrong
(120 / 12) * (144 / 12) = 120 : This is correct
So the answer is:
let areaInFeet = (height / 12) * (width / 12)
Martin Wildfeuer
Courses Plus Student 11,071 Pointslet areaInFeet = Area / 12
First of all, you have written area with a capital a, therefore it is an undefined variable which throws an error. Changing this will make your code compile, however, you need to tweak the calculation:
Your 'areaInFeet' constant has the wrong value. Divide height by 12 to get the height in feet. Do the same with the width. Then multiply the height in feet by the width in feet.
Hope that helps :)
IJ v B
248 Pointsthanks a lot
IJ v B
248 Pointsthanks a lot
IJ v B
248 PointsI really appreciate the fast reply!
thanks Guys
Martin Wildfeuer
Courses Plus Student 11,071 PointsMartin Wildfeuer
Courses Plus Student 11,071 PointsAh, you were faster, one up ;)