Skip to content

mialsy/parkingLotDesignProject

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Parking Lot Project README

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.

  • Vehicle size (COMPACT, MIDSIZE, LARGE)
  • ParkingLot has the following methods:

  • isFull
  • findSpotById
  • park(Vehicle)
  • park(Vehicle, Spot)
  • exit(Vehicle)
  • exit(Vehicle, int)
  • Spot has the following methods:

  • getId
  • getMaxCapacity
  • getCurrentVehicle
  • isEmpty
  • fit
  • park
  • leave
  • About

    No description, website, or topics provided.

    Resources

    Stars

    Watchers

    Forks

    Releases

    No releases published

    Packages

    No packages published

    Languages