summaryrefslogtreecommitdiff
path: root/src/test/java/smyth/BankAccount.oj
blob: d2402afc230d7ec0650c1b100bbe82a65bb9c07c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import smyth;

public distributed class BankAccount instantiates MDistributed {
    private int balance = 100;

    public BankAccount() {
        super();
    }

    public int getBalance() {
        return balance;
    }

    public void deposit(int d) {
        System.out.println(d);
        balance += d;
        System.out.println(d + " has been deposited in your account.");
    }

    public void withdraw(int w) {
        System.out.println(w);
        balance -= w;
        System.out.println(w + " has been withdrawn from your account.");
    }
}