Code Monkey home page Code Monkey logo

parkinglot's Introduction

Following application is a command line application that reads the commands to run an automated parking system and do the tasks.

Pre-requisites :

  1. maven should be installed. Following article can be referred to setup maven : https://mkyong.com/maven/how-to-install-maven-in-windows/

  2. Java 8 should be available. It can be installed by following the process here : https://mkyong.com/java/how-to-set-java_home-on-windows-10/

  3. Go to cmd and go to the project directory and run : mvn clean install

This will build the project and execute all the underlying test cases that are present under src/test/java folder and test files under src/test/resources.

  1. Above command will also create class files and jar of the project which can be used to execute the java code from the command line.

  2. Commands to run the application

D:\ParkingLot>java -jar target/ParkingLot-1.jar "src/main/resources/Test.txt"

"src/main/resources/Test.txt" -> Location of the file if it is in resources folder

OR

D:\ParkingLot>java -jar target/ParkingLot-1.jar "D:\ParkingLot\src\main\resources\Test.txt"

"D:\ParkingLot\src\main\resources\Test.txt" -> Fully Qualified path of the file
  1. This project can also be imported to Intellij as a maven project. File -> Project From Existing Sources -> Select Directory (select maven while importing)

ASSUMPTIONS

  1. In case parking has not been created the message "Parking Space has not been set up" is printed on the console.

  2. No slots are printed that do not have a vehicle allotted to them. Exp test case: Test4.txt file output is :

  3. Assumption hs been made the commands in the file are separated by new line and each command is separated by a space as a character.

src/test/resources/Test4.txt
Created parking lot with 6 slots
Slot No. Registration No.
  1. Design is Set for a Single Floor , single entry gate and single exit gate right now but more can be added during admin setup.

  2. Solution is extensible to different type of vehicle and different type of parking spaces for them, and logic of cost of different vehicle and their parking spaces can be different. (Can be done by extending the Vehicle class).

  3. To zip the project :

git archive -o latest.zip HEAD

parkinglot's People

Contributors

anonymousvarshney avatar

Watchers

 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.