document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. public class CashDispenser
  2. {
  3.     private final static int INITIAL_COUNT = 500;
  4.     private int count;
  5.    
  6.     public CashDispenser()
  7.     {
  8.         count = INITIAL_COUNT;
  9.     }
  10.     public void dispenseCash( int amount )
  11.     {
  12.         int billsRequired = amount / 20;
  13.         count -= billsRequired;
  14.     }
  15.     public boolean isSufficientCashAvailable( int amount )
  16.     {
  17.         int billsRequired = amount / 20;
  18.        
  19.         if (count >= billsRequired )
  20.         {
  21.             return true;
  22.         }
  23.         else
  24.         {
  25.             return false;
  26.         }
  27.     }
  28. }
');