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

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 20:00
The blank button automatically displays next to the data when you select a range of numeric data which is an available option for creating a chart
Answers: 3
question
Computers and Technology, 22.06.2019 22:30
Write a full class definition for a class named player , and containing the following members: a data member name of type string .a data member score of type int .a member function called setname that accepts a parameter and assigns it to name . the function returns no value.a member function called setscore that accepts a parameter and assigns it to score . the function returns no value.a member function called getname that accepts no parameters and returns the value of name .a member function called getscore that accepts no parameters and returns the value of score .this is what i have, aparently this is wrong: class player{private: string name; int score; public: void player: : setname (string n){name =n; }void player: : setscore (int s){score = s; }string player: : getname (){return name; }int player: : getscore (){return score; }};
Answers: 2
question
Computers and Technology, 22.06.2019 22:30
The qwerty keyboard is the most common layout of keys on a keyboard
Answers: 3
question
Computers and Technology, 23.06.2019 12:20
When guido van rossum created python, he wanted to make a language that was more than other programming languages. a. code-based b. human-readable c. complex d. functional
Answers: 1
You know the right answer?
For this assignment you will create a set of classes from scratch (no provided class files for this...
Questions
question
Mathematics, 22.06.2019 03:10
question
Health, 22.06.2019 03:10
Questions on the website: 13722361