Answered step by step
Verified Expert Solution
Question
1 Approved Answer
i cannot change the parkingtickersimulator code, how do I make the parkingticket constructor work with line 19 in parkingtickersimulator? I attached the uml diagram also
i cannot change the parkingtickersimulator code, how do I make the parkingticket constructor work with line 19 in parkingtickersimulator? I attached the uml diagram also for the parking ticket class to clarify what my professor wants
Eclipse File Edit Source Refactor Navigate Search Project Run Window Help N A Java - 112/src/program2/Parking TicketSimulator.java - Eclipse IDE ) 67% Parking TicketSimulator.java X ParkedCar.java P arking Meter.java Police Officer.java Parking Ticket.java 1 package program2; public class ParkingTicketSimulator { // This is a driver program to demonstrate how classes collaborate, men public static void main(String[] args) { Il create a ParkedCar obiect, the car was parked for 125 minutes ParkedCar car = new ParkedCar("Volkswagen", "1972", "Red", "147RHZM", 125) II create a ParkingMeter object, 60 minutes were purchased ParkingMeter meter = new Parking leter(60); EAA. 2.FERI // create a PoliceOfficer object Policeofficer officer - new Policeofficer("Joe Friday", 4788"); // create a ParkingTicket object ParkingTicket ticket = new. ParkingTicketlicarneter officer.cactMinutesParked-meter.getMinutesPurchased 11 print Parking ticket information if(ticket.getFine (20) System.out.println(ticket); else System.out.println("No ticket issued!"); Smart Insert 19:123: 725 Witable The constructor Parking Ticket(ParicedCar, Parking Meter, Police Officer, Int) is undefined MacBook Pro * AAAAG000 Parking Ticket.jova x Dulment program 2 le 2/25/10 In keeping with the Honor Code of UM, I have neither given nor received assistance from anyone other than the instructor Program Description: The program simulates a police officer issuing a ticket This class simulates a parking ticket. Parking Tickotsimulatorjavo public class Parking Ticket 1/private instance fields private ParkedCar cars private ParkingMeter meter private Policeofficer officers private int illegaUinutes) private double fine; 1/public methods //constructor public parkingTicket(ParkedCar c, ParkingMeter , Policeofficer p) I/HELP ME WITH THIS CONSTRUCTOR PLEASE, THE car - c: meter a officer BEAUTY SAYSIMET P: public parkingTicketParkingTicket object2) car -object2.cars meter = object2.meters officer object2.officers illega Ninutes object. Illega Ulinutes fine object2. fines public void setCar ParkedCard) car c public void setmeter(ParkingPeter ) meter - my public void setofficer (Policeofficer o MacBook Pro string U : String a police The Parking Ticket class: This class should simulate a parking ticket. The class's responsibilities are as follows: - To report the make, model, color, license number, and the number of minutes of the illegally parked car (a ParkedCar object) To report the number of minutes of parking time the car has purchased (a Parking Meter object) To report the name and badge number of the police officer issuing the ticket (a Police Officer object) To report the illegal minutes parked and 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 do this job. you can write a calculate Fine() method in this class) Parking Ticket - car: ParkedCar - meter : Parking Meter - officer : Police Officer - illegalMinutes : int - fine : double + ParkingTicket (c: Parked Car, m: ParkingMeter, o: Police Officer, m:int, calculate Fine()); + Parking Ticket (object2: Parking Ticket): + setters here + getters here - calculateFine(): void +toString(): String Each of the above classes should include appropriate instance fields, constructors, accessor and mutator methods, and toString method. Cont'd on next pageStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started