Question: Spring 2017 CS3300 Assignment 4 Due Date: 02/28/2017 For this assignment you will design a set of classes that work together to simulate a police
Spring 2017 CS3300 Assignment 4
Due Date: 02/28/2017
For this assignment 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 first:
The ParkedCar Class: This class should represent a parked car. The classs responsibilities are as follows:
To know the cars make, model, color, license number, and the number of minutes the car has been parked.
The ParkingMeter Class: This class should simulate a parking meter. An Object of ParkedCar will be parked near a ParkingMeter. The ParkedCar will purchase a certain amount of minutes using the parking meter. The classs 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 responsibilities are as follows:
To report the make, model, color, and license plate number of the illegally parked Car.
To report the amount of time, which is $25 for the first hour or part of an hour that the car has 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 PoliceOfficer Class: This class should simulate a police officer inspecting parked cars. The classs responsibilities are as follows:
To know the Police Officers name and badge number.
To examine a ParkedCar Object and a ParkingPermit Object, and determine whether the cars time has expired.
To issue a parking ticket (generate a ParkingTicket Object) if the cars time has expired.
Write a demo class ParkingSimulation that will demonstrate
First create an object of a Police Officer.
Read the file that contains information on a list of parked cars along with the parking meter. You should create objects that represent the parked cars and parking meter and store them in two separate arrays.
The police officer should inspect each parked car and corresponding meter and decide to issue a parking ticket. If a parking ticket is issued display the details of the ticket.
Keep track of the number of cars that got a parking ticket
Keep track of the total amount of money from all the parking tickets.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
