Parse the Parcel
We're looking break into the retail market and make selling items even easier and so we've decided to build our very own package shipping network. All that remains to be done is to update the website so that users can be advised how much their items will cost to send.
Our new service shipping costs are based on size and we offer different prices for small, medium, and large boxes. Unfortunately we're currently unable to move heavy packages so we've placed an upper limit of 25kg per package.
Package Type | Length | Breadth | Height | Cost |
---|---|---|---|---|
Small | 200mm | 300mm | 150mm | $5.00 |
Medium | 300mm | 400mm | 200mm | $7.50 |
Large | 400mm | 600mm | 250mm | $8.50 |
Coding Exercise
We have already implemented a function, but Uncle Bob was not pleased with how it was implemented. Please refactor the function in a way that would make Uncle Bob happy.