Question: Please help with the following MATLAB program problem. Write a program that continuously asks the user if they want to compute total mortgage interest (0),
Please help with the following MATLAB program problem.

Write a program that continuously asks the user if they want to compute total mortgage interest (0), total mortgage cost (1), or stop (2). If the user picks 0 or 1 then the program should ask the user for the interest rate to use, then print out the answer for three time periods: 15, 20 and 30 years. Your print statement should include the time period and the interest rate as well as the calculated value. Use a for loop to do the three time periods. Assume an initial loan amount of $100,000 and monthly payments. Equations: Let I be the interest rate, P be the principle ($100,000) and n be the number of monthly payments. Then the monthly payment amount is: M = P(I(1 + I)^n)/(1 + I)^n - 1 The total mortgage cost T is the number of payments n times the monthly payment (Mn). The total (compounded) mortgage interest is the total cost of the mortgage minus the principle: T-P. Test your algorithm with the following values: Choice Interest Rate 0 0.5 1 0.5 0 3.0 1 3.0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
