We have already seen the testing class, CashRegisterTester that should be in a file named CashRegisterTester.java
The CashRegister class should be in a separate file, CashRegister.java
Recall the methods we want:
- void recordPurchase(double amt)
- void enterPayment(double amt)
- double getChange()
We need two double variables. One to store the total purchase amount and one to record the payment amount.
Finally, we need a constructor to initialize these two instance variables.