Package src

Class Credit


public class Credit extends Account
Credit class that is extended off Account class to represent Credit Accounts
  • Constructor Details

    • Credit

      public Credit()
    • Credit

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

    • setMax

      public void setMax(double max)
    • getMax

      public double getMax()
    • changeBalance

      public boolean changeBalance(double amount, Logger log)
      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:
      displayAccount in class Account
    • canWithdraw

      public boolean canWithdraw(double amount)
      checks if you the amount will put the users credit total charge past the max amount
      Overrides:
      canWithdraw in class Account
      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:
      canDeposit in class Account
      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