Question
The monthly payments for a given loan are divided into amounts that apply to the principal and to the interest. For example: if you make
The monthly payments for a given loan are divided into amounts that apply to the principal and to the interest. For example: if you make a monthly payment of $500, only a portion of the $500 goes to the principal and the remainder is the interest payment.
? monthly interest = monthly interest rate x balance of principal
? balance of principal = monthly payment - monthly interest
? monthly payment = (monthly interest rate x balance of principal) / (1 - (1 + monthly interest rate)^-months)
Write function payments(amount, rate, months) that takes the loan amount (principal), annual interest rate (convert to monthly interest rate in the function), and loan period (in number of months) as arguments. Output (print) a summary of the loan that includes: the loan amount, total interest paid, and total paid. Calculate and write to the file payments.csv for each month, the payment number, monthly payment, interest, principal, remaining balance after the payment, and the total interest paid. (Do not import csv). For example: a loan payment schedule for a 15-year (180 months) loan of $150,000 with a 5.5% annual interest rate (.004583 monthly interest rate) is:
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