Giter VIP home page Giter VIP logo

myparkinglot's Introduction

MyParkingLot

I own a multi-storey parking lot that can hold up to 'n' cars at any given point in time. Each slot is given an auto incrementing sequential number to uniquely identify itself. I want to create an automated ticketing system that allows my customers to use my parking lot without human intervention.

When a car enters my parking lot from any one of the multiple entry points, I want to have a ticket issued to the driver. The ticket issuing process includes us documenting the registration number (number plate) and the colour of the car and allocating an available parking slot to the car before actually handing over a ticket to the driver (we assume that our customers are nice enough to always park in the slots allocated to them). The customer should be allocated a parking slot which is nearest to the entry. At the exit the customer returns the ticket which then marks the slot they were using as being available.

Due to government regulation, the system should provide me with the ability to find out:

● Registration numbers of all cars of a particular colour.

● Slot number in which a car with a given registration number is parked.

● Slot numbers of all slots where a car of a particular colour is parked.

Expectations :

● We are really interested in your low level design, object oriented skills so please keep that in mind.

● Please follow coding conventions and directory structure in whichever language you use.

● Input to your system can be done using a file, sysin or through test cases whichever way you want to choose.

Expected Input / Output :

Input:

create 6 3

Output:

Created a parking lot with 6 slots and 3 entry points

Input:

park RJ13-CA-1234 White <entrypoint_id>

Output:

parked slot number: 1

Input:

park MH12-AK-9999 White <entrypoint_id>

Output:

parked slot number: 2

Input:

park KA01-BB-0001 Black <entrypoint_id>

Output:

parked slot number: 3

Input:

leave 2

Output:

slot number 2 is free

Input:

Status

Output (Tab delimited output):

No Registration Slot No. Colour

1 RJ13-CA-1234 1 White

2 KA01-BB-0001 3 Black

Input:

park DL-12-AA-9999 White <entrypoint_id>

Output:

Sorry, parking lot is full

Input:

Register_with_colour KA01-HH-1234,KA01-HH-9999 White

Output:

Registered KA01-HH-1234,KA01-HH-9999

Input:

slot_check

Output:

1

Input:

slot_check_with_color White

Output:

RJ13-CA-1234

Input:

slot_check_with_number RJ13-CA-1234

Output:

1

myparkinglot's People

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.