Code Monkey home page Code Monkey logo

3dharmadev / smartparkingsystem Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 8 KB

The Java car parking system manages floors, spaces, and vehicles. It initializes with defined capacities and supports adding/removing vehicles. The system calculates parking fees based on a flat cost structure. Key functionalities are showcased in the main class, ensuring flexibility for expansion.

Java 100.00%
java low-level low-level-programming maven solid-principles smart-parking-system

smartparkingsystem's Introduction

Car Parking System in Java

This Java project implements a versatile car parking system with a modular design. The system supports various functionalities such as initialization, adding/removing vehicles, and checking availability. It includes a flat cost structure for parking fees and is designed to be flexible for future extensions.

Classes

  1. ParkingLot: Manages parking spaces.
  2. Vehicle: Represents vehicles with essential attributes.
  3. Floor: Represents parking lot floors with capacity details.
  4. VehicleSpace: Represents individual parking spaces.
  5. CostStrategy: Manages cost calculation based on vehicle type.

Usage

  1. Initialization:

    • Configure the parking lot with desired floors and spaces per floor.
  2. Add Vehicle:

    • Use the addVehicle method to add vehicles with details like type, registration number, and color.
  3. Remove Vehicle:

    • Remove vehicles by specifying the registration number or token.
  4. Check Availability:

    • Verify available vehicle spaces on a specific floor for a given vehicle type using checkAvailability.

Cost Structure

  • Bike: ₹10 per hour
  • Car/Jeep: ₹20 per hour
  • Bus/Truck: ₹30 per hour

Use Case

  1. Initialization for Cars:

    • Set up the parking lot for two cars.
  2. Vehicle Entry:

    • Add details for two cars, generating a token ID for each with a timestamp.
  3. Vehicle Exit:

    • Validate tokens and timestamps to retrieve car details along with the total parking fee.
  4. Capacity Full:

    • Attempting to enter a third car when the capacity is full should result in an error.

Project Expectations

  • Main method in the Java code project.
  • Configuration initialization for capacity, floors, vehicle types, currency, and hourly charges.
  • Vehicle entry and exit using either registration number or token.

smartparkingsystem's People

Contributors

3dharmadev 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.