Question

In: Computer Science

The monthly payment for a given loan pays the principal and the interest. The monthly interest...

The monthly payment for a given loan pays the principal and the interest. The monthly interest is computed by multiplying the monthly interest rate and the balance (the remaining principal). The principal paid for the month is therefore the monthly payment minus the monthly interest. Write a pseudocode and a Python program that let the user enter the loan amount, number of years, and interest rate, and then displays the amortization schedule for the loan (payment#, interest, principal, balance, monthly payment). Hint: use pow function (example, pow (2, 3) is 8. Same as 2 **3. ); monthly payment is the same for each month, and is computed before the loop.

Solutions

Expert Solution

Amortization Schedule: An amortization is a complete table of periodic loan payment,showing
the amount of principle and the amount of interest that comprise each payment until the loan is paid off at the end of its term.

Source Code:

loan_amount = int(input("Enter the loan amount:"))
number_of_years = int(input("Enter the number of years"))
interest_rate = float(input("Enter the rate of interest in decimals:"))
r = (interest_rate / 12)/100  # Calculate monthly interest rate

n = number_of_years * 12  # calculate the total number of payments

monthly_payment = loan_amount*r*(pow((1+r),n)) / (pow((1+r),n)-1)   
print("Payment","\t","Interest","\t"," Principle Bal.","\t","Monthly payment")
for i in range(1,n+1):
    interest =(loan_amount*interest_rate/12/100)
    p_dep = monthly_payment - interest
    principle_rem = loan_amount - p_dep
    loan_amount = principle_rem
    print(i,"\t\t\t","%5.2f"%(interest),"\t\t","%5.2f"%(principle_rem),"\t\t\t","%5.2f"%(monthly_payment))

Related Solutions

Loan Amortization Schedule for Investment Interest rate Year Beginning Principal Principal Payment Interest Payment Ending principal...
Loan Amortization Schedule for Investment Interest rate Year Beginning Principal Principal Payment Interest Payment Ending principal Tax Savings 0.07 1 15,000 a. 1,050 b. c. 0.07 2 0.07 3 0.07 4 0.07 5 0.07 Fill in the blanks. Explain how to get the principal and ending principal.
With a conventional amortized mortgage loan, what is TRUE about each monthly principal and interest payment?...
With a conventional amortized mortgage loan, what is TRUE about each monthly principal and interest payment? a. The loan payment will go up each month. b. The portion used to pay interest increases. c. The portion used to pay interest decreases. d. The loan payment will go down each month.
Compute the monthly payment for a $133,440 home loan. The stated interest of the loan is...
Compute the monthly payment for a $133,440 home loan. The stated interest of the loan is 5% with monthly payments. The loan amortization is over 25 years.
Monthly Mortgage Payments The average monthly mortgage payment including principal and interest is 982 in the...
Monthly Mortgage Payments The average monthly mortgage payment including principal and interest is 982 in the United States. If the standard deviation is approximately 180 and the mortgage payments are approximately normally distributed, find the probabilities. Use a TI-83 Plus/TI-84 Plus calculator and round the answers to at least four decimal places. (a) (a)The selected monthly payment is more than $1400 (a)The selected monthly payment is more than 1400 P(Z>1400)= 2) Prison Sentences The average prison sentence for a person...
If the interest rate on the loan is 7%, what is the amount of principal in the second payment?
You borrow $12,000 today. The loan will be repaid in annual payments over 10 years. If the interest rate on the loan is 7%, what is the amount of principal in the second payment?
The average monthly mortgage payment including principal and interest is $982 in the United States. If...
The average monthly mortgage payment including principal and interest is $982 in the United States. If the standard deviation is approximately $180 and the mortgage payments are approximately normally distributed, find the probability that a randomly selected monthly payment is: A. Between $800 and $1150 B. Less than $1,000
A. During the year, a farmer pays $1000 principal and $500 interest on a tractor loan.
A. During the year, a farmer pays $1000 principal and $500 interest on a tractor loan. His annual depreciation expense is $4000. His operating expenses including fuel, oil, and repairs total $500 for the year (ignore fuel tax credits). His marginal tax rate is 25%. What is his after-tax cost of using the tractor for the year?B. If the farmer leased the tractor for the year for $1200, how muchwould his after-tax cost of using the tractor be?
You wish to qualify for a $200,000 mortgage. Your monthly payment (principal and interest) must not...
You wish to qualify for a $200,000 mortgage. Your monthly payment (principal and interest) must not exceed 25% of your monthly income. Your monthly payment plus taxes and homeowner’s insurance must not exceed 28% of your monthly income. Your monthly payment, taxes, insurance, and other debt payments must not exceed 33% of your monthly income. The loan is for 30 years. Interest rates for these loans are 7%. Taxes and insurance are $250 per month and you have a $300...
Find the monthly payment needed to amortize principal and interest for each fixed-rate mortgage for a...
Find the monthly payment needed to amortize principal and interest for each fixed-rate mortgage for a $220,000 at 4.5% interest for 30 years.
Blended payment loans require a loan amortization schedule separating principal and interest. This is required, in...
Blended payment loans require a loan amortization schedule separating principal and interest. This is required, in part, because A) interest only is reflected on the cash flow statement. B) interest and principal needs to be reflected under current and not current liabilities section of the statement of financial positon. C) the interest expense is recorded separately from the reduction of the loan payable. D) none of the above.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT