Professional Documents
Culture Documents
Homework
Homework
Homework
Prompt
The owner of a parking garage wants you to design a Java program that will track each car’s
location in the garage so that new cars will automatically know the closest open space and
pedestrians returning to their cars can access their car’s location and how to walk to it.
The ParkingGarage class has an Array of Vehicle objects. The implementation of the Vehicle
class is shown below:
// searches from the bottom floor and adds it to the first empty
spot found. Returns false if garage is full
public boolean addVehicle(Vehicle vehicle) {
// missing code (part b)
}
Student Response
To receive full credit for this assignment, complete each of the blue boxes below. Expand the
size of the boxes as needed.
Part b) addVehicle
Part c) removeVehicle
Part d) getDirectionsToVehicle