Class Account

java.lang.Object
  |
  +--Account

public class Account
extends java.lang.Object

Superclass of bank account hierarchy.


Field Summary
protected  int acct_no
          The account number.
protected  java.lang.String ss
          The social security number of owner.
 
Constructor Summary
Account()
           
Account(int id, double amt, java.lang.String ss)
          Constructor.
 
Method Summary
 double balance()
          Retrieves the account balance.
 void deposit(double amt)
          Deposits into account.
 boolean withdraw(double amt)
          Withdraw from account.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

acct_no

protected int acct_no
The account number.


ss

protected java.lang.String ss
The social security number of owner.

Constructor Detail

Account

public Account()

Account

public Account(int id,
               double amt,
               java.lang.String ss)
Constructor. Initializes a new account.

Parameters:
id - Account number
amt - Initial balance amount
ss - Social security number as string
Method Detail

balance

public double balance()
Retrieves the account balance.

Returns:
the balance

deposit

public void deposit(double amt)
Deposits into account.

Parameters:
amt - the amount to deposit, if amt <=0 no effect

withdraw

public boolean withdraw(double amt)
Withdraw from account.

Parameters:
amt - the amount to deposit
Returns:
false if amt <=0 or insufficient balance