Class CheckingAccount

java.lang.Object
  extended byBankAccount
      extended byCheckingAccount

public class CheckingAccount
extends BankAccount

A CheckingAccount is a BankAccount with one new feature: the ability to cash a check by calling the honorCheck method. Each honored check costs the customer a checkFee.

Version:
5

Constructor Summary
CheckingAccount(int initialBalance, Bank issuingBank)
          Constructs a CheckingAccount with the given initial balance and issuing Bank.
 
Method Summary
 int honorCheck(int amount)
          Honor a check: Charge the account the appropriate fee and withdraw the amount.
 void newMonth()
          Action to take when a new month starts.
 
Methods inherited from class BankAccount
countTransaction, 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

CheckingAccount

public CheckingAccount(int initialBalance,
                       Bank issuingBank)
Constructs a CheckingAccount with the given initial balance and issuing Bank. Counts as this account's first transaction.

Parameters:
initialBalance - the opening balance for this account.
issuingBank - the bank that issued this account.
Method Detail

honorCheck

public int honorCheck(int amount)
Honor a check: Charge the account the appropriate fee and withdraw the amount.

Parameters:
amount - amount (in whole dollars) to be withdrawn.
Returns:
the amount withdrawn.

newMonth

public void newMonth()
Action to take when a new month starts.

Specified by:
newMonth in class BankAccount