subject
Computers and Technology, 07.07.2020 23:01 hann647

For this assignment you will create a set of classes from scratch (no provided class files for this assignment) that work together to simulate a police officer issuing a parking ticket. You should design the following classes / functionality within them:The ParkedCar Class: This class should simulate a parked car. The classâs responsibilities are as follows:To know the carâs make, model, color, license number, and the number of minutes that the car has been parked. The ParkingMeter Class: This class should simulate a parking meter. The classâs only responsibility is as follows:To know the number of minutes of parking time that has been purchased. The ParkingTicket Class: This class should simulate a parking ticket. The classâs responsibilities are as follows:To report the make, model, color, and license number of the illegally parked car. To report 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 parkedTo report the name and badge number of the police officer issuing the ticket. The PoliceOfficer Class: This class should simulate a police officer inspecting parked cars. The classâs responsibilities are as follows:To know the police officerâs name and badge number. To examine a ParkedCar object and a ParkingMeter object, and determine whether the carâs time has expired. If so, issue a parking ticket (generate a ParkingTicket object).For each of the above classes, also provide appropriate constructors, setters, getters, and toString method. Make sure your implementation will not create security holes that can allow code outside the class to modify private data inside the class. So when you are dealing with reference variables in setters and getters, make sure you perform deep copy. Note that fine is calculated based on minutes. In our design, the constructor of ParkingTicket shall call method calculateFine() in order to initialize fine.

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 03:40, hussain34
Mary's manager told her she should insert a graphic into her documentwrite mary a brief note describing how to insert a graphicin a word processing document.
Answers: 1
image
Computers and Technology, 22.06.2019 05:00, yddlex
Modern businesses use different technologies to accomplish work tasks
Answers: 2
image
Computers and Technology, 22.06.2019 10:50, christinavelez26
Using least squares fitting, you are to fit the data sets to the following models and solve for the parameters ai , where i is the index of the parameter. the input/output data for the systems are linked in the bblearn site. for each of the systems use matlab to plot the supplied data vs. the model fit on one plot. include your code in the solutions. (a) linear fit "lineardata. mat" y=a1x^3 + a2x^2 + a3x + a4 (b) plant fit "plantdata. mat g(s) = a1/(s + a2)
Answers: 1
image
Computers and Technology, 23.06.2019 11:00, swelch2010
Describe three characteristics of at-risk drivers. a. b. c. describe three characteristics of safe drivers. a. b. c. describe three driver errors that could cause a collision. a. b. c. how will this information affect you as a driver now and in the future? (2-3 sentences)
Answers: 2
You know the right answer?
For this assignment you will create a set of classes from scratch (no provided class files for this...

Questions in other subjects:

Konu
Mathematics, 29.10.2020 17:50
Konu
Mathematics, 29.10.2020 17:50