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 parked - To report the name and badge number of the police officer issuing the ticket The Police Officer 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 program that demonstrates how these classes collaborate. This program should generate at least 3 tickets, and save them in an array of type ParkingTicket.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

I need help with creating a Java program described in the image below: 

Parking Ticket Simulator

 

### Simulation of a Parking System

This document outlines the structure and responsibilities of various classes designed to simulate a parking system, incorporating the interactions between parked cars, parking meters, parking tickets, and police officers.

#### The `ParkedCar` Class
This class represents a parked car. Its responsibilities include:
- Storing the car’s make, model, color, license number, and the number of minutes the car has been parked.

#### The `ParkingMeter` Class
This class represents a parking meter. Its sole responsibility is:
- Keeping track of the number of minutes of parking time that has been purchased.

#### The `ParkingTicket` Class
This class represents a parking ticket. Its responsibilities are:
- Reporting the make, model, color, and license number of the illegally parked car.
- Reporting the fine amount, set at $25 for the first hour or part of an hour, and an additional $10 for every extra hour or part thereof the car is illegally parked.
- Reporting the name and badge number of the police officer issuing the ticket.

#### The `PoliceOfficer` Class
This class simulates a police officer inspecting parked cars. Its responsibilities include:
- Knowing the police officer’s name and badge number.
- Examining a `ParkedCar` object and a `ParkingMeter` object to determine if the car’s parking time has expired.
- Issuing a parking ticket by generating a `ParkingTicket` object if the car's time has expired.

#### Program Demonstration
Write a program to demonstrate how these classes collaborate. The program should generate at least three tickets and save them in an array of type `ParkingTicket`.

This simulation aims to model a real-world parking enforcement system by showcasing interactions between various entities involved in parking and law enforcement.
Transcribed Image Text:### Simulation of a Parking System This document outlines the structure and responsibilities of various classes designed to simulate a parking system, incorporating the interactions between parked cars, parking meters, parking tickets, and police officers. #### The `ParkedCar` Class This class represents a parked car. Its responsibilities include: - Storing the car’s make, model, color, license number, and the number of minutes the car has been parked. #### The `ParkingMeter` Class This class represents a parking meter. Its sole responsibility is: - Keeping track of the number of minutes of parking time that has been purchased. #### The `ParkingTicket` Class This class represents a parking ticket. Its responsibilities are: - Reporting the make, model, color, and license number of the illegally parked car. - Reporting the fine amount, set at $25 for the first hour or part of an hour, and an additional $10 for every extra hour or part thereof the car is illegally parked. - Reporting the name and badge number of the police officer issuing the ticket. #### The `PoliceOfficer` Class This class simulates a police officer inspecting parked cars. Its responsibilities include: - Knowing the police officer’s name and badge number. - Examining a `ParkedCar` object and a `ParkingMeter` object to determine if the car’s parking time has expired. - Issuing a parking ticket by generating a `ParkingTicket` object if the car's time has expired. #### Program Demonstration Write a program to demonstrate how these classes collaborate. The program should generate at least three tickets and save them in an array of type `ParkingTicket`. This simulation aims to model a real-world parking enforcement system by showcasing interactions between various entities involved in parking and law enforcement.
Expert Solution
steps

Step by step

Solved in 5 steps with 6 images

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education