Package src
Class Credit
java.lang.Object
src.Account
src.Credit
Credit class that is extended off Account class to represent Credit Accounts
-
Field Summary
Fields inherited from class src.Account
accountHolder, accountNumber, balance, lock, startingBalance -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanDeposit(double amount) check if the deposit amount is more than what is being owedbooleancanWithdraw(double amount) checks if you the amount will put the users credit total charge past the max amountbooleanchangeBalance(double amount, Logger log) changes the balance based on the amount givenvoidprints the account holder first name, last name, account number, max, and balancedoublegetMax()voidsetMax(double max) Methods inherited from class src.Account
changeBalance, displayBalance, getAccountHolder, getAccountNumber, getBalance, getStartingBalance, lockAccount, setAccountHolder, setAccountNumber, setBalance, toString, unlockAccount
-
Constructor Details
-
Credit
public Credit() -
Credit
-
-
Method Details
-
setMax
public void setMax(double max) -
getMax
public double getMax() -
changeBalance
changes the balance based on the amount given- Parameters:
amount- positive double that shows how much money is trying to be charged to the credit account- Returns:
- boolean that shows wether the charge went through
-
displayAccount
public void displayAccount()prints the account holder first name, last name, account number, max, and balance- Overrides:
displayAccountin classAccount
-
canWithdraw
public boolean canWithdraw(double amount) checks if you the amount will put the users credit total charge past the max amount- Overrides:
canWithdrawin classAccount- Parameters:
amount- positive double that shows how much money is trying to be charged to the credit account- Returns:
- boolean that tells if the sum of balance and amount will exceeed the max
-
canDeposit
public boolean canDeposit(double amount) check if the deposit amount is more than what is being owed- Overrides:
canDepositin classAccount- Parameters:
positive- double, amount that is being used to pay off the debt- Returns:
- boolean to show if the amount was less than equal to what was owed
-