Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

image text in transcribed

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.73

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 33rd International Conference Dexa 2022 Vienna Austria August 22 24 2022 Proceedings Part 1 Lncs 13426

Authors: Christine Strauss ,Alfredo Cuzzocrea ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

3031124227, 978-3031124228

More Books

Students also viewed these Databases questions

Question

=+what information would you need about the compact disc industry?

Answered: 1 week ago