BasicAccount

 

BasicAccount.java is the base class of a package of bank accounts. This class is abstract.

public BasicAccount ( String name)

Constructor

Receives: the name of the person owning the account:

Postcondition: I have been created with no balance, no interest, and the name has been set:

 

public String name ()

Accessor to retrieve the name of the account owner

Return: name

 

public double balance ()

Accessor to retrieve the account balance

Return: current balance

public double rate ()

Accessor to retrieve the account interest rate

Return: rate

 

public void monthly_update()

Basic mutator method to handle monthly fees and credits

Postcondition: computeFees and computedInterest have been called and the account balance has been changed accordingly.

public double computeFees()

Basic method to compute monthly fee

Returns: the fee amount to be levied against the account.

 

public double computeInterest()

Basic method to compute monthly interest

Returns: the interest amount to be added to the account.

public String toString()

String converter (output)

Return: the String which gives a nice presentation of the account information.

 

 

 


Back to the package documentation index


Back to the Introduction


Copyright 2000 by Prentice Hall. All rights reserved.