Create class SavingsAccount. 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 savingsBalance indicating the amount the saver currently has on deposit. Provide method calculateMonthlyInterest to calculate the monthly interest by multiplying the savingsBalance by annuallnterestRate divided by 12- this interest should be added to savingsBalance. Provide a static method setInterestRate that sets the annuallnterestRate to a new value. There should also be a method setSavingsBalance to set the initial savings balance for a new saver or you can do it through a constructor. Write a program to test class SavingsAccount. Instantiate two SavingsAccount objects, saver1 and saver2, with balances of $2000.00 and $3000.00, respectively. Set annuallnterestRate to 4%, then calculate the monthly interest for each 12 months and print the new balances for both savers. Next, set the annuallnterestRate to 5%, calculate the next month's interest and print the new balances for both savers. If you run this java file right now, it only prints out the amount for 1 month. How can you make my program so that it prints the amount for 13 months? It should print out Month 1: 2006.67 Month 2: 2013.36 Month 3: 2020.07 Month 4: 2026.80 etc. after 12 month, change the rate to be 5 percent

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Create class SavingsAccount. 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 savingsBalance
indicating the amount the saver currently has on
deposit. Provide method calculateMonthlyInterest to
calculate the monthly interest by multiplying the
savingsBalance by annuallnterestRate divided by 12-
this interest should be added to savingsBalance.
Provide a static method setInterestRate that sets the
annuallnterestRate to a new value. There should also
be a method setSavingsBalance to set the initial
savings balance for a new saver or you can do it
through a constructor.
Write a program to test class SavingsAccount.
Instantiate two SavingsAccount objects, saver1 and
saver2, with balances of $2000.00 and $3000.00,
respectively. Set annuallnterestRate to 4%, then
calculate the monthly interest for each 12 months
and print the new balances for both savers. Next, set
the annuallnterestRate to 5%, calculate the next
month's interest and print the new balances for both
savers.
If you run this java file right now, it only prints out
the amount for 1 month. How can you make my
program so that it prints the amount for 13 months?
It should print out
Month 1: 2006.67
Month 2: 2013.36
Month 3: 2020.07
Month 4: 2026.80
etc.
after 12 month, change the rate to be 5 percent
Transcribed Image Text:Create class SavingsAccount. 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 savingsBalance indicating the amount the saver currently has on deposit. Provide method calculateMonthlyInterest to calculate the monthly interest by multiplying the savingsBalance by annuallnterestRate divided by 12- this interest should be added to savingsBalance. Provide a static method setInterestRate that sets the annuallnterestRate to a new value. There should also be a method setSavingsBalance to set the initial savings balance for a new saver or you can do it through a constructor. Write a program to test class SavingsAccount. Instantiate two SavingsAccount objects, saver1 and saver2, with balances of $2000.00 and $3000.00, respectively. Set annuallnterestRate to 4%, then calculate the monthly interest for each 12 months and print the new balances for both savers. Next, set the annuallnterestRate to 5%, calculate the next month's interest and print the new balances for both savers. If you run this java file right now, it only prints out the amount for 1 month. How can you make my program so that it prints the amount for 13 months? It should print out Month 1: 2006.67 Month 2: 2013.36 Month 3: 2020.07 Month 4: 2026.80 etc. after 12 month, change the rate to be 5 percent
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY