5. Car Loan If A dollars are borrowed at r% interest compounded monthly to purch
ID: 2248502 • Letter: 5
Question
5. Car Loan If A dollars are borrowed at r% interest compounded monthly to purchase a car with monthly payments for n years, then the monthly payment is given by the formula monthly payment 1-(1 + i)- ere i = m write a program that calculates the monthly payment after the user gives amount of the loan, interest rate, and number of years. Figure 3.65 shows that monthly the payments of $234.23 are required to pay off a 5-year loan of $ 12,000 at 6.4% interest. Car Loan Amount of loan 12000 Interest rate (%) 4 Number of years Calculate Monthly Payment Monthly peyment $234 23 RE 3.65 Possible outcome of Programming Project 5.Explanation / Answer
MATLAB:-
clc
clear
% Loan amount taken
A = input('Enter Loan amount = $ ');
% Interest on Loan amount
r = input('Interest rate per year % = ');
% Repayment period
n = input('Enter no.of Years to repay Loan = ');
% Monthly interest rate
i = r/1200;
% Montly repayment Amount
P = (i*A)/(1 - (1+i)^(-12*n));
sprintf('Monthly Loan repayment Amount =$ %0.2f',P)
OUTPUT:-
Enter Loan amount = $ 12000
Interest rate per year % = 6.4
Enter no.of Years to repay Loan = 5
ans =
Monthly Loan repayment Amount =$ 234.23
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.