So we're going implement the calculation logic in a Helper Method.
How I see it from a pseudo logic:
FUNCTION CALCULATE_COSTS()
totalCost = 0
totalDistance = 0
FOR distance IN ARRAY no_of_drop_off_locations:
totalDistance += distance
totalCost += (cost_per_mile * distance)
END FOR
FOR count IN extra_person_count :
totalCost += extra_person_cost
END FOR
END FUNCTION
The logic won't represent the final as it's just napkin logic to help me to come up with the correct solution.
So we're going implement the calculation logic in a Helper Method.
How I see it from a pseudo logic:
The logic won't represent the final as it's just napkin logic to help me to come up with the correct solution.