iOS Functions in Swift Functions in Swift Recap: Functions

Nigel Matheson
Nigel Matheson
Pro Student 1,166 Points

breaking down question 2

Hi could someone please break down this question please

// 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 !