Class Bank

java.lang.Object
  extended byBank

public class Bank
extends Object

A Bank object simulates the behavior of a simple bank/ATM. It contains a Terminal object and two BankAccount objects. Its single public method is open, which opens this Bank for business, prompting the customer for input. To create a Bank and open it for business issue the command java Bank.

Version:
1
See Also:
BankAccount

Constructor Summary
Bank(String name)
          Construct a Bank with the given name.
 
Method Summary
static void main(String[] args)
          The Bank simulation program begins here when the user issues the command java Bank.
 void open()
          Open the Bank for business.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Bank

public Bank(String name)
Construct a Bank with the given name. Create two new BankAccounts, each with a starting balance of initialBalance.

Parameters:
name - the name of the Bank.
Method Detail

main

public static void main(String[] args)
The Bank simulation program begins here when the user issues the command java Bank.

Parameters:
args - the command line arguments (ignored).

open

public void open()
Open the Bank for business. Send a whichAccount message prompting for a BankAccount number, then send a processTransactionsForAccount message to do the work.