ProtectedAccount

 

ProtectedAccount.java is another basic class of a package of bank accounts. It encorperates a pin protection on the accounts. This class is abstract. This class extends BasicAccount.

 

public ProtectedAccount ( String name, String pin)

Constructor

Receives: the name and pin of the person owning the account:

Postcondition: superclass constructor has been called, the pin has been set:

 

public void deposit( double amount, String pin)

Basic method to do a deposit.

Receives: the amount of the deposit and a trial pin

Postcondition: If the pin matches and the amount is positive, the amount is deposited in the account.

 

public void withdraw( double amount, String pin)

Basic method to do a withdraw.

Receives: the amount of the withdraw and a trial pin

Postcondition: If the pin matches, the amount is positive, and the amount is less than the balance, then the amount is deposited in the account.

 

 


Back to the package documentation index


Back to the Introduction


Copyright 2000 by Prentice Hall. All rights reserved.