Question: PROBLEM III Consider an annuity that pays a fixed amount of C every time period for n periods. If the discount rate is r, the

PROBLEM III Consider an annuity that pays a fixed amount of C every time period for n periods. If the discount rate is r, the PV of this annuity is: PV = C/(1 + r) + C/(1 + r)? + C/(1 + r)3 + ... C/(1 + r)" (a) Write a function to compute the PV of an annuity. You must use recursion in this function. Name the function AnnuityPV and use it to compute the PV of an annuity that pays $1,000 at the end of each year for the next 7 years. The discount rate is 8% per year. (b) Now rewrite the function but you must use Do While in the function. Name this function AnnuityPV2 and use it to compute the PV of an annuity that pays $1,000 at the end of each year for the next 7 years. The discount rate is 8% per year. PROBLEM III Consider an annuity that pays a fixed amount of C every time period for n periods. If the discount rate is r, the PV of this annuity is: PV = C/(1 + r) + C/(1 + r)? + C/(1 + r)3 + ... C/(1 + r)" (a) Write a function to compute the PV of an annuity. You must use recursion in this function. Name the function AnnuityPV and use it to compute the PV of an annuity that pays $1,000 at the end of each year for the next 7 years. The discount rate is 8% per year. (b) Now rewrite the function but you must use Do While in the function. Name this function AnnuityPV2 and use it to compute the PV of an annuity that pays $1,000 at the end of each year for the next 7 years. The discount rate is 8% per year
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
