edu.trinity.cs.bmassing.simple
Class Account

java.lang.Object
  extended by edu.trinity.cs.bmassing.simple.Account

public class Account
extends java.lang.Object

Class for bank accounts. (If I had more to say about this class, I could say it here.)


Field Summary
static int BANK_ROUTING_NUMBER
           
 
Constructor Summary
Account(double balance, double interestRate, java.lang.String name, int accountNumber)
          Constructor allowing setting initial values of all variables.
 
Method Summary
 double addInterest()
          Compute and add interest.
 double deposit(double amount)
          Deposit some money.
 int getAccountNumber()
          Get account number.
 double getBalance()
          Get balance.
 java.lang.String getName()
          Get account name.
static void main(java.lang.String[] args)
          Main program to do some simple tests.
 double withdraw(double amount)
          Withdraw some money.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BANK_ROUTING_NUMBER

public static final int BANK_ROUTING_NUMBER
See Also:
Constant Field Values
Constructor Detail

Account

public Account(double balance,
               double interestRate,
               java.lang.String name,
               int accountNumber)
Constructor allowing setting initial values of all variables.

Method Detail

deposit

public double deposit(double amount)
Deposit some money.

Parameters:
amount -
Returns:
new balance

withdraw

public double withdraw(double amount)
Withdraw some money.

Parameters:
amount -
Returns:
new balance
Throws:
java.lang.RuntimeException - if amount > balance

getName

public java.lang.String getName()
Get account name.


getBalance

public double getBalance()
Get balance.


getAccountNumber

public int getAccountNumber()
Get account number.


addInterest

public double addInterest()
Compute and add interest.

Returns:
new balance

main

public static void main(java.lang.String[] args)
Main program to do some simple tests.

Parameters:
args - command-line arguments (unused)