Click here to Skip to main content
13,357,973 members (56,272 online)
Rate this:
Please Sign up or sign in to vote.
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 21-Sep-12 5:34am
Updated 21-Sep-12 5:59am
Wes Aday 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! :-)
Sergey Alexandrovich Kryukov 21-Sep-12 11:34am
And what, do you thing CCheckingAccount would be a different class? Then thing again... :-)
Marcus Kramer 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

Rate this: bad
Please Sign up or sign in to vote.

Solution 2

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!

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.180111.1 | Last Updated 21 Sep 2012
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100