I must then test removing the passengers. like so:
public boolean removePassenger(Person person){
/**
(method) It receives a person and removes it as a passenger. If the
person is also the driver, then the driver seat becomes available
(that is, it is set to “null”). The method fails if the person is
“null”, or if he/she is not a passenger.
*/
}
Any and all help is greatly appreciated! If there is any important information I left out that you need to answer the question let me know.
Thanks,
CGagnon
Hey, why an Array for the "holder" of passengers? Do you need to keep track of which seat a person is a passenger is in? (array loc could indicate seat). Even still, I would probably recommend a parameterized List or Collection. The insertion and removal criteria can be handled automatically by overriding equals() on Person, and the using contains(), insert(), remove() etc and the like on whatever List/Collection you choose.