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

  • 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.

Step by Step Solution

3.35 Rating (155 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Progra... View full answer

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 Programming Questions!