A console-based Parking Management System developed using Java. The application allows users to manage vehicle parking records efficiently through a menu-driven interface.
- Park a vehicle
- Remove a parked vehicle
- View all parked vehicles
- Search vehicle by number
- Show total parked vehicles
- View available parking slots
- Display parking summary
- Remove all vehicles
- Generate parking receipts on vehicle exit
- Append daily report entries for each removed vehicle
- Input validation and exception handling
- Java
- Object-Oriented Programming (OOP)
- Collections Framework
- Exception Handling
Main.java— menu-driven user interfaceParkingManager.java— parking operations and business logicVehicle.java— base vehicle class with entry time and slot detailsTwoWheeler.java— two-wheeler parking fee calculationFourWheeler.java— four-wheeler parking fee calculation
The application manages parking in two categories:
- Two-Wheelers: slots
A1toA5 - Four-Wheelers: slots
B1toB5
When a vehicle is parked, it is stored in memory with its entry time and assigned slot. When a vehicle is removed, the system calculates parking duration, fees, and saves a receipt.
The menu accepts a choice between 1 and 9.
Choosing 9 exits the program cleanly and closes the scanner resource.
When a vehicle is removed, the application generates a receipt file named:
receipt_<vehicleNumber>.txt
Example for vehicle number GJ-03-CP-0301:
========== PARKING RECEIPT ==========
Vehicle Number : GJ-03-CP-0301
Owner Name : John Doe
Vehicle Type : 4-Wheeler
Slot Number : B2
Entry Time : 09-06-2026 14:25:12
Exit Time : 09-06-2026 16:30:05
Duration : 2 Hours
Total Fee : Rs40
====================================
The receipt includes:
- Vehicle number
- Owner name
- Vehicle type
- Assigned slot
- Entry time
- Exit time
- Duration in hours
- Total fee
Each removed vehicle also writes an entry to daily_report.txt in append mode.
One line is added for every removal, for example:
GJ-03-CP-0301 | 4-Wheeler | Rs40 | 2 Hours
This file accumulates the day's transaction summary for review.
Compile:
javac *.javaRun:
java MainThis project demonstrates:
- Classes and Objects
- Inheritance
- Polymorphism
- Collections
- Exception Handling
- Menu-Driven Applications
Vatsal Gajera