Cash Register

The CashRegister class is used to track purchases made by a customer, accept payment in the form of dollars, quarters, dimes, nickels, and pennies, and indicate how much change should be returned when the items are paid for. (The cash register does not need to keep track of the change in its drawer. When it’s time to give change back, it just reports the total amount of money to be returned.)

Include the methods recordPurchase(amount), enterPayment(dollars, quarters, dimes, nickels, pennies), and giveChange(). One of the challenges of this assignment is identifying what variables the class needs to have to work as designed.

Note that the cash register needs to be able to record multiple purchases for a customer. It also needs to be able to work correctly while ringing up a series of customers, one after the other.

Write a CashRegisterTester class to demonstrate the use of the CashRegister.