Question

In: Computer Science

Write a program in Python to determine how many months it will take to pay off...

Write a program in Python to determine how many months it will take to pay off a $10,000 car loan with 4% interest. Choose your own monthly payment.

Solutions

Expert Solution

The following code is well commented and self explanatory. Please find screenshots for indentation and output.

Assuming monthly payment = 1000.

---------Code below----------------------

loanamount = 10000
interestrate = 4
monthlypayment = 1000

monthlyinterest = round((loanamount * interestrate/100/12),2)
monthlybalance = float(loanamount - (monthlypayment - monthlyinterest))

print ("Month", " ", "Payment", " ", "Interest", " ", "Balance")
print ("-----", " ", "-------", " ", "--------", " ", "-------")

month = 0

while monthlybalance > 0 :
   month += 1
   print (month, " ", monthlypayment, " ", monthlyinterest, " ", monthlybalance)
   monthlyinterest = round((monthlybalance * interestrate/100/12),2)
   monthlybalance = float(monthlybalance - (monthlypayment - monthlyinterest))

print ("Total months taken will be",month,"months.")

Hope this helps. Do upvote if you feel satisfied.

Thank you :)


Related Solutions

Python Program Write a program that will ask a user on how many input colored balls...
Python Program Write a program that will ask a user on how many input colored balls of the following codes: R-red, B-blue, W-white, G-green and O-orange -will he or she would like to enter in the program and print the total number of Red balls were encountered. Assume an uppercase and lower case letter will be accepted.
For Python: In this assignment you are asked to write a Python program to determine the...
For Python: In this assignment you are asked to write a Python program to determine the Academic Standing of a studentbased on their CGPA. The program should do the following: Prompt the user to enter his name. Prompt the user to enter his major. Prompt the user to enter grades for 3 subjects (A, B, C, D, F). Calculate the CGPA of the student. To calculate CGPA use the formula: CGPA = (quality points * credit hours) / credit hours...
Write a python program that will take in the number of call minutes used. Your program...
Write a python program that will take in the number of call minutes used. Your program will calculate the amount of charge for the first 200 minutes with a rate of $0.25; the remaining minutes with a rate of $0.35. The tax amount is calculated as 13% on top of the total. The customer could have a credit that also has to be considered in the calculation process. Finally, the program displays all this information. Below is a sample run:...
PROBLEM: c++ code You are to write a program to tell you how many months it...
PROBLEM: c++ code You are to write a program to tell you how many months it will take to pay off a loan, as well as the total amount of interest paid over the life of the loan. You have just purchased a stereo system that costs $1000 on the following credit plan: No down payment, an interest rate of 18% per year (and hence 1.5% per month), and monthly payments of $50. The monthly payment of $50 is used...
How long will it take to pay off a loan of ​$54,000 at an annual rate...
How long will it take to pay off a loan of ​$54,000 at an annual rate of 11 percent compounded monthly if you make monthly payments of ​$750​? Use five decimal places for the monthly percentage rate in your calculations.
How long will it take to pay off a loan of ​$52,000 at an annual rate...
How long will it take to pay off a loan of ​$52,000 at an annual rate of 12 percent compounded monthly if you make monthly payments of ​$750​? Use five decimal places for the monthly percentage rate in your calculations. The number of years it takes to pay off the loan is ____ years. (Round to one decimal​ place.)
How long will it take to pay off a loan of $45,000 at an annual rate...
How long will it take to pay off a loan of $45,000 at an annual rate of 8 percent compounded monthly if you make monthly payments of $600? Use five decimal places for the monthly percentage rate in your calculations.
Write a Python program that reads an integer and prints how many digits the number has,...
Write a Python program that reads an integer and prints how many digits the number has, by checking whether the number is ≥10,≥100,≥1000, and so on (up to 1,000,000). Your program should also identify if a number is negative.
1. Write Python program that use a while loop to determine how long it takes for...
1. Write Python program that use a while loop to determine how long it takes for an investment to double at a given interest rate. The input will be an annualized interest rate, and the output is the number of years it takes an investment to double. Note: The amount of initial investment can be any positive value, you can use $1. 2. Write a function def DoubleInvest(initialInvest) to perform the same functionalities as question1. Make sure to include you...
Python: write a program to first ask how many tests a student has taken, then collect...
Python: write a program to first ask how many tests a student has taken, then collect all the test scores and calculate the average score. After displaying the average score, the program also assigns a letter grade to the student according to the following grading scale: Score Grade >=90 A 80-89 B 70-79 C 60-69 D <60 F This program should perform input validation for test scores and only accept a positive input value as a score (ask the user...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT