|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object BankAccount SavingsAccount
A SavingsAccount is a BankAccount that bears interest. A fee is charged for too many transactions in a month.
BankAccount
Constructor Summary | |
SavingsAccount(int initialBalance,
Bank issuingBank)
Constructor, accepting an initial balance. |
Method Summary | |
void |
countTransaction()
Increment count of transactions, for this account for this Month and in total and for the issuing Bank, by one. |
protected int |
getTransactionFee()
Override getTransactionFee() to return a non-zero fee after the appropriate number of free monthly transactions. |
void |
newMonth()
A SavingsAccount earns interest each month. |
Methods inherited from class BankAccount |
deposit, getBalance, getIssuingBank, getTransactionCount, incrementBalance, requestBalance, withdraw |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SavingsAccount(int initialBalance, Bank issuingBank) throws InsufficientFundsException
initialBalance
- the opening balance.issuingBank
- the bank that issued this account.
InsufficientFundsException
- when appropriate.Method Detail |
public void countTransaction() throws InsufficientFundsException
countTransaction
in class BankAccount
InsufficientFundsException
- when appropriate.protected int getTransactionFee()
getTransactionFee
in class BankAccount
public void newMonth() throws InsufficientFundsException
newMonth
in class BankAccount
InsufficientFundsException
- when appropriate.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |