Question: help me write code Q4 (10 pts) The balance B of a savings account after t years when a principal P is invested at an
Q4 (10 pts) The balance B of a savings account after t years when a principal P is invested at an annual interest rate r (in decimal) and the interest is compounded n times a year is given by: B=P(1+nr)nt If the interest is compounded yearly, the balatice is given by: B=P(1+r)t Suppose $8,500 is invested for 12 years in one account for which the interest is compounded yearly. In addition, $6,000 is invested in a second account in which the interest is compounded quarterly. In both accounts the interest rate is 6.25%. Use MATLAB by writing a custom function, named getYear, to determine how many years it would take for the balance in the second account to be the same as the balance of the first account after 12 years. Hint: Use frpintf for your output. Your output should look like this (the obtained year should be display by two decimal places). It would take ??? years for 6000 dollars to reach 8500 dollars
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
