in kotlin, It's easy to get mixed up between latitude and longitude! Happily, at least sometimes, this is an easy fix to correct.

Complete a method named fixLocation. fixLocation takes a Location object as its only parameter. Some of those location objects have their latitude and longitude swapped. If that's the case, correct them! Otherwise, leave them unaltered.

You may be wondering: how will I know which locations are incorrect? The hint is that these are all locations from around the University of Illinois. That should help you determine when the latitude and longitude have been swapped.

The Location object has Double latitude and longitude properties that you can access and modify in the usual way in Kotlin.

Q&A Education