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 trialJorge Ayala
1,025 PointsHow do you find the area in feet of constants given the area and width in inches.
height is 120.0 inches width is 144.0 inches and they're both constants "let"
// the height and width of a wall
let height = 120.0 // in inches
let width = 144.0 // in inches
Anjali Pasupathy
28,883 PointsYou need to divide by 144, not 12. height and width are both in inches, so you need to convert both to feet.
let height = 120.0 // in inches
let width = 144.0 // in inches
/*
Converting inches to feet:
heightInFeet = height / 12
widthInFeet = width / 12
Calculating area:
areaInSquareFeet = heightInFeet * widthInFeet
areaInSquareFeet = (height / 12) * (width / 12)
areaInSquareFeet = height * width / (12 * 12)
areaInSquareFeet = height * width / 144
*/
let area = height * width / 144
gianpierovecchi
15,043 PointsThanks for the correction Anjali :)
Anjali Pasupathy
28,883 PointsYou're welcome! (:
Jorge Ayala
1,025 PointsThank you for the help, I can see where I was making the mistake and corrected it.
Anjali Pasupathy
28,883 PointsYou're welcome! [:
gianpierovecchi
15,043 Pointsgianpierovecchi
15,043 PointsIf I understood the question.