Guest User

Untitled

a guest
Jan 18th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. (1) (10 pts) Define a Deposit class. This class has two properties: amount of deposit (p)
  2. and annual interest rate (r). A constructor is needed for instantiation and initialization.
  3. The Deposit class assumes that the amount of interest is paid to the depositor at the
  4. end of each month. The class has a function that calculates the balance amount (A)
  5. after n years using the following formula:
  6. A = p * (1 + n*r)
  7. The function takes three input values (p, r, n) and returns A.
  8. (2) (10 pts) Define a CompoundInterestDeposit class that is a sub-class of the Deposit
  9. class. This class assumes that the amount of deposit rises because the interest is
  10. added to the deposit at the end of each year. This class has a overloaded function
  11. that calculates the balance amount (A) after
Add Comment
Please, Sign In to add comment