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.

Please help with the following MATLAB program problem. Write a program that

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!