Description of this paper

savingaccount

Description

solution


Question

(Savings Account Class) Create class SavingAccount. Use a Shared;Customer Question;(Savings Account Class) Create class SavingAccount. Use a Shared class variable to store the annualInterestRate for all SavingsAccounts. Each object of the class contains a Private instance variable savingsBalance indicating the amount the saver currently has on deposit. Provide the CalculateMonthlyInterest method to calculate the monthly interest by multiplying the savingBalance by the annualInterestRate divided by 12, this interest should be added to savingsBalance and returned to the method caller. Provide a shared method ModifyInterestRate that sets the annualInterestRate to a new value. Write an application to test class SavingsAccount. Instantiate two SavingsAccount objects, saver1 and saver2, with balances of $2000.00 and $3000.00, respectively. Set annualInterestRate to 4% then calculate the monthly interest and display the amount of interest earned and the new balances for each of the savers. Then set the annualInterestRate to 5% and calculate the next month's interest and display the amounts of interest earned and the new balances for each of the savers.

 

Paper#69491 | Written in 18-Jul-2015

Price : $27
SiteLock