Lab
8
Start Now
ParkingLot |
+CLOSED_THRESHOLD: double {readOnly} = 80.0 -name: String {readOnly} |
+ParkingLot(capacity: int) +ParkingLot(name: String, capacity: int) +displayStatus(): void +getMinutesClosed(): int +getName(): String +getNumberOfSpotsRemaining(): int +getPercentFull(): double +isClosed(): boolean +markVehicleEntry(time: int): void +markVehicleExit(time: int): void |
`CLOSED_THRESHOLD` determines when the lot is closed. The UML
notation `{readOnly}` means that it is a final value and the
underlining indicates it is `static`.
District |
-lot1: ParkingLot -lot2: ParkingLot -lot3: ParkingLot |
+District(name1: String, capacity1: int, name2: String, capacity2: int, name3: String, capacity3: int) +displayStatus(): void +getMinutesClosed(): int +getNumberOfSpotsRemaining(): int +isClosed(): boolean +markVehicleEntry(lotNumber: int, time: int): void +markVehicleExit(lotNumber: int, time: int): void |
The district tracks data for all three parking lots. See the javadoc comments
in `District.java` for notes on the parameters and implementations. The
`ParkingDriver` class below contains tests that you can use to verify your
implementation of the `ParkingLot` and `District` classes. You do not need
to modify the `ParkingDriver` class.
ParkingDriver |
+main(args: String[]): void -testSmallLot(): void -testTinyDistrict(): void -testParkingLot(): void -testFillingLot(): void -testRefillingLot(lot: ParkingLot): void -testEmptyingLot(lot: ParkingLot): void -test0TimeEntryExit(): void -testFillingTo80Percent(): void ... |
Testing Small Lot... Blacktop parking lot status: CLOSED Finished Testing Small Lot Testing Overfilling a Lot... Finished Testing Overfilling a Lot More Complete Test of Parking Lot... Testing ParkingLot test parking lot status: 75.0% test parking lot status: CLOSED test parking lot status: 50.0% test parking lot status: 0.0% Finished More Complete Test of Parking Lot Testing Coming and Going... Finished Testing Coming and Going Testing Tiny District... District status: Red parking lot status: CLOSED Green parking lot status: 0.0% Blue parking lot status: CLOSED Lots were closed for 3 min. in tiny district. Finished Testing Tiny District Finished Testing Normal District... Airport at time 7: District status: Brown parking lot status: 70.0% Green parking lot status: CLOSED Black parking lot status: 58.3% Airport at time 8: District status: Brown parking lot status: CLOSED Green parking lot status: CLOSED Black parking lot status: 58.3% Airport at time 10: District status: Brown parking lot status: CLOSED Green parking lot status: CLOSED Black parking lot status: CLOSED Finished Testing Normal District Finished Testing Heavily Used District... At end of day, all lots closed 42 min. District status: Pink parking lot status: 68.0% Blue parking lot status: CLOSED Gray parking lot status: 20.0% Finished Testing Heavily Used District All tests finished.## Acknowledgement This laboratory assignment was developed by [Dr. Rob Hasker](https://faculty-web.msoe.edu/hasker/) and the CS1011 faculty.
See your professor's instructions for details on submission guidelines and due dates.