codingforeveryone/js

new-member-27 Paperboy

Closed this issue · 3 comments

You and your best friend Stripes have just landed your first high school jobs! You'll be delivering newspapers to your neighbourhood on weekends. For your services you'll be charging a set price depending on the quantity of the newspaper bundles.

The cost of deliveries is:

  • $3.85 for 40 newspapers
  • $1.93 for 20
  • $0.97 for 10
  • $0.49 for 5
  • $0.10 for 1

Stripes is taking care of the footwork doing door-to-door drops and your job is to take care of the finances. What you'll be doing is providing the cheapest possible quotes for your services.

Write a function that's passed an integer representing the amount of newspapers and returns the cheapest price. The returned number must be rounded to two decimal places.

Paperboy

Hey Troy. I gave a solution to your last kata on codewars (its under the name Aquila). So will leave that issue open for someone else, assign this one to myself, and post my new kata afterwards as an issue. Many thanks (and maybe see you again tomorrow?)

Hey Brad! Yes definitely I will be at the meet up tomorrow so I'll see you then!

My solution is attached to the pull request I just made. The guide (contributing) said someone will merge if they're satisfied with the solution, so feel free to merge if you're happy with it, and let me know if there's anything else I should do. 👍

Cool! see you soon :)