Problem
Design a Python program that simulates a smart parking management system for a small parking lot. The system should track vehicles entering and leaving the parking lot, calculate parking fees, and display available parking spaces.
Requirements
- The parking lot has a fixed number of spaces (for example 20 spaces).
- Each vehicle has:
- License plate number
- Entry time
- Exit time
- When a vehicle enters:
- The system records the license plate and entry time.
- It assigns the vehicle a parking space.
- When a vehicle exits:
- The system calculates the total time parked.
- Parking fee rule:
- First hour: $5
- Every additional hour: $3
- The system should allow the following actions:
- Park a vehicle
- Remove a vehicle
- View all parked vehicles
- Show number of available spaces
- Display total revenue collected
Technical Requirements
- Use classes (Object-Oriented Programming).
- Use a dictionary or list to store parked vehicles.
- Handle errors such as:
- Parking when the lot is full
- Removing a car that is not parked
Bonus Features (Optional but recommended)
- Save parking records to a file.
- Allow searching for a car by license plate.
- Display a simple menu system in the terminal.
- Add different parking rates for cars, bikes, and trucks.
Example Menu
- Park Vehicle
- Remove Vehicle
- View Parked Vehicles
- Show Available Spaces
- Show Revenue
- Exit
This assignment tests:
- Python logic
- Object-oriented programming
- Data structures
- Real-world problem solving.

Leave a Reply
You must be logged in to post a comment.