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

Operators Swift

Bummer! 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.// 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 = Double(area) / 12

I don't know how to do the last constant...

You need to turn the height and width into feet first before multiplying them

let height = 120.0 / 12 //Turn into feet
let width = 144.0 / 12 // Turn into feet

let areaInFeet = height * width // Get the area in Feet

Thank you!

J.D. Sandifer
J.D. Sandifer
18,813 Points

The above answer is the best way to follow the directions, for sure. For fun I'm adding the easiest way to fix your code so it gives the right answer:

let height = 120.0 // in inches
let width = 144.0 // in inches

let area = height * width   // it might be better to call this areaInInches,
                            // but we don't need to change that to fix the code

let areaInFeet = Double(area) / 144.0   // divide by the number of inches in a square foot
                                        // to convert this to feet