For this WOD you will modify the Invoice1 with an algorithm to determine shipping cost. Here are the the requirements:

  1. Be sure to fix any problems from Invoice1 before continuing!
  2. Add a new line in the receipt for shipping.
  3. Calculate shipping based on the order; it should be based on the sub-total and use stepped shipping amounts ($2 shipping on a subtotal of up to $50, $5 shipping for an order up to $100, 5% for $100 or more). This must be a general solution that works for any set of items, not just an example invoice. No hard-coding values!
  4. Print out the shipping charge above your total.
  5. Calculate the total now based on subtotal, tax, and shipping.
  6. Display the total in bold font.

Example output:

Item quantity price extended price
Gillette Sensor 3 Razor 2 $ 1.23 $  2.46
Barbasol Shaving Cream 1 $ 2.64 $  2.64
Nautica Cologne 1 $ 6.17 $  6.17
Rubbing Alcohol 3 $ 0.98 $  2.94
Colgate Classic Toothbrush 12 $ 1.89 $22.68
 
Sub-total $36.89
Tax @ 5.75% $  2.12
Shipping $  2.00
Total $41.01


OUR SHIPPING POLICY IS:A subtotal $0 - $49.99 will be $2 shipping
A subtotal $50 - $99.99 will be $5 shipping
Subtotals over $100 will be charged 5% of the subtotal amount


HINT: Be sure to test out your code for different item quantities to be sure that all of your code is working properly!

Quality Check list:

Rx: <9 min Av: 9-18 min Sd: 18-25 min DNF: 25+ min             

If you get stuck you can watch an example solution screencast here.