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 2.0 Functions Function Parameters Returning Complex Values

yusuf Dibswazit
yusuf Dibswazit
1,522 Points

what the heck,

i dont even know anything now. some help please on what is being asked and what i need to do. thanx

functions.swift
// Enter your code below
func getTowerCoordinates(location: string) -> ( string) {
    switch {
      case "Eifel Tower": location = 48.8582, 2.2945
      default : location = 0, 0

    }
    return ( Double, Double)
}
let location = getTowerCoordinates(string: Eifel Tower )

1 Answer

Tim Rach
seal-mask
.a{fill-rule:evenodd;}techdegree
Tim Rach
Full Stack JavaScript Techdegree Student 25,127 Points

Hello, they want you to "Use a switch statement to switch on the string passed in to return the right set of coordinate values for the location." , for example : Using your function like this:

getTowerCoordinates("Eiffel Tower")
// Should return 48.8582, 2.2945

if you pass in

getTowerCoordinates("Great Pyramid")
// Should return 29.9792, 31.1344

So at least create a switch statement for all 3 locations *** a little hint for the first case ***

case "Eiffel Tower": return (48.8582, 2.2945)