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

Nigel Matheson
PLUS
Nigel Matheson
Courses Plus Student 1,166 Points

breaking down question 2

Hi could someone please break down this question please

functions.swift
// Enter your code below

func temperatureInFahrenheit(temperature: Double) -> Double {    

return temperature

}

2 Answers

Jonathan Ruiz
Jonathan Ruiz
2,998 Points

Hi Nigel for the second part of the problem when they say value they are talking about the Double value a user puts into the temperature parameter. So you must use that temperature value and then multiply and divide that by their instructions. The first problem sets you up for this asking you to return temperature, that means you are returning the Double value for temperature and satisfying the return tuple that is of type Double.

func exampleProblem(temperature: Double) -> Double {
  return ((temperature * 2) / 8 + 3) 
  //temperature will be the double value the user puts in then we multiply and divide and add to that input 
}

hope this helps !