Here is one way to model the parking lot system using object-oriented design principles:
1. ParkingSpot class
- Properties: id, type (regular, handicapped, compact), occupied
- Methods: occupy(), vacate()
2. ParkingLot class
- Properties: spots (list of ParkingSpot), currentOccupancy
- Methods:
- findSpotForRegularCar()
- findSpotForHandicappedCar()
- findSpotForCompactCar()
- isFull()
- isEmpty()
3. ValetParking class
- Property: currentSpot
- Methods:
- parkCar()
- retrieveCar()
4. Car class
-