You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Designed a parking lot that can park different size of vehicles.
This parking lot only support basic function, park and exit.
It does not support modification of the spot once created (i.e. you cannot add new spot to the existing parking lot).
Designed following classes:
public class ParkingLot,
private class Spot (represnt the parking spot in the parking lot),
public abstract class Vehicle,
public class Car extends Vehicle,
public class Truck extends Vehicle,
public class Bus extends Vehicle.
The relationship between the classes are as below:
Car isA Vehicle
Truck isA Vehicle
Bus isA Vehicle
Spot hasA Vehicle
ParkingLot hasA list of Spot
Also designed an enum to indicate the size of the vehicle and the max capacity of the spot.