Exercise 1 Part 1 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 savings Balance 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; this interest should be added to savings Balance. Provide a static method modifyInterestRate that sets the annualInterestRate to a new value. Write a driver program to test the class SavingsAccount. Instantiate two different savingsAccount objects, saver1 and saver2, with balances of $2000.00 and $3000.00, respectively. Set annuallnterestRate to 4%, then calculate the monthly interest and print the new balances for each of the savers. Then set the annuallnterestRate to 5% and calculate the next months interest and print the new balances for each of the savers. Part 2 Write another class SpecialSavings that extends SavingsAccount to pay interest of 10% on accounts that have balances that exceed 10K. Also provided methods to deposit and take money out of savings account. Write a driver program to test the class Special Savings. Instantiate two different savingsAccount objects, saver1 and saver2, with balances of $2000.00 and $3000.00, respectively. Make a few deposits and withdrawals and show balance and interest earned for each account. Some Tips for helping you with Lab 4: For Lab 4 part 1 - Pl. follow the instructions in the assignment and write the class definition. A driver program is the code you would write in main() to exercise the code of class definition. You should declare private variable in your class definition. You should also write protected methods to set and get the value of private variables. For Exercise 1 part 2 - You need to write deposit and withdrawal methods. Should you put this in parent class or child class? Try to answer this question so that you have most reusability in your class definition. In this part - you have to learn how polymorphism works. You will have accounts whose balance might be above or below 10K. By using methods in both classes try to change the interest earned to 10% if balance is above 10K or 4% if the balance is lower.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

javacoding please thank you!

Exercise 1
Part 1
Create a class Savings Account. Use a static class variable to store the annualInterestRate for each of the savers. 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 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 driver program to test the class SavingsAccount. Instantiate two different
savings Account objects, saver1 and saver2, with balances of $2000.00 and $3000.00, respectively. Set annualInterestRate to 4%, then calculate the
monthly interest and print the new balances for each of the savers. Then set the annualInterestRate to 5% and calculate the next months interest and print
the new balances for each of the savers.
Part 2
Write another class SpecialSavings that extends SavingsAccount to pay interest of 10% on accounts that have balances that exceed 10K. Also provided
methods to deposit and take money out of savings account. Write a driver program to test the class SpecialSavings. Instantiate two different savingsAccount
objects, saver1 and saver2, with balances of $2000.00 and $3000.00, respectively. Make a few deposits and withdrawals and show balance and interest
earned for each account.
Some Tips for helping you with Lab 4:
For Lab 4 part 1 -
Pl. follow the instructions in the assignment and write the class definition. A driver program is the code you would write in main() to exercise the code of class
definition.
You should declare private variable in your class definition. You should also write protected methods to set and get the value of private variables.
For Exercise 1 part 2 -
You need to write deposit and withdrawal methods. Should you put this in parent class or child class? Try to answer this question so that you have most
reusability in your class definition.
In this part - you have to learn how polymorphism works.
You will have accounts whose balance might be above or below 10K. By using methods in both classes try to change the interest earned to 10% if balance
is above 10K or 4% if the balance is lower.
Transcribed Image Text:Exercise 1 Part 1 Create a class Savings Account. Use a static class variable to store the annualInterestRate for each of the savers. 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 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 driver program to test the class SavingsAccount. Instantiate two different savings Account objects, saver1 and saver2, with balances of $2000.00 and $3000.00, respectively. Set annualInterestRate to 4%, then calculate the monthly interest and print the new balances for each of the savers. Then set the annualInterestRate to 5% and calculate the next months interest and print the new balances for each of the savers. Part 2 Write another class SpecialSavings that extends SavingsAccount to pay interest of 10% on accounts that have balances that exceed 10K. Also provided methods to deposit and take money out of savings account. Write a driver program to test the class SpecialSavings. Instantiate two different savingsAccount objects, saver1 and saver2, with balances of $2000.00 and $3000.00, respectively. Make a few deposits and withdrawals and show balance and interest earned for each account. Some Tips for helping you with Lab 4: For Lab 4 part 1 - Pl. follow the instructions in the assignment and write the class definition. A driver program is the code you would write in main() to exercise the code of class definition. You should declare private variable in your class definition. You should also write protected methods to set and get the value of private variables. For Exercise 1 part 2 - You need to write deposit and withdrawal methods. Should you put this in parent class or child class? Try to answer this question so that you have most reusability in your class definition. In this part - you have to learn how polymorphism works. You will have accounts whose balance might be above or below 10K. By using methods in both classes try to change the interest earned to 10% if balance is above 10K or 4% if the balance is lower.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Unreferenced Objects
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education