Skip to content

DA-5: Implement calculation logic #6

@UchuuJ

Description

@UchuuJ

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions