Question: write a mathlab code Jimmy starts an annuity with a principal value of R 1 0 0 0 0 0 0 ( one million Rands
write a mathlab code Jimmy starts an annuity with a principal value of Rone million Rands and plans to withdraw a fixed amount each month, starting one month after opening the annuity account. Jimmy expects to draw Rtwenty thousand Rands from the annuity every month, for years fifteen years Suppose the monthly interest rate is fixed at and that interest is computed each month on the annuity before the withdrawal made. The annuity is overdrawn when its value drops below zero.
Answer the following questions:
Will the value of the annuity drop to zero before the year time span ends?
For how many months will Jimmy be able to withdraw R without overdrawing on the account?
What is the value of the annuity after the last withdrawal of R before the account is overdrawn?
Use the code below to help answer these questions. The function
AnnuityRecursivep w r n
takes as input the principle value p the monthly withdrawal amount w the iterest rate r and the number of months n and returns a vector t of months and a vector a of annuity values such that ai is the value of the anuity at time ti
Note: This task will require several iterations to complete and several iterations to determine the necessary values. The code provided will generate a plot of your simulation values to help you complete the task. You can run your code on the system before submitting your soulution for grading. set constants
pretty print outputs
prettyPrincipal P;
prettyWithdrawl W;
prettyRate R;
prettyMonths N;
Call AnnuityRecursive to construct the t an a vectors
t a AnnuityRecursiveP W R N;
Answer questions below:
Will the value of the annuity drop to zero before the year time span ends?
Yes:
No:
Q
For how many months will Jimmy be able to withdraw R without overdrawing
on the account?
Q
What is the value of the annuity after the last withdrawal of R before
the account is overdrawn?
Q
This is a generic evaluation check. You cannot edit this.
Qt Qa AnnuityRecursive;
Plot the results.
plott aob;
xlabeltime months;
ylabelvalue Rands;
titleRemaining Annuity value over time.;
grid;
define functions
function t a AnnuityRecursivep w r n
end
Use the following functions to pretty print arrays and values
function prettys a
fprintfs: repmatd numela
s a;
end
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
