Question

In: Computer Science

Write a Python Version 3 program that will ask you the loan amount and the interest...

Write a Python Version 3 program that will ask you the loan amount and the interest rate.

Then the program will tell you - The monthly payment, How many months it will take you to pay off the loan, The total amount of interest paid over the life of the loan. Program should also indicate the final payment as in many cases the final payment at the end of the loan would not be exactly the normal monthly payment and also the total paid (initial loan plus the interest). You do not need to output the monthly interest paid and the remaining debt. Your output should look like the following…(it may differ, if you use GUIs).

Solutions

Expert Solution

Program screenshots:

Sample Output:

Code to Copy:

# kindly use python 3

# kindly indent the code as given in above screenshot

# prompt the user to enter the details.

prin = float(input("Enter the loan amount :"))

r = float(input("Enter the interest rate :"))

# assign value.

initial_prin=prin

# initialize variable

emi = prin*(5/100)

month = 0

t_interest = 0

# start the while loop

while(True):

   # check the condition.

   if(prin>0):

       # calculate interest

       interest = prin*(1.5/100.0)

       # add interest

       t_interest += interest

       # calculate decreased amount

       dec = emi - interest

       prin = prin - dec

       # update month

       month += 1

   else:

       break;

# display results

print()

print("Loan amount : $",initial_prin)

print("Interest rate : ",r)

print("Monthly payment : $",round(emi,2))

print("Final payment : $",round(prin+dec,2))

print("Life of loan (Months): ",month)

print("Total Interest paid : $",round(t_interest,2))

print("Total paid at the end of loan: $",round(initial_prin+t_interest,2))


Related Solutions

In python. Projectile motion: Write a python program that will ask the user for      an...
In python. Projectile motion: Write a python program that will ask the user for      an initial height y0, initial velocity v, launch angle theta, and mass m.      Create two functions, one that will calculate max height      of the projectile, and one that will calculate the range. Ask the     user which one he/she would like to calculate, then present them with the answer. (use kg, m and m/s)
Calculating Delivery Cost Program in Python write a program in Python that will ask a user...
Calculating Delivery Cost Program in Python write a program in Python that will ask a user to enter the purchase total, the number of the items that need to be delivered and delivery day. Then the system displays the cost of delivery along with the total cost. Purchase total > $150 Yes Number of the items (N) N<=5 N>=6 Delivery day Same Day Next Day Same Day Next Day Delivery charges ($) 8 N * 1.50 N * 2.50 N...
write a python program to do the following: ask a student for 3 coefficients a b...
write a python program to do the following: ask a student for 3 coefficients a b c using the high_school_quizz to display the solutions of a quadratic problem. after, ask the student if he would like another quadratic equation solved If the student answers anything but yes, the program terminates by displaying a good bye message if the student answers yes (any form of yes should be acceptable) , the student is asked for the coefficient again and the resulting...
Write a program that will ask the user to enter the amount of a purchase. The...
Write a program that will ask the user to enter the amount of a purchase. The program should then compute the state and county sales tax. Assume the state sales tax is 5 percent and the county sales tax is 2.5 percent. The program should display the amount of the purchase, the state sales tax, the county sales tax, the total sales tax, and the total of the sale (which is the sum of the amount of purchase plus the...
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.
Write a Python program that has a loop to continuously ask the user for a number,...
Write a Python program that has a loop to continuously ask the user for a number, terminating the loop when the number entered is -1. Inside the loop, 1.) display one asterisk(*) if the number is 1, 2.) two asterisk(**) if the number is 2 and 3.) "OTHER" if the number is any other number.
Write a modified version of the program below. In this version, you will dynamically allocate memory...
Write a modified version of the program below. In this version, you will dynamically allocate memory for the new C-string and old C-string, using the new keyword. Your program should ask the user for the size of the C-string to be entered, and ask the user for the C-string, then use new to create the two pointers (C-strings).   Then, call Reverse, as before. Don’t forget to use delete at the end of your program to free the memory! #include <iostream>...
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 C# program to ask the user for an undetermined amount ofnumbers (until 0...
Write a C# program to ask the user for an undetermined amount of numbers (until 0 is entered) and display their sum.
Write a program to ask the user to en ter the total amount spent at best...
Write a program to ask the user to en ter the total amount spent at best buy before taxes. Assuming the sales tax applied is 5.7%, display the total amount after taxes and the amount added by the sales tax. Be sure to document your program (add comments) . C++ program
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT