Mr Harris King, the owner of “King’s Variety Shop”, has asked your consulting firm to design an algorithm for a simple cash register system which will allow the cashiers at the shop to total the price of the items being bought by a customer, calculate the tax on each item and provide the final payable amount of the bill. The cash register system should then tell the cashier how much change is due back to the customer based on the amount of cash given to the cashier.
Points to Note: 1. Items belong to one of two categories – VAT or non-VAT, and the system must accommodate for this: a. VAT items incur a 10% tax; b. Non-VAT items incur no tax.
2. The cashier will enter the category and the price of each item until all of a customer's items have been entered. (The system will have to check to determine that the last item has been entered).
3. Things to be displayed to the screen: subtotal before tax, final bill payable, and any change due.
4. The business accepts cash only. Therefore, at this point in time the required system does not have to deal with processing cheques or debit/credit cards.
I need help with the Algorithm.