The management of the company will launch a new scheme to give every 50th car driver and every 60th motorcyclist a free coffee voucher. The code for printing this voucher has already been created and is activated by calling the static method Vouchers.printCoffeeVoucher().
A getKind() method has already been added to the Vehicle class, which returns a char value indicating whether it is a car (c) or a motorbike (m).
One test performed on the finished code was defined as follows:
| Test data | Vouchers printed |
|---|---|
| 29 cars | 0 |
| 130 motorbikes | 2 |
The removeVehicle method of the ParkingArea class searches in the array for a Vehicle object with a specified registration plate, then removes it by setting that array index to null.
The method returns a reference to the Vehicle object that has been removed from the array, or null if no matching registration plate was found.
the removeVehicle method.


