Oct-15-2018, 07:38 PM
Hey guys I'm currently in an Intro. to Python course and was hoping to get some help with this assignment I'm working on. So, this is the question:
(Financial application: compare loans with various interest rates) Write a program that lets the user enter the loan amount and loan period in number of years and displays the monthly and total payments for each interest rate starting from 5% to 8%, with an increment of 1/8. Here is a sample run:
This is what it should look like when it displays:
Loan Amount: 10000
Number of Years: 5
Interest Rate Monthly Payment Total Payment
5.000% 188.71 11322.74
5.125% 189.28 11357.13
5.250% 189.85 11391.59
...
7.875% 202.17 12129.97
8.000% 202.76 12165.83
^The numbers above should line up with the columns stated above them as well ^
I am just completely lost with loops and how to even set up the problem, but this is the code I have so far:
(Financial application: compare loans with various interest rates) Write a program that lets the user enter the loan amount and loan period in number of years and displays the monthly and total payments for each interest rate starting from 5% to 8%, with an increment of 1/8. Here is a sample run:
This is what it should look like when it displays:
Loan Amount: 10000
Number of Years: 5
Interest Rate Monthly Payment Total Payment
5.000% 188.71 11322.74
5.125% 189.28 11357.13
5.250% 189.85 11391.59
...
7.875% 202.17 12129.97
8.000% 202.76 12165.83
^The numbers above should line up with the columns stated above them as well ^
I am just completely lost with loops and how to even set up the problem, but this is the code I have so far:
loanValue = eval(input("Loan Amount: ")) loanYears = eval(input("Number of Years: ")) print("Interest Rate Monthly Payment Total Payment")