Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

THIS NEEDS TO BE DONE IN NETBEANS!! You will NOT have a working program yet. You will have created five .jave files, including a MainClass,

THIS NEEDS TO BE DONE IN NETBEANS!! You will NOT have a working program yet. You will have created five .jave files, including a MainClass, as usual, which will essentially be empty.

PTS_MainClass

ParkingMeter

PoliceOfficer

ParkedCar

ParkingTicket

For this you will design a set of classes that work together to simulate a police officer issuing a parking ticket. The ParkedCar Class: This class should simulate a parked car. The responsibilities of this class are to record the make, model, color, and license number of the car, along with the number of minutes that the car has been parked. The following is a UML class diagram of the class to be developed:

The ParkingMeter Class: This class should simulate a parking meter. The only responsibility of this class is to record the number of minutes purchased. The following is a UML class diagram of the class to be developed:

The ParkingTicket Class: This class should simulate a parking ticket. The class responsibilities are:

- To record the make, model, color, and license number of an illegally parked car. - To record the amount of the fine, which is $25 for the first hour (i.e., any part of the first hour that the car is illegally parked), plus $10 for every additional full or partial hour the the car is illegally parked. - To record the name and badge number of the police officer issuing the ticket.

The following is a UML class diagram of the class to be developed. The ParkedCar and PoliceOfficer classes have a relationship to the ParkingTicket class, so they are also shown:

The PoliceOfficer Class: This class should simulate a police officer inspecting parked cars. The responsibilities of the class are as follows:

- To record the police officers name and badge number. - To examine a ParkedCar object and a ParkingMeter object, and determine whether the parking time of the car has expired. - To issue a parking ticketgenerate a ParkingTicket objectif the time of the car has expired.

The following is a UML figure that shows the relationship for each object:

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro PowerShell For Database Developers

Authors: Bryan P Cafferky

1st Edition

1484205413, 9781484205419

More Books

Students also viewed these Databases questions