Advertisement
rmword

Untitled

Oct 23rd, 2017
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  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.  
  11. public void dispenseCash(int amount)
  12. {
  13. int billsRequired = amount / 20;
  14. count-=billsRequired;
  15. }
  16.  
  17. public boolean isSufficientCashAvailable(int amount)
  18. {
  19. int billsRequired = amount / 20;
  20.  
  21. if (count >= billsRequired)
  22. return true;
  23. else
  24. return false;
  25. }
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement