Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package atm;
- import bankService.BankService;
- import bankService.bankServiceExceptions.AuthException;
- import bankService.bankServiceExceptions.InsufficientMoneyException;
- public class AutomaticCashTerminal {
- private String serialNumber, username, password;
- public AutomaticCashTerminal(String serialNumber){
- this.serialNumber = serialNumber;
- }
- public boolean loginSuccessful(String username, String password){
- if (BankService.loginSuccessful(username, password)){
- this.username = username;
- this.password = password;
- return true;
- }
- return false;
- }
- public double getBalance() throws AuthException {
- return BankService.getBalance(username, password);
- }
- public void putMoney(double sum) throws AuthException {
- BankService.putMoney(username, password, sum);
- }
- public void getMoney(double sum) throws AuthException, InsufficientMoneyException {
- BankService.getMoney(username, password, sum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement