Shopping Basket Discount

Items in a shopping basket have a unit price and quantity. Write code that will allow you to:

Normally the total price is the sum of unit price * quantity for all the items. If you buy in bulk you get a discount:


This basket qualifies for a 5% discount and the total price is $151.94


I got this kata from Jason Gorman but I have changed it slightly.

Referenced in these Learning Hours: