Create a SavingsAccount class. Use a static data member's annual interest rate to store the annual interest
Fantastic news! We've Found the answer you've been seeking!
Question:
- Create a SavingsAccount class. Use a static data member's annual interest rate to store the annual interest rate for each of the savers. Each member of the class contains a private data member savings balance indicating the amount the saver currently has on deposit. Provide member function calculate the monthly interest that calculates the monthly interest by multiplying the savings balance by the annual interest rate divided by 12; this interest should be added to the savings balance. Provide a static member function to modify the interest rate that sets the static annual interest rate to a new value.
- Write a driver program to test class SavingsAccount. Instantiate two different objects of class SavingsAccount, saver1 and saver2, with balances of $2000.00 and $3000.00, respectively. Set the annual interest rate to 3 percent. Then calculate the monthly interest and print the new balances for each of the savers. Then set the annual interest rate to 4 percent, calculate the next month’s interest and print the new balances for each of the savers.
Related Book For
Business Statistics a decision making approach
ISBN: 978-0133021844
9th edition
Authors: David F. Groebner, Patrick W. Shannon, Phillip C. Fry
Posted Date: