• Post Reply Bookmark Topic Watch Topic
  • New Topic

Complex Aggregation  RSS feed

 
paul c. kim
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Parked Car Class:


Parking Meter Class:


Parking Ticket Class:




Demo:


Output:
Parked Car:
Car Make: Kia
Car Model: d2349i
Color: White
License Number: 234245
Minutes Parked: 30
Parking Meter: Time purchased: 60
Police Officer: Officer Name: Ken Davis
Badge No. : 234234

0.0


I have tried many methods in ways to collaborate the aggregating classes, but I don't understand why it is not working. The generateTicket() method is supposed to return a value but it is only returning 0.0. why?


I had to do this because I couldn't figure out any other options in collaborating the ParkingTicket class and PoliceOfficer class, could this be the problem?
 
paul c. kim
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have made some fixes on my classes.

ParkingTicket class:


PoliceOfficer class:



The output still gives me a zero for the ticketCharge...Why is it showing zero>??
 
paul c. kim
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please help..
 
Janeice DelVecchio
Bartender
Posts: 1812
12
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a bunch of code to read and figure out what's going on.

I suggest you put some System.out.println statements in generateTicket and setFine to determine what the key values are...

also this loop:


You're never changing the value of illegalPark... so it looks (to me) like if you go into that loop, you'll never come out.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!