Skip to content

The Problem #1

@UchuuJ

Description

@UchuuJ

The Problem

Create a calculator module that will be used to generate costs for a courier service. In particular, this calculator will calculate costs for a
driver and their van undertaking a delivery job.
Your module should factor in:

  • The distance between the pickup location and the drop-off location(s)
  • Anything between 1 and 5 drop-off locations
  • A cost per mile that won't be the same for every job
  • An optional cost for a second person to help the driver with the delivery job
  • The need for a consistent quote data structure that can be shared with other calculators and passed to other modules
  • Treat your calculator as one that will be built upon. Other developers will need to either extend on or build ones similar to the one you
    develop here. Be sure to structure your code in a way that accommodates this scenario, preferably using OOP methodology.

The resulting pricing data should include the following items:

  • Number of drop-offs
  • Total distance
  • Cost per mile
  • Extra person price
  • Total price
  • Any other data you might think is relevant

Example Scenario

  • Cost per mile: £1.00
  • No. of drop-off locations: 3
  • Distances between locations:
    • 55 miles
    • b. 13 miles
    • c. 22 miles
    • Two-person job: no
      Additional Notes
  • The "Extra Person" price is £15.
  • The driver will only go to the pickup location once and load items for all drop-offs. They'll go from one drop-off to the next until all dropoffs are complete.
  • Cost per mile and the "Extra Person" option will be consistent across all delivery services and their calculators.
  • Expose your module’s functionality via an API, one or two endpoints as needed; a front-end is not required for this task and so you
    shouldn’t spend any time building one.

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