Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

[ 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

image text in transcribed
image text in transcribed
image text in transcribed
\[ \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

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

Students also viewed these Databases questions

Question

3. Outline the four major approaches to informative speeches

Answered: 1 week ago

Question

4. Employ strategies to make your audience hungry for information

Answered: 1 week ago