Create a class SavingsAccount. Use a static class variable to store the annualInterestRate for each of the savers. Each object of the class contains a private instance variable savingsBalance indicating the amount the saver currently has on deposit. Provide method calculateMonthlyInterest to calculate the monthly interest by multiplying the balance by annualInterestRate divided by 12;

Respuesta :

Answer:

Explanation:

The following code is written in Java and creates the requested variables inside the SavingsAccount class, then it creates a contructor method to add a value to the savingsBalance per object creation. And finally creates a calculateMonthlyInterest method to calculate the interest through the arithmetic operation provided in the question...

public class SavingsAccount {

   static double annualInterestRate = 0.03;

   private double savingsBalance;

   

   public void SavingsAccount(double savingsBalance) {

       this.savingsBalance = savingsBalance;

   }

   

   public double calculateMonthlyInterest() {

       return ((savingsBalance * annualInterestRate) / 12);

   }

}

ACCESS MORE
EDU ACCESS