HOUSES[PASSENGERS[passenger]], what value do you think
PASSENGERS[passenger] is returning and do you think it could be used to index a value in
HOUSES? Remember also, that
HOUSES is an associative array and expects a string; i.e. name of a house on campus.
Firstly, you want to get the latitude and longitude from the passenger. Then compare it to your shuttles coordinates to see if they are within range. The houses on campus have nothing to do with picking up the passengers except for seeing whether or not the passenger wants to go to a house (residence), in which case you can pick them up. If however, they are trying to go somewhere else, they shouldn't be allowed on the bus.
That's all you should think about when using
pickup(). If you are still stuck, print out onto the console the values of variables you use and compare them to what you except them to equal.
As for the seats array, you need not set a name attribute to the name of the passenger. Instead, the function that prints the names of the passengers on the bus looks for the seats being equal to
null so you should instead have a seat equal to an actual passenger element like
null if there is no passenger in that seat.