Implement the code for a supermarket checkout that calculates the total price of a number of items.


The code will be used by an electronic till that can only scan one item at a time. At the end of scanning the items the till system will request the total.

Goods are priced individually, however there are weekly special offers for when multiple items are bought. For example “A is 50 each or 3 for 130”.

Weekly offers change frequently. The initial prices and offers are as follows:


SKU

Item Price

Special Offers

A

50

3 for 120

B

30

2 for 45

C

60

D

99