Answered step by step
Verified Expert Solution
Question
1 Approved Answer
( 8 points ) The monthly payment M of a loan of amount P for N years and an annual interest rate r ( in
points The monthly payment of a loan of amount for years and an annual interest
rate in can be calculated by the formula:
Write a MATLAB userdefined function named amort that calculates the monthly
payment of a loan. The input arguments of the function are the loan amountthe
annual interest rate in percent and the length of the loan in years You can assume
that all the input arguments are singlevalued.
Write a MATLAB script file that
a prompts the user to enter a value for the loan amount, a value for the annual interest
rate in percent, and a value for the length of the loan in years
b calls the amort function to calculate the monthly payment
c prints the calculated monthly payment on the command window as follows:
The monthly payment is $
where is the calculated monthly payment amount with two digits after the decimal point.
For example, if the user enters as the loan amount, as the interest rate in
percent and as the length of the loan in years you program should output the
following to the command window:
The monthly payment is $
What to submit for this question: Please submit a plain text file named aqtxt that
contains the contents of both the function file and the script file.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started