Question: [ text { payment }=frac{r(text { loan_amount })}{1-(1+r)^{-n}} ] where n is the duration of the loan in months, loan_amount is the amount of the

 \[ \text { payment }=\frac{r(\text { loan_amount })}{1-(1+r)^{-n}} \] where n
is the duration of the loan in months, loan_amount is the amount
of the loan in dollars, r is the monthly interest rate as

\[ \text { payment }=\frac{r(\text { loan_amount })}{1-(1+r)^{-n}} \] where n is the duration of the loan in months, loan_amount is the amount of the loan in dollars, r is the monthly interest rate as a decimal (which is the annual interest rate divided by 12 , so if the user enters in 18% as the annual interest rate, then the monthly rate would 1.5%, or 0.015 ), and payment is the monthly payment in dollars. Note that the final payment value is rounded to two decimal places (i.e. rounded to the nearest cent). Just as in the previous section of code, you will need to fix all the syntax, runtime, and logic errors in this code. Here is an example of what the output should look like if Just as in the previous section of code, you will need to fix all the syntax, runtime, and logic errors in this code. Here is an example of what the output should look like if it was working correctly: Enter the loan amount in dollars: 100 Enter the loan duration in months: 10 Enter the \% annual interest rate: 12 Your monthly payment is: 10.56 Be sure to try some other values to make sure that your answer makes sense for a variety of inputs (use the formula and a calculator to determine what the values should be). If you get stuck, come to office hours. You may want to temporarily comment out the cookie recipe section of the program so that you don't have both segments giving you output at the same time, but be sure to uncomment both sections before submitting your assignment. In later assignments we will use user-defined functions to avoid this nuisance. 272829303132amt=float(input("Entertheloanamountindollars:")N=int(input("Entertheloandurationinmonths:"))r=input("Enterthe%annualinterestrate:")/100/12payment=r*amt/1(1+r)(n)print("Yourmonthlypaymentis:"+round(payment,2))

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!