CashRegisterTester.java.html

  1  /**
  2     A class to test the CashRegister class.
  3  */
  4  public class CashRegisterTester
  5  {
  6     public static void main(String[] args)
  7     {
  8        CashRegister register = new CashRegister();
  9  
 10        register.recordPurchase(29.50);
 11        register.recordPurchase(9.25);
 12        register.receivePayment(50);
 13  
 14        double change = register.giveChange();
 15  
 16        System.out.println(change);      
 17        System.out.println("Expected: 11.25");          
 18     }
 19  }