Question
Python 3.6 Write a program that calculates the monthly payment of a car loan after the user gives the amount of the loan, the interest
Python 3.6
Write a program that calculates the monthly payment of a car loan after the user gives the amount of the loan, the interest rate, and the number of years as shown below:
Working formula:
Payment = Amount * I /(1 (1 + I)-months)
Where I = rate/1200
Sample Solution 1:
from tkinter import *
def calculate():
p = Get Loan Amount
r = Get Interest Rate
n = Get number of years
payment = Calculate payment
display payment
window = Tk()
window.title("Car Loan")
lblPrincipal = create Label as Amount of loan
lblPrincipal.grid for the amount
lblInterestRate = Label for Rate
lblInterestRate.grid for rate
lblNumberOfYears = Label for years
lblNumberOfYears.grid for years
lblMonthlyPayment = Label for monthly payment
lblMonthlyPayment.grid for payment
Declare string variables for amount, rate, etc.
Get all the values and use button to calculate the payment and display.
window.mainloop()
Rewrite solution of this problem using class (Object oriented style).
Car Loan Amount of loan: 16800 Interest rate (as %): 1.9 Number of years: Calculate Monthly Payment Monthly payment: $293.73Step 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