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

becky hayes
becky hayes
2,226 Points

Can you explain why my code isnt working? Im having trouble understanding exactly how to approach the question

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

let widthInFeet = width / 12 let heightInFeet = height / 12

let areaInFeet = heightInFeet * widthInFeet

area.swift
// the height and width of a wall
let height = 120.0 // in inches
let width = 144.0 // in inches

let widthInFeet = width / 12
let heightInFeet = height / 12

let areaInFeet = heightInFeet * widthInFeet 

3 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hey Becky,

I'm not sure why your code is not working... it is correct.

I copied and pasted your code into a fresh challenge and it did pass. There may have just been a glitch at that moment. Try to copy the code above that you provided... restart the challenge... and paste in the complete code overtop any of the preloaded code.

But you are right! Keep Coding! :)

Nathan Tallack
Nathan Tallack
22,160 Points

Your code is good. Perhaps a little bit of a bug with Workspaces. Try reloading your browser. Sometimes fixes it.

becky hayes
becky hayes
2,226 Points

Thanks guys! really appreciate it.