public class Bank
extends java.lang.Object
Constructor and Description |
---|
Bank()
Constructs a bank with no bank accounts.
|
Modifier and Type | Method and Description |
---|---|
void |
addAccount(BankAccount newAccount)
Adds an account to this bank.
|
int |
count(double atLeast)
Counts the number of bank accounts whose balance is at
least a given value.
|
BankAccount |
find(java.lang.String acctNum)
Linear search to find a bank account with a given account number.
|
BankAccount |
getMaximum()
Gets the bank account with the largest balance.
|
double |
getTotalBalance()
Gets the sum of the balances of all accounts in this bank.
|
void |
printList()
Print data for all accounts
|
public void addAccount(BankAccount newAccount)
newAccount
- the account to addpublic void printList()
public double getTotalBalance()
public int count(double atLeast)
atLeast
- the balance required to count an accountpublic BankAccount find(java.lang.String acctNum)
acctNum
- the number to findpublic BankAccount getMaximum()