Package src

Class Account

java.lang.Object
src.Account
Direct Known Subclasses:
Checking, Credit, Saving

public class Account extends Object
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 Details

    • accountNumber

      protected int accountNumber
      account_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

      protected Customer accountHolder
    • lock

      protected boolean lock
      lock is a new feature to lock your account
  • Constructor Details

    • Account

      public Account()
    • Account

      public Account(int accountNumber, double balance, Customer holder)
  • Method Details

    • setAccountNumber

      public void setAccountNumber(int num)
    • setBalance

      public void setBalance(double balance)
    • setAccountHolder

      public void setAccountHolder(Customer holder)
    • getAccountNumber

      public int getAccountNumber()
    • getBalance

      public double getBalance()
    • getStartingBalance

      public double getStartingBalance()
    • getAccountHolder

      public Customer 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

      public String toString()
      Overrides:
      toString in class Object