If the MVP card is presented, then selected item discounts should apply, as recorded in the store database. The discount is expressed as an amount (e.g. 5 cents), not a percentage. You may choose the discounts to record in the database. Keep in mind that the discounts should be recorded separately from the price (since we still need to charge the full price for a customer without an MVP card).
In formatting a bill with an MVP card, each item to which a discount applies (i.e. has a discount value > 0) should be formatted to show the amount of the discount and the price after the discount is applied. In addition, if an MVP card is used, a final line should be added to the bill showing the total MVP savings realized. A sample bill illustrating the output format is shown below.
If no MVP card is presented, the bill should not mention the size of the discount, and display full prices. It also should also omit the total savings line at the end of the bill.
Without MVP card | With MVP card |
---|---|
Java Stores Scones .......................... £2.05 Crisps .......................... £0.37 Marmite ......................... £1.89 (Item not found) ................ £0.00 Crisps .......................... £0.37 Tea ............................. £1.10 TOTAL ........................... £5.78 Thanks for shopping at Java stores |
Java Stores Scones (MVP discount £0.35) ..... £1.70 Crisps .......................... £0.37 Marmite (MVP discount £0.05) .... £1.84 (Item not found) ................ £0.00 Crisps .......................... £0.37 Tea (MVP discount £0.15) ........ £0.95 TOTAL ........................... £5.23 Total MVP savings ............... £0.55 Thanks for shopping at Java stores |
You should turn in: