Car object has make/model/year and size.
Parking spots are either small, med, or large.
Floors are made up of parking spots.
Parking Lot is made up of floors and an entry and exit.
Cars come to entry and the Parking Lot checks if there's any spot available for that car size or larger.
If yes, Parking Lot gives ticket to Car with timestamp and assigned Parking spot.
If no, Parking Lot lets Car know that there's no spots left and denies entry.
On Car exit, Parking lot calculates fee based on size of car and duration of stay. Parking spot becomes empty.
Different cars are all subclasses of the Vehicle Interface which includes size of vehicle and requesting a ticket and exiting the Parking lot.
Regarding pricing. Fees are calculated based on size of vehicle and duration of stay. A Fee class will take in a vehicle size and duration of stay and then calculate the fee. the fee class will have a predetermined fee per vehicle type with a clear determination of how much to charge per hour per vehicle type.
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...