SHARE
TWEET

SavingsAccount Implementation

a guest Apr 26th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Implementation File
  2.  
  3. public class Account
  4. {
  5.  private double annualInterestRate, savingsBalance;
  6.  
  7.  public Account()
  8.  {
  9.   annualInterestRate = 0.04;
  10.   savingsBalance = 2000;
  11.  }
  12.  
  13.  public Account(double air, double bal)
  14.  {
  15.   annualInterestRate = air;
  16.   savingsBalance = bal;
  17.  }
  18.  
  19.  public double calculateMonthlyInterest()
  20.  {
  21.    savingsBalance += ((savingsBalance * annualInterestRate) / 12);
  22.    return savingsBalance;
  23.  }
  24.  
  25.  public void modifyInterestRate(double i)
  26.  {
  27.    annualInterestRate = i;
  28.  }
  29.  
  30.  
  31. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top