Question: Function Name: getNextCoordinate ( ) Parameters: wormholeCoordinates ( list ) , currentLocation ( list ) Returns: nextCoordinate ( string ) Description: In the movie Interstellar,

Function Name: getNextCoordinate()
Parameters: wormholeCoordinates ( list ), currentLocation ( list )
Returns: nextCoordinate ( string )
Description: In the movie Interstellar, astronauts embark on a mission through a mysterious
wormhole near Saturn to find a new habitable planet for humanity, and you've recently joined the
team.
Write a function that takes in two parameters: wormhole coordinates, a list of lists formatted as ,
y,z, locationName ], and your current coordinates, a list formatted as x,y,z. Your function
should find the coordinate for the closest wormhole relative to your current location and the dis-
tance it takes to get there. If the lowest distance is less than or equal to 50, return the string "The
next coordinate is {next_coordinate}, we can go!", where next_coordinate is a list in the format
x,y,z of the closest wormhole. Otherwise, return the string "Oops..., not enough fuel to
make it to {locationName}!" If there is a tie between multiple locations, you should use name of
the one that appeared last in wormholeCoordinates.
NOTE:
The distance between points (x1,y1) and (x2,y2) is given by {z2)
z1), where the ?2 symbol represents the taking the square root of the entire part to follow.
Function Name: getNextCoordinate ( ) Parameters:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!