public class Account
extends java.lang.Object
| Constructor and Description |
|---|
Account(int accountNumber,
int pin,
double availableBalance,
double totalBalance)
Account constructor initializes the attributes from the parameters.
|
| Modifier and Type | Method and Description |
|---|---|
void |
credit(double amount)
Credits an amount to the account.
|
void |
debit(double amount)
Debits an amount from the account.
|
int |
getAccountNumber()
Returns the bank account number for the account.
|
double |
getAvailableBalance()
Returns the funds available for withdrawal.
|
double |
getTotalBalance()
Returns the total funds including pending deposits.
|
boolean |
validatePIN(int pin)
Determines whether a user-specified PIN matches the PIN in the account.
|
public Account(int accountNumber,
int pin,
double availableBalance,
double totalBalance)
accountNumber - the bank account number for this accountpin - the PIN for account authorization for this accountavailableBalance - funds available for withdrawaltotalBalance - total funds including pending depositspublic boolean validatePIN(int pin)
pin - the PIN entered by a user for authenticationpublic double getAvailableBalance()
public double getTotalBalance()
public void credit(double amount)
amount - the amount credited to the accountpublic void debit(double amount)
amount - the amount debited from the accountpublic int getAccountNumber()