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 Functions in Swift Functions in Swift Recap: Functions

Is the value suppose to the word temperature?

Not sure if I have the math set up properly

functions.swift
// Enter your code below
func temperatureInFahrenheit(temperature: Double) -> Double {
let celciosToFahrenheit = temperature * 9 / 5 + 32
return temperature
}

temperatureInFahrenheit(temperature: 10)

1 Answer

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hi Chris,

I'm guessing you're on task #2?
If yes, the first thing you need to do is delete the function call at the end. The Challenge has not yet asked for this.

Next, you'll have to remember that challenges are very specific and picky when it comes to the instructions. Task #2 does not ask for a new variable to be created (you have made celciosToFahrenheit). The instructions simply want you to modify the return and return the mathematical result directly.
So, your math is correct, but the code is not. You'll need to get rid of the variable assignment and just return the math.

return temperature * 9 / 5 + 32

Other than that... Nice job! :) :dizzy: