Vehicle can be a base interface, which can be extended to Bike, Car and Truck.
ParkingSpot can be a class which defines the size of the spot and also defines if the spot is avaialable.
Floor can be a class. Floor will have a list of parking spots.
ParkingLot can be a class. ParkingLot will have a list of floors, and list of tickets.
ParkingTicket can be a class. It will contain information about the spot, the vehicle type and the time of parking.
We can have another interface PricingStrategy. We can extend this for different pricing algorithms for bike, car and truck.
Parking ticket will have reference for this interface and while we create any ticket instance, we can pass the concrete pricing strategy reference.
For each class, define the attributes (data) it will hold and the methods (functions) that operate on the attributes. Ensure they align with the object's responsibilities and adhere to the principle of encapsulation. Write your code in the code editor below.
Explain design tradeoffs you considered. Check and explain whether your design adheres to SOLID principles. Explain how your design can handle changes in scale and whether it would be easy to extend with new functionalities. Identify areas for future improvement...
Future improvement:
Trade-offs: