Question
**Structure required** my_assignment |--- my_problem2 |--- src |--- SavingsAccount.java |--- SavingsAccountTest.java **should follow** SavingsAccount is a public class annualInterestRate is a private class variable savingsBalance
**Structure required**
my_assignment |--- my_problem2 |--- src |--- SavingsAccount.java |--- SavingsAccountTest.java
**should follow**
SavingsAccount is a public class annualInterestRate is a private class variable savingsBalance is a private instance variable calculateMonthlyInterest is a public instance method calculateMonthlyInterest is correctly implemented modifyInterestRate is a public class method modifyInterestRate is correctly implemented Test program instantiates two SavingsAccount objects Test program sets the annualInterestRate to 4% Test program calculates the monthly interest for each of the 12 months and prints the monthly balances for both SavingsAccount instances as a table Test program sets the annualInterestRate to 5% Test program calculates the monthly interest for the next month's interest and prints the balances for both SavingsAccount instances. Test program is in a public class called SavingsAccountTest
Create class Savings Account. Use a static variable annuallnterestRate to store the annual interest rate for all account holders. Each object of the class contains a private instance variable savings Balance indicating the amount the saver currently has on deposit. Provide method calculateMonthlyInterest to calculate the monthly interest by multiplying the savings Balance by annuallnterestRate divided by 12-this interest should be added to savings Balance. Provide a static method modifyInterestRate that sets the annualInterestRate to a new value. Write a program called Savings Account Test to test class SavingsAccount. Instantiate two SavingsAccount objects, saver 1 and saver 2, with balances of $2000.00 and $3000.00, respectively. Set annuallnterestRate to 4%, then calculate the monthly interest for each of 12 months and print the monthly balances for both savers. Next, set the annualInterestRate to 5%, calculate the next month's interest and print the new balances for both saversStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started