Bank Class

Bank Class

You have a lot of flexibility in creating this class, but here is what it should be able to do

  • Methods
    • ArrayList<Person>  topAccountOwners(double cutoff)
      • this method returns an ArrayList of the owners whose accounts have at least cutoff amount of balance
    • void nightlyUpdate()
      • this runs through the accounts and if account is a SavingsAccount, then it calls that object’s recordDailyBalance() method
    • Account topBalance()   ; returns the Account object with the greatest balance
    • Account[] allWithinRange(double min, double max) returns an array of Accounts whose balances range from min  to max , inclusive
    • boolean transfer( double amount, int accountIdFrom , int accountIdTo) ;  this method transfers  money from the one account to the other. If the accountIdFrom  does not have enough $$, this method returns false.
    • void monthlyUpdate()
      • this runs through the accounts and if
      • account is a SavingsAccount, then it calls that object’s updateInterestPayment() method
    • ** extra credit ArrayList<Account> sortByAmount()  
      •   this method returns an arraylist of Accounts sorted by amount in the account

 

account_with_bank_no_labels