educative.io

Educative

Suggestions Required on How to calculate Parking Fee

Hi @Design_Gurus,
Need your help in suggesting on how can we calculate Parking Fee for a Particular vehicle when customer reached ExitPanel. Following are the points on which need your help to get clarity on.

  1. In Activity Diagram, it is mentioned that System will calculate total Parking Fee but what will be the triggering point at when system will know that it needs to calculate Parking Fees ? In my opinion whenever ExitPanel calls the scanTicket() function then we need to calculate Parking Fees and display back to ExitPanel.
  2. In which class does calculateParkingFee() function needs to implemented.In my opinion it should be in ParkingTicket since it is ParkingTicket cost/fee only but the problem is how we can efficiently get ParkingRate and ElectricPanelRate to calculate ParkingFees.

Please help here. Any valid suggestions are also welcomed.