previous | start | next

CashRegister

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:

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.



previous | start | next