Giter Site home page Giter Site logo

parking-lot's Introduction

An approach to solve Parking Lot problem.

Tech Stack Used :

Java 8 Maven 3 Ubuntu ( On Docker Image)

RUN:

To Run the program, please run "./parking_lot" command from the home directory of the project.

$.....solution/parking-lot# ./parking_lot

*Kindly ensure you have JAVA/MVN path already set.

Sample Output


************************** WELCOME TO PARKING APP *********************


A. Commands for Parking Actions

  1. Parking Initialization ==> create_parking_lot
  2. Park the Car ==> park <car_number> <CAR_COLOR>
  3. Unpark the Car ==> leave <PARKING_SLOT_NUMBER>
  4. Rest the Parking Lot ==> reset

B. Commands to Query Details

  1. Parking Lot current status ==> status
  2. Fetch registerd cars by car color ==> registration_numbers_for_cars_with_color <CAR_COLOR>
  3. Fetch parking number of entered color cars ==> slot_numbers_for_cars_with_color <CAR_COLOR>
  4. Fetch parking number by car reg. number ==> slot_number_for_registration_number <CAR_NUMBER>

Sample Output

Please enter your input:
create_parking_lot 5
Created a parking lot with 5 slots
park WWW White
Allocated slot number: 1.
park GGG Red
Allocated slot number: 2.
park AAA Orange
Allocated slot number: 3.
park WWW White
Allocated slot number: 4.
park WWW Red
Allocated slot number: 5.
park GGG Red
Sorry, parking lot is full.
status
Slot No.  Reg.No.        Color
------------------------------------------------------------
1       WWW       White
2       GGG       Red
3       AAA       Orange
4       WWW       White
5       WWW       Red
------------------------------------------------------------
leave 5
Slot number 5 is free.
leave 7
Invalid parking spot index entered.
leave -1
Invalid parking spot index entered.
leave 4
Slot number 4 is free.
status
Slot No.  Reg.No.        Color
------------------------------------------------------------
1       WWW       White
2       GGG       Red
3       AAA       Orange
------------------------------------------------------------
leave 1
Slot number 1 is free.
leave 2
Slot number 2 is free.
park TTT ddd
Allocated slot number: 1.
status
Slot No.  Reg.No.        Color
------------------------------------------------------------
1       TTT       ddd
3       AAA       Orange
------------------------------------------------------------
exit

parking-lot's People

Contributors

bhopals avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.