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 trial

iOS Swift Basics (retired) Operators Binary Operators

1 foot = 12 in therefore the area in feet should be divided in ft

are we going to get any help?

area.swift
// the height and width of a wall
let height = 120.0 // in inches
let width = 144.0 // in inches
let areInFeet = (120.0 * 144.0 )/ 12

2 Answers

You need divide each dimension by 12 to convert it to feet. Currently you are dividing the area by 12, which is not the same thing.

So, 120/12 * 144/12 = 10 * 12 = 120

Gene's answer will fix your calculation. Divide height and width EACH by 12, rather than just your answer. I used parentheses to make this clearer in my answer, but they aren't necessary for the math to work out.

However, you may still be failing the challenge for a silly reason: you misspelled "area". People will know what you meant, but a computer will just look and say there's no constant areaInFeet. A silly typo can make your whole program fail -- be careful!

let areaInFeet = (height/12) * (width/12)