ePJ2 is a rental system for electric cars, bicycles, and scooters designed to simulate the companyβs operations in the city of Java. It manages vehicle rentals, monitors vehicle status, and generates financial reports based on predefined data.
The system tracks three types of vehicles:
- Electric Cars
- Electric Bicycles
- Electric Scooters
The following data is managed for each vehicle:
- Cars: ID, purchase date, cost, manufacturer, model, battery level, passenger capacity.
- Bicycles: ID, manufacturer, model, battery level, cost, range per charge.
- Scooters: ID, manufacturer, model, battery level, cost, maximum speed.
Vehicles may break down, and the system records breakdown details such as date, time, and description. Users can rent vehicles, and the system calculates rental costs, applies discounts, and generates invoices in text format.
-
Vehicle Management
- Track battery levels and recharge vehicles.
- Simulate battery drain during rides.
- Record and manage breakdowns.
-
Rental System
- Track rentals with user information, pickup and drop-off locations, and duration.
- Apply special conditions for rentals:
- Wide/Narrow Area Rates: Different rates based on location.
- Breakdowns: Rental cost = 0 if a breakdown occurs.
- Discounts: Every 10th rental applies a discount.
- Promotions: Apply special discounts during promotions.
- Generate invoices in
.txtformat with detailed itemization.
-
Real-Time Simulation
- Simulate vehicle movement on a 20x20 grid map.
- Display vehicle position, ID, and battery level during movement.
- Manage simulations with threads for each rental.
- Execute rentals in chronological order with a 5-second pause between batches.
-
Financial Reports
- Generate daily and summary reports showing:
- Total revenue, discounts, and promotions.
- Maintenance and repair costs.
- Company expenses and taxes.
- Generate daily and summary reports showing:
The program uses JavaFX or Swing to display:
- Main Map View: Shows vehicle movements in real-time.
- Vehicle Overview: Displays all available vehicles in a tabular format.
- Breakdown Log: Logs all breakdowns with time, type, and description.
- Business Results: Displays financial reports (daily and summary).
-
Configuration Files
- Rental rates, discounts, and promotions are stored in properties files.
- Example: Java Properties
-
Binary Serialization
- The project includes additional data-saving features:
- Vehicles with the highest revenue.
- Vehicles with the most losses.
- Vehicles with breakdowns and repair costs.
- Serialized data is saved as binary files, and the GUI provides an option to deserialize and display them.
- The project includes additional data-saving features:
-
Test Data
- Rental data is provided through the Moodle platform.
- Rentals are processed sequentially, simulating operations in real-time.
The summary report includes the following data:
- Total Revenue: Sum of all payments.
- Total Discounts: Sum of all applied discounts.
- Total Promotions: Sum of promotional values.
- Revenue by Area: Revenue for the narrow and wide city areas.
- Maintenance Cost: 20% of total revenue.
- Repair Costs: Based on vehicle type:
- Cars: 7% of purchase cost.
- Bicycles: 4% of purchase cost.
- Scooters: 2% of purchase cost.
- Company Expenses: 20% of total revenue.
- Taxes: 10% of the net profit.
The daily reports include the same metrics but grouped by rental date.
Based on your student index, one of the following features must be implemented:
- Highest Revenue Vehicles: Identify the vehicle with the highest revenue for each type.
- Highest Loss Vehicles: Identify the vehicle with the most significant losses.
- Breakdown and Repair Costs: List vehicles with breakdowns and their repair costs.
-
Clone the Repository:
git clone https://github.com/your-username/epj2-rental-system.git cd epj2-rental-system -
Setup Properties File: Ensure the properties file is correctly configured with rental rates, discounts, and promotions.
-
Compile and Run the Program:
javac -d bin src/*.java java -cp bin Main -
Use the GUI: Navigate through the main map, vehicle list, breakdown logs, and financial reports.
epj2-rental-system/
β
βββ src/ # Source code
β βββ vehicles/ # Vehicle classes (Cars, Bikes, Scooters)
β βββ rental/ # Rental processing logic
β βββ reports/ # Report generation logic
β βββ gui/ # JavaFX/Swing interfaces
β βββ Main.java # Application entry point
β
βββ properties/ # Configuration files (rental rates, discounts)
βββ invoices/ # Generated invoices (TXT format)
βββ README.md # Project documentation
- Add JavaDoc comments to all classes and methods and generate documentation.
- Use packages for better code organization.
- Avoid code duplication and ensure efficient performance.
- Follow proper naming conventions for classes, methods, and variables.
This project is developed as part of the Programski jezici 2 course at the ElektrotehniΔki fakultet, Banja Luka.
- Andrej TroΕΎiΔ β Student at ElektrotehniΔki fakultet, Banja Luka