Package src
Class Account
java.lang.Object
src.Account
Account class used to be a base for the three account sub categories saving, checking, and credit, used to reduce redudancy through inheritance and polymorphosm
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Customerprotected intaccount_number, balance and account_holder are all base information needed to have an account not including account specific requirementsprotected doubleprotected booleanlock is a new feature to lock your accountprotected double -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanDeposit(double amount) The Deposit should always be true for this method since you dont have a max amount of money you can havebooleancanWithdraw(double amount) Checks if the withdrawl should be approved based on the uses balancebooleanchangeBalance(double amount) Changes the balance based on the amount givenvoiddisplays account holder first and last name, account number, and balancevoiddisplays balance for the account with the account number ...intdoubledoublevoidmethod to immplement the functionality to lock your account.voidsetAccountHolder(Customer holder) voidsetAccountNumber(int num) voidsetBalance(double balance) toString()voidmethod to immplement the functionality to unlock your account.
-
Field Details
-
accountNumber
protected int accountNumberaccount_number, balance and account_holder are all base information needed to have an account not including account specific requirements -
balance
protected double balance -
startingBalance
protected double startingBalance -
accountHolder
-
lock
protected boolean locklock is a new feature to lock your account
-
-
Constructor Details
-
Account
public Account() -
Account
-
-
Method Details
-
setAccountNumber
public void setAccountNumber(int num) -
setBalance
public void setBalance(double balance) -
setAccountHolder
-
getAccountNumber
public int getAccountNumber() -
getBalance
public double getBalance() -
getStartingBalance
public double getStartingBalance() -
getAccountHolder
-
lockAccount
public void lockAccount()method to immplement the functionality to lock your account. -
unlockAccount
public void unlockAccount()method to immplement the functionality to unlock your account. -
changeBalance
public boolean changeBalance(double amount) Changes the balance based on the amount given- Parameters:
amount- is positive if it is for a deposit or negative if withdrawl- Returns:
- wether the transation was successful
-
displayAccount
public void displayAccount()displays account holder first and last name, account number, and balance -
displayBalance
public void displayBalance()displays balance for the account with the account number ... -
canWithdraw
public boolean canWithdraw(double amount) Checks if the withdrawl should be approved based on the uses balance- Parameters:
amount- amount that is wan ted to be withdrawn- Returns:
- boolean returning true if the customer has eenough money in their balance to 2
-
canDeposit
public boolean canDeposit(double amount) The Deposit should always be true for this method since you dont have a max amount of money you can have -
toString
-