public class BankDatabase
extends java.lang.Object
| Constructor and Description |
|---|
BankDatabase()
BankDatabase constructor initializes the array of accounts.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
authenticateUser(int accountNumber,
int pin)
Determines whether a user-specified account number and PIN match those
of an account in the database.
|
void |
credit(int accountNumber,
double amount)
Credits an amount to the Account object for the account number.
|
void |
debit(int accountNumber,
double amount)
Debits an amount from the Account object for the account number.
|
double |
getAvailableBalance(int accountNumber)
Returns the available balance of the Account object for the account number.
|
double |
getTotalBalance(int accountNumber)
Returns the total balance of the Account object for the account number.
|
public BankDatabase()
public boolean authenticateUser(int accountNumber,
int pin)
accountNumber - the account entered by a userpin - the PIN entered by a userpublic double getAvailableBalance(int accountNumber)
accountNumber - the specified account number for the available balancepublic double getTotalBalance(int accountNumber)
accountNumber - the specified account number for the total balancepublic void credit(int accountNumber,
double amount)
accountNumber - the specified account number to be creditedamount - the amount credited to the accountpublic void debit(int accountNumber,
double amount)
accountNumber - the specified account number to be debitedamount - the amount debited from the account