Question
Create Classes with complex logic and systems. Description You may have noticed that Humber has a parking system to inform drivers if parking spots are
Create Classes with complex logic and systems.
Description
You may have noticed that Humber has a parking system to inform drivers if parking spots are available and how many parking spots are available. Lets build a variation of Humber's parking system. This parking system will have 3 different sizes of parking spaces, big, medium, and small. Of course, we will also have cars of different sizes. Create a ParkingSystem class and a Car class. The ParkingSystem will know how many spots of big, medium, and small parking spots there are. Create a constructor for ParkingSystem that defines the number of big, medium, and small spots. The big spots will fit cars under 500cm length and 200cm width, medium spots will fit cars under 450cm and 180cm width, and small spots will fit cars under 400cm and 170cm width. The Car class will have a width and length. The Car will have a constructor for width and length. Create a method in ParkingSystem called addCar. If the ParkingSystem is able to add the car, return true. Otherwise, return false. Create getters for number of spots remaining; getBigSpots, getMediumSpots, getSmallSpots. Each should return how many spots are remaining. The ParkingSystem should
Step by Step Solution
3.51 Rating (158 Votes )
There are 3 Steps involved in it
Step: 1
class ParkingSystem def initself bi...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started