Implementation of parking lot in java language
- JAVA 1.11
- Maven 3
This project is built using Apache Maven.
Run the following command from the root of repository, to build the client JAR:
- Clone the source:
$ git clone https://github.com/sumannewton/parking-lot.git
- Build
$ mvn clean install
./setup.sh
./parking_lot.sh
Example:
Parking lot service is starting.... |-------------------------------------------------------------| | PARKING LOT MANUAL | |-------------------------------------------------------------| | help | | exit | | create_parking_lot {SLOT_SIZE} | | park {VEHICLE_REG_NO} {VEHICLE_COLOUR} | | leave {VEHICLE_REG_NO} | | status | | registration_numbers_for_cars_with_color {VEHICLE_COLOUR} | | slot_numbers_for_cars_with_color {VEHICLE_COLOUR} | | slot_number_for_registration_number {VEHICLE_REG_NO} | |-------------------------------------------------------------| cmdline> create_parking_lot 3 Created a parking lot with 3 slots cmdline> park KA-01-HH-1234 White Allocated slot number: 1 cmdline> park KA-01-HH-9999 White Allocated slot number: 2 cmdline> park KA-01-BB-0001 Black Allocated slot number: 3 cmdline> park KA-01-HH-7777 Red Sorry, parking lot is full cmdline> leave 2 Slot number 2 is free cmdline> status Slot No | Registration No | Colour --------------------------------------- 1 | KA-01-HH-1234 | White 3 | KA-01-BB-0001 | Black cmdline> registration_numbers_for_cars_with_colour White [KA-01-HH-1234] cmdline> slot_numbers_for_cars_with_colour White [1] cmdline> slot_number_for_registration_number KA-01-HH-3141 Not found cmdline> slot_number_for_registration_number KA-01-HH-1234 1 cmdline> exit Shutting down app....
./parking_lot.sh <<INPUT_FILE_HERE>>
Sample input file is here.
Usage can be found here
Bugs can be reported using Github issues.