Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Here is a formula for computing monthly payments for a loan (for example: a car

ID: 3823926 • Letter: H

Question

Here is a formula for computing monthly payments for a loan (for example: a car loan):

Rate*(1 Rate)N Payment ((1Rate)N 1) *L

Where:

L: Loan Amount

Rate: Monthly Interest Rate as a fraction (ex: 0.01 for 1%)

N: Number of Payments

Payment: is the monthly payment

Write a Python module (loan.py) that assigns values to Loan Amount, Monthly Interest Rate and Number of payments, using the above formula, computes the monthly payment.

For example: if Loan amount is $10000, Monthly Interest Rate is 0.01 (or 12% annual interest rate), the number of payments is 36, Monthly payment should be $332.14.Verify that your program works correctly by using this data as input.

Attach loan.py when submitting this quick test.

here is what I have wrote

def main ():
print ("This program takes Loan amount, monthly interest Rate and number of payments,"
" and tells the user the monthly payment")
arp = eval (input ("Please enter monthly interest rate, Number of payments, Rate loan amount"))


main()

Explanation / Answer

def main ():
print ("This program takes Loan amount, monthly interest Rate and number of payments,"
" and tells the user the monthly payment")
loan_amount = float(input("Enter loan amount: "))
rate = float(input("Enter monthly interest rate: "))
n = int(input("Enter number of payments: "))

monthly_payment = loan_amount*((1+rate)**n)*rate/((1+rate)**n -1)
print("Monthly payment is: $%.2f" % (monthly_payment))

main()

Code link: https://goo.gl/hLFws0

Sample run

This program takes Loan amount, monthly interest Rate and number of payments, and tells the user the monthly payment
Enter loan amount: 10000
Enter monthly interest rate: 0.01
Enter number of payments: 36
Monthly payment is: $332.14

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote