Thread: Class Problem
View Single Post
Old 07-25-2005, 02:25 PM   #1 (permalink)
logic321
Registered User
 
Join Date: Jul 2005
Posts: 6
logic321 is on a distinguished road
Class Problem

Hi All,

This is my assignment. You were a very big help to me before in understanding concept, and since I am in the beginning stages here, I was wondering if you could offer me some tips on where to begin, or even a sample program. Thanks.

Create a SavingsAccount class. Use a static data member to contain the annualInterestRate for each of the savers. Each member of the class contains a private data member savingsBalance indicating the amount the saver currently has on deposit. Provide a calculateMonthlyInterest member function that calculates the monthly interest by multiplying the balance by annualInterestRate divided by 12; this interest should be added to savingsBalance. Provide a static member function modifyInterestRate that sets the static annualInterestRate to a new value. Write a driver program to test class SavingsAccount. Instantiate two different savingsAccount objects, saver1 and saver2 with balances of $2000.00 and $3000.00, respectively. Set annualInterestRate to 3%. Then calculate the monthly interest and print the new balances for each of the savers. Then set the annualInterestRate to 4%, and calculate the next month's interest and print the new balances for each of the savers.
logic321 is offline   Reply With Quote