Hacker News new | ask | show | jobs
by eecks 3749 days ago
What is expected from something like "model a parking garage in code?"

Something like a garage class that has properties like numberOfCars, maxAmountofCars, maxHeight and methods for insertCar(), removeCar(), isGarageFull() ?

2 comments

Probably that and, I don't know, maybe modeling a Car class and various subtypes that inherit from it?
Probably keeping track of how many parking spots are available as cars enter/exit, and denying entrance if you're full up.