Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The programs needs to have the user input For this question, you will design a set of classes that work together to simulate a police

image text in transcribed

The programs needs to have the user input

For this question, you will design a set of classes that work together to simulate a police officer issuing a parking ticket. You should design the following classes: The ParkedCar class: This class should simulate a parked car. The class's only responsibility is 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, coloe, and license number of the illegally parked car .To report the amount of fine, which is S25 for the first hour or part of an hour that the car is illegally parked, plus S10 for every additinal hour oe part of an hour that the car is illegally parked. .To report the name and badge number of the police office 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. To issue a parking ticket (generate a ParkingTicket object), if the car's time has expired. Write a Demo class that demonstrates how these classes collaborate. Essentially in the demo class you will do the following: 1. Enter the make (e g. Toyota) of the car 2. Enter the model (e.g. Camry) of the car 3. Enter the color (e-g. White) of the car 4. Enter the license number (e.g. HRU1700) of the car S. Enter how much time you have paid for (eg.1 (hour) 6. Enter how long you have parked at the meter (e.g. 1.15 (hour) . Calculate the fine and display output something like below: WARNING PARKING VOILATION You have paid for: 1 haurls) and have been parked for:1.15 hourfs) Your fine is $ 25.0 Officers Name: Big Tony Officers Bacge Number: 2547954 Cars Make: Toyata Cars Model No: Camry Car Colour: White Cars Licence Na: HRU1700

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

C++ Database Development

Authors: Al Stevens

1st Edition

1558283579, 978-1558283572

More Books

Students also viewed these Databases questions

Question

To find integral of sin(logx) .

Answered: 1 week ago

Question

What is Change Control and how does it operate?

Answered: 1 week ago

Question

How do Data Requirements relate to Functional Requirements?

Answered: 1 week ago