Question: Hello, I need help coding the following program below. Overvievw In this challenge, you will create a simple SavingsAccount class that includes a constructor with

Hello, I need help coding the following program below.

Hello, I need help coding the following program below. Overvievw In this

Overvievw In this challenge, you will create a simple SavingsAccount class that includes a constructor with an exception handler, private and static variables, two calculation methods, a set method, and a test harness Specifications Create a class called SavingsAccount. Include an exception in the constructor to test for balances before zero (IllegalArgumentException). Use a static variable annualInterestRate to store the annual interest rate for all account holders. 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 savingsBalance by annualInterestRate divided by 12-this interest should be added to savingsBalance. Provide a static method modifyInterestRate that sets the annualInterestRate to a new value. Include an exception in this method to ensure the rate is between 0.0 and 1.0. Write a program to test class SavingsAccount-name it SavingsAccountTest. Instantiate two savingsAccount objects, saverl and saver2, with balances of $2000.00 and $3000.00, respectively Insert a printf statement after instantiating the above. with your student ID and name Set annual Inte restRate to 4%, then calculate the monthly interest for each of 12 months and print the new balances for both savers. Now, set the annual InterestRate to 5%, calculate the next month's interest and print the new balances for both savers. Finally, set the parameters for both methods, one at a time, so that an exception is thrown

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!