Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more:
Create class CSavingsAccount.

Use a Shared class variable to store the mAnnualInterestRate for all account holders.
Each object of the class contains a Private instance variable mSavingsBalance indicating the amount the saver currently has on deposit. Provide method CalculateMonthlyInterest to calculate the monthly interest by multiplying the mSavingsBalance by AnnualInterestRate divided by 12; this interest should be added to mSavingsBalance.

Provide a Shared method ModifyInterestRate that sets the mAnnualInterestRate to a new value. Write a program to test class CSavingsAccount. Instantiate two CSavingsAccount objects, saver1 and saver2, with balances of $2000.00 and $3000.00, respectively.

Set CAnnualInterestRate to 4%, then calculate the monthly interest and print the new balances for each of the savers. Then set the mAnnualInterestRate to 5% and calculate the next month’s interest and print the new balances for each of the savers.

Write a program demonstrating that a method with its own Try block does not have to Catch every possible exception that occurs within the Try block. Some exceptions can slip through to, and be handled in, other scopes.
Posted
Updated 21-Sep-12 4:59am
v3
Comments
[no name] 21-Sep-12 10:39am    
Yes and? Your other classmates were here a couple of days ago wanting someone to do their homework for them too.
Sergey Alexandrovich Kryukov 21-Sep-12 11:35am    
Great! :-)
--SA
Sergey Alexandrovich Kryukov 21-Sep-12 11:34am    
And what, do you thing CCheckingAccount would be a different class? Then thing again... :-)
--SA
fjdiewornncalwe 21-Sep-12 11:39am    
We don't do homework for you. What would you learn if we did. The point to your education is that you learn something that will make you useful in the real, working world.
See this for a great explanation why. (Compliments of JSOP)

1 solution

We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

Try it yourself, you may find it is not as difficult as you think!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900