Sal's shipping

I am currently on the last stop of Sal’s shipping and I do not understand how to perform this step. I watched the walkthrough but it is very confusing with adding methods and %s which has not been covered yet.

Using those two functions for ground shipping cost and drone shipping cost, as well as the cost of premium ground shipping, write a function that takes one parameter, weight and prints a statement that tells the user

  • The shipping method that is cheapest.
  • How much it would cost to ship a package of said weight using this method.
1 Like

Try writing out the steps you would take to achieve this. You don’t need to worry about the code but if this was a straightforward question and coding had nothing to do with it, how would you go about solving this problem? Pen and paper is often a great place to start.

When it comes to code you’ve already covered most of what you need. You’ve come across comparisons (<, >=, !=, ...). You have functions which perform calculations to work out prices for a given weight. Sticking them together is less of a coding problem and more a question of logic and order. Sort that out before you try writing the code and it’ll likely be easier.

1 Like