Question: We will create a program for police officer to check the car parked on a meter. The program should contains the following classes: The Car

We will create a program for police officer to check the car parked on a meter. The program should contains the following classes: The Car Class This class should be written as the template for the car object. It has: - Private data fields like car's make, model, color, and license number. Appropriate constructors - Appropriate setters and getters AtoString() method overriding the default one and returning the car information The ParkedCar Class This class should simulate a parked car which inherits extends the Car class and also has Private fields for the time as minutes) that the car has been parking there, and the paid minutes Appropriate constructors (remember to also use super to call the supercross constructor - Appropriate setters and getters - the overriding toString method and returning the parked car information The Police Officer Class This class should simulate a police officer inspecting a parked car. The class's responsibilities are as follows: - To know the police officer's name and badge number To examine a ParkedCar object, and determine whether the car's time has expired .., could use this method: public boolean checkParked Car Parked Car car To issue a parking ticket if the car's time has expired. The parking ticket should contain the following information: o information about the make, model, color, and license number of the illegally parked car-from the toString method in the ParkedCar class the amount of the fine, which is $25 for the first hour or part of an hour that the car is illegally parked, plus $10 for every additional hour or part of an hour that the car is illegally parked o the name and badge number of the police officer issuing the ticket could use this method: public String issue Ticket(ParkedCar car) The OuterMain class Write code to create scenarios to demonstrate how multiple classes work together. For example: A parkCar has been parking there for 75 minutes but it only paid for 60 minutes. A police Officer checks and sees that the paid time has expired. The officer then issues a ticket. The steps could be as following: Instantiate ParkedCar object, say, parked Car Instantiate Police Officer object, say, officer Police officer checks the car by calling the checkParked CarparkedCar) to determine if expired or not If expired, the officer calls the issue TicketparkedCar) method to issue a ticket
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
