Question: 1. (55 pts) Create a class named AccountSavings. This class has a static double variable which stores the annual interest rate for all account holders.
1. (55 pts) Create a class named AccountSavings. This class has a static double variable which stores the annual interest rate for all account holders. The name of variable is annualInterestRate. The class also has another double variable named savingsBalance which stores balance for current account. a. Write a constructor to create an account with specified balance. Add a validation whether the balance is greater than 0.0. If it is less than 0.0 then throw an exception. b. Write a non-static calculateMonthlyInterest method to calculate the monthly interest by multiplying the savingsBalance by annualInterestRate divided by 12 the interest should be added to savingsBalance. c. Write a static method named modifyInterestRate to set the annual interest rate. Add a validation whether the rate is greater than equal to 0.0 and less than or equal 1.0. Otherwise, throw an exception. d. Write a toString method which returns savingsBalance in a string format. After that, create AccountSavingsTest class. Create two objects from the class AccountSavings with balances $2000.00 and $3000.00. Then, set the interest rate to 4%, then calculate the monthly interest rate for each 12 months for each object and print the new balances with toString method for each object. UPLOAD AccountSavings.java AND AccountSavingsTest.java. 3 Example Output: (you can create a similar output)

Answer only if you know how to do this. Please make sure you answer correct and accurate. Don't forget to add comments where

ever needed. // Try to use the techniques like classes, objects and Inheritance. (Super Class, Subclass, Object class, Constructors in Subclass) Only when needed in problem.
- Comments must me clear, brief and understandable. Do NOT write long sentences.
- Do NOT Copy codes from else where.
Thank You in Advance.
Assignment-4 - Read-only QUESTIONS 1. (33 pts) Creste a class tomed AccarSavings.This class tik deshik variable which tores the annEal merest raw for all account hrlders Thw remw of variahir B asaallaterae The class abo has anther dushl varishle nased savings Baismcr which stores bolanc for current account Write a cosiactor to creale a acut wth spaifiod balance. Add a validation whether the balance is greater than 0.0. f it is less thun 00 ten throw ineesest by maltiplying the savingsBalance by annuallecreatRate divded by 12 the intcrest should be adilod to sning Balane. c. Wrile a sane method samed fyiaterestRste toset the amaal isteresi ne Add a vlidation whether the rate is greer thn oq so 00 and ss than or equal 1.0 Otlerwise, dirow an escepon d. Wirie a ReSoring method which retures savisgsBalance in a arisg fonnat Afer tha, crown Accoandningsrer class. Create two eh-from the class Acrwitsmings with ha laan S2100) and S300000. Thcn. ict ac interest rate to 4%- then calculate the monthly isterest rate for each 12 monhs for each otject and prin the ew halances with oString method fr each ojct. UPLOAD Acwet Sasing.jaa Esample Otput: can create a similar outpet) onthly balances for one year at .04 Balances: Saver 1 Saver 2 $2000,08 $3080,08 onth 1: $2006,67 $3010,00 lonth 2: $2013,36 $3020,03 onth 3: $2028,07 $3038,10 lonth 4: $2826,88 $3848,28 onth 5: %2033,56$3050,33 lonth 6: $2040,33 $3668, 50 lonth 7: $2047,14 $3070,70 lonth 8: $2053,96 $3080,94 onth 9: $2068,81 $3091,21 lonth 18: $2867,68 $3181,51 lonth 11: $2874,57 $3111,85 lonth 12: $2081,48 $3122,22
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
