Class Account

java.lang.Object
  extended by Account

public class Account
extends java.lang.Object

Account class holds the identifier, name and current balance

Version:
(a version number or a date)
Author:
(your name)

Constructor Summary
Account(int num, float start)
          Constructor for objects of class Account
 
Method Summary
 int getAccountNumber()
          Accessor method for account number
 float getBalance()
          Accessor method for balance
 void report()
          Print the opening balance.
 boolean updateBalance(Transaction t)
          Perform a transaction on this account.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Account

public Account(int num,
               float start)
Constructor for objects of class Account

Parameters:
num - the account number
start - the starting balance
Method Detail

getAccountNumber

public int getAccountNumber()
Accessor method for account number


getBalance

public float getBalance()
Accessor method for balance


report

public void report()
Print the opening balance. Iterate through the transactions for the account and print the closing balance.


updateBalance

public boolean updateBalance(Transaction t)
Perform a transaction on this account. The transaction is not processed if balance + amt < 0.

Parameters:
t - the transaction object