For this assignment we will be creating a Parking Garage Class and Car class. Your program will track cars parked in the parking garage.
Your program should implement a Car
class, a ParkingGarage
class, and a GarageManager
class.
Your implementation of the ParkingGarage class should have a car array(Car[]
) to represent the parking spots. The “spot number” of each parking spot is its array index (starting with spot 0).
Your ParkingGarage constructor should take in capacity as input. This will represent the capacity of the parking garage instance.
Your ParkingGarage class should implement:
park(Car car, int spot)
method, that will add the car to a parking spot.
vacate(int spot)
method, that will remove the car from the specified spot.
printInventory()
method, that prints out to the console the the listing of all the cars with a brief description. For each car, please include:
The GarageManager class will contain the main(String[] args)
method for your program. It doesn’t need to contain anything else.
Your main()
method will act as the “driver” for this program.
In your main()
method, you should:
Your implementation should be broken down into different methods.
Each method should have a well defined “job”.
Include comments in your code. At the minimum, include a comment for each method to explain what it does. If you submit code without any comments, 5 points will be subtracted from your assignment score.