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

how do i finish this?

i think this might be a very silly question, but how do i finish this code, if i actually want to input something and get a result back using this code?. i feel like i keep second guessing myself and i just cant figure this out.

class Temperature { var celsius: Float = 0.0 var fahrenheit : Float { return ((celsius * 1.8 ) + 32) } }

am i missing some big part of the code? but idk what i need to add.

thank you for the help

You don't seem to be missing anything, I just went back to this stage and have tried it.

but never the less try this to see if it works and compare it with yours. <code>class Temperature { var celsius: Float = 0.0 var fahrenheit: Float { return ((celsius * 1.8) + 32) }

}</code>

hey Fuad, thanks for your help. ya the code works, but i just wanted to know, how do i put values in for my celsius and have it actually use the equation and get results out of it? to get the temperature in fahrenheits?

You'd need to use a swift getter and setter I want to code it in for you but you will get to that stage of the course shortly if you haven't already, If you do still need any help with that just reply as I get notified... Always glad to help!