I have attached 4 classes which I have created for the following assignment, as well as a test program which tests the other four classes. The only thing that I am having a problem with is reporting the amount of the fine in the ParkingTicket class, as well as determining if the time has expired in the PoliceOfficer class (and generating a ticket). I have obtained these through output in the MeterTest class. However the assignment calls for these operations to be done in their respective classes. I am not sure how do so... If you can help I would appreciate it...
Design a set of classes that work together to simlulate a police officer issuing a parking ticket. The classes to design are:
- ParkedCar class: simulates a parked car
- This class knows the car's make, model, color, license number, and the number of minutes that the car has been parked.
- ParkingMeter Class: simulates a parking meter.
- This classes only responsibility is to know the number of minutes of parking time that has been purchased.
-ParkingTicket class: Simulates a parking ticket
- To report make, model, color, and license number of the illegally parked car.
- To report the amount of the fine which is $25 dollars for the first hour or part of the hour that the car is illegally parked, plus $10 for every additional hour or part of an hour that the car is parked.
- To report the name and badge number of the police officer issuing the ticket.
-PoliceOfficer class: Simulates a police officer
- To know the police officer's name and badge number
- To examine a parked car object and a ParkingMeter object and determine whether the car's time has expired.
- To issue a parking ticket (generate a parkingTicket object) if the car's time has expired.
Write a program to test the classes as well.