a guest Jan 18th, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- (1) (10 pts) Define a Deposit class. This class has two properties: amount of deposit (p)
- and annual interest rate (r). A constructor is needed for instantiation and initialization.
- The Deposit class assumes that the amount of interest is paid to the depositor at the
- end of each month. The class has a function that calculates the balance amount (A)
- after n years using the following formula:
- A = p * (1 + n*r)
- The function takes three input values (p, r, n) and returns A.
- (2) (10 pts) Define a CompoundInterestDeposit class that is a sub-class of the Deposit
- class. This class assumes that the amount of deposit rises because the interest is
- added to the deposit at the end of each year. This class has a overloaded function
- that calculates the balance amount (A) after
RAW Paste Data