Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class CashDispenser
- {
- private final static int INITIAL_COUNT = 500;
- private int count;
- public CashDispenser()
- {
- count = INITIAL_COUNT;
- }
- public void dispenseCash(int amount)
- {
- int billRequired = amount / 20;
- count -= billRequired;
- }
- public boolean isSufficientCashAvailable(int amount)
- {
- int billRequired = amount / 20;
- if(count >= billRequired) return true;
- else return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement