All pastes #368777 Raw Edit

Something

public text v1 · immutable
#368777 ·published 2007-02-23 09:46 UTC
rendered paste body
ackage oving6;

public class SavingsAccount extends AbstractAccount {
	public SavingsAccount() {
		super();
	}
	@Override
	public String getAccountType() {
		return "Savings account";
	}
	@Override
	public int deposit(int amount) {
		if (amount >= 0) {
			this.addTransaction(amount, "d");
		}
		return this.getBalance();
	}
	@Override
	public int withdraw(int amount) {
		if (amount >= 0 && this.getBalance() - amount > 0) {
			this.addTransaction(-amount, "w");
			this.addTransaction(-2, "f");
		}
		return this.getBalance();
	}
}