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 trialJohn Moron
1,658 PointsHow to Give the height and width of a wall in inches, calculate the area in feet and assign it to a constant.
Please help I'm trying to assign a constent but I says I'm doing it wrong
// the height and width of a wall
let height = 120.0 // in inches
let width = 144.0 // in inches
let areaInFeet
2 Answers
melanie Goldstone
1,252 PointsYou're not assigning the let area to anything. It's supposed to look like this:
import UIKit
let height = 120.0
let width = 144.0
let area = height * width
stan dresa
515 Points// the height and width of a wall
let height = 120.0 / 12
let width = 144.0 / 12
let area = height * width
let areaInFeet = area
John Moron
1,658 PointsJohn Moron
1,658 Pointsyes I know I wasn't assigning the let to anything, I left it blank on purpose but thank you for helping me btw.
melanie Goldstone
1,252 Pointsmelanie Goldstone
1,252 PointsOh, so you're trying to convert the inches into feet? You just divide the inches by 12 to get the feet