Class: ParkingLot
Fields: floors[], entryGates[], exitGates[], pricingStrategy
Relationships: Has many ParkingFloors, depends on PricingStrategy (interface)
Interface: PricingStrategy
Methods: calculateFee(ticket, exitTime)
Relationships: Implemented by HourlyRateStrategy, WeekendRateStrategy
Class: ParkingFloor
Fields: spots, floorNumber
Relationships: Has many ParkingSpots
Class: ParkingSpot
Fields: spotId, spotType (SMALL/MEDIUM/LARGE), isAvailable
Relationships: Assigned to a Vehicle via Ticket
Class: Vehicle
Fields: vehicleType (MOTORCYCLE/CAR/TRUCK)
Relationships: Belongs to a ParkingSpot via Ticket
Class: Ticket
Fields: issuedAt, status (PAID/UNPAID), finalCost
Relationships: Belongs to ??
abstract class Gate { gateId: string; }
class EntryGate extends Gate { /* entry-specific */ }
class ExitGate extends Gate { /* exit-specific */ }
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...