Question

In: Computer Science

In this program you will develop an application that will display an amortization schedule.

Using Anaconda Python, program the following:

Overview

In this program you will develop an application that will display an amortization schedule. The word "amortize" means to "To write off gradually and systematically a given amount of money within a specific number of time periods." It will show, for each month of the loan, how much of your monthly loan payment is being applied towards interest costs, and how much is actually being applied to reduce the outstanding balance (principal) of your loan.

The Problem

Your application should prompt the user to enter a number of amount of the loan, the annual interest rate, and the duration of the loan in months and then calculates the sum total of all payments over the life of the loan, the total interest paid over the life of the loan, and finally the total interest paid as a percentage of the principal (i.e, original loan amount). Your program requires a loop to make calculations for each payment, which means that the loop must run until all payments have been made. You first determine the payment amount, and then for every payment you determine the interest paid, the principal paid, and the principal balance remaining.

To Get You Started

The following tables provide a description of the variables used. Note that the variable names chosen clearly describe the purpose of the variables.

Input Variables:

Variable NamePurpose
loan_amountTotal amount borrowed
interest_rateAnnual interest rate expressed as a percentage
num_paymentsLoan duration expressed in months

Intermediate Calculation Variables:

interest_per_yearDecimal interest per year
interest_per_paymentDecimal interest per payment
factorIntermediate variable
payment_amountAmount of each monthly payment
total_payed_on_loanTotal amount payed on loan
total_interest_paidTotal interest payed on loan
interest_as_percent_loan_amountTotal interest as a percentage of original loan amount

The following variables will need to be calculated within your loop:

monthly_interestThe amount of interest paid in a given month
monthly_principalThe amount of principal paid in a given month
loan_amount (formerly loan_balance)The new amount after the principal has been paid

You will find the following formulas helpful (necessary?):

interest_per_year = interest_rate / 100.0

interest_per_payment = interest_per_year / 12

factor = (1 – ((1 + interest_per_payment) ** (-num_payments))) / interest_per_payment

payment_amount = loan_amount / factor

total_paid_on_loan = payment_amount * num_payments

total_interest_paid = total_paid_on_loan – loan_amount

interest_as_percent_loan_amount = (total_interest_paid / loan_amount) * 100

Within your loop you will need the following formulas:

monthly_interest = interest_per_payment * loan_amount

monthly_principal = payment_amount – monthly_interest

loan_amount = loan_amount – monthly_principal

Output

Your program should display the monthly payment, the total amount paid on the loan, the total interest paid on the loan, and the total interest as a percentage of the original loan amount. Then, for each loan payment, display the month, payment amount, interest paid, principal paid, and the loan balance. Please see sample output on the following pages.

Deliverables

Include a markup cell at the top of your program. Within the markup cell, list your name, course and section, assignment number, and date. Use whitespace effectively to make your code easier to read. Follow the recommended naming conventions for variables.

Solutions

Expert Solution

code:

# Your Name:
# Course:
# Section:
# Assignment number:
# Date:

# amount for which loan is taken
loan_amount = float(input("Enter loan: "))
# Annual interest rate
interest_rate = float(input("Enter annual interest rate: "))
# total number of months for which the loan is taken
num_payments = int(input("Enter loan duration expressed in months: "))
print()

# calculating annual interest rate
interest_per_year = interest_rate / 100
# calculating monthly interest rate
interest_per_payment = interest_per_year / 12

# calculating annual amount paid on loan and total interest paid on loan
factor = (1 - ((1 + interest_per_payment) ** (- num_payments))) / interest_per_payment
payment_amount = loan_amount / factor  # monthly
total_paid_on_loan = payment_amount * num_payments
total_interest_paid = total_paid_on_loan - loan_amount

# calculating total interest as percent of the loan amount
interest_as_percent_loan_amount = (total_interest_paid / loan_amount) * 100

print("Original loan amount taken: %f" % loan_amount)
print("Total amount paid on the loan: %f" % total_paid_on_loan)
print("Total interest paid on the loan: %f" % total_interest_paid)
print("Total interest as a percentage of the original loan amount: %f" % interest_as_percent_loan_amount)
print()

# for loop, it will run number of months time
for i in range(1, num_payments + 1):
    monthly_interest = interest_per_payment * loan_amount
    monthly_principal = payment_amount - monthly_interest
    loan_amount = loan_amount - monthly_principal
    print("Month: %d" % i)
    print("Monthly payment: %f" % (monthly_principal + monthly_interest))
    print("Monthly interest paid: %f" % monthly_interest)
    print("Loan balance: %f" % loan_amount)
    print()

Screenshots:

code:

output:

1)

2)


Related Solutions

Amortization Schedule You will be creating an amortization schedule for a house on the market. To...
Amortization Schedule You will be creating an amortization schedule for a house on the market. To do so, you will need the principal amount, the interest rate, and the amount of years you will borrow the loan. The amount you put as a down payment is up to you, but it can range from a minimum of 3.5% for an FHA loan or 5% for a traditional loan to a maximum of whatever. Traditionally you only need to go as...
Develop an amortization schedule for a 5-year loan of $25,000 at an interest rate of 7.5%,...
Develop an amortization schedule for a 5-year loan of $25,000 at an interest rate of 7.5%, assuming equal annual installments at the end of each year. Use the same format that we used in class. Please show work in Excel
AMORTIZATION SCHEDULE a. Complete an amortization schedule for a $25,000 loan to be repaid in equal...
AMORTIZATION SCHEDULE a. Complete an amortization schedule for a $25,000 loan to be repaid in equal installments at the end of each of the next three years. The interest rate is 8% compounded annually. Round all answers to the nearest cent. Beginning Repayment Ending Year Balance Payment Interest of Principal Balance 1 $ $ $ $ $ 2 3 b. What percentage of the payment represents interest and what percentage represents principal for each of the three years? Round all...
            It is not uncommon to develop the logic of a program as a console application...
            It is not uncommon to develop the logic of a program as a console application (NO GUI) and then graft a GUI on to it later. There are also many reasons for separating the GUI of the program from the rest of the code logic. (This is part of a common design pattern called Model View Controller (MVC) where the GUI represents the View aspect.) For instance, you might have a Web-based or mobile device GUI in addition to...
Amortization schedule Set up an amortization schedule for a $36,000 loan to be repaid in equal...
Amortization schedule Set up an amortization schedule for a $36,000 loan to be repaid in equal installments at the end of each of the next 3 years. The interest rate is 6% compounded annually. Round all answers to the nearest cent. Beginning Remaining Year Balance Payment Balance 1 $   $   $   2 $   $   $   3 $   $   $   What percentage of the payment represents interest and what percentage represents principal for each of the 3 years? Round all answers...
C++ Write a program that outputs an amortization schedule for a given loan. Must be written...
C++ Write a program that outputs an amortization schedule for a given loan. Must be written using user-defined functions must take at least 1 argument Output number of months, payment, interest to pay, principle to pay, and ending balance
The program is to be called CarClub The application will display menu as below 1. load...
The program is to be called CarClub The application will display menu as below 1. load cars 2. display all cars 3. search car 4 count cars older the 30 years 5 exit Please enter your option: Load car menu should read input data from text file name (car.txt) Car class have 4 data members which are. Car make, car model, car year and car price In addition If both car year and price were not provided, year has a...
Amortization Schedules This project requires you to create an amortization schedule for two types of loans,...
Amortization Schedules This project requires you to create an amortization schedule for two types of loans, a fully amortizing constant payment mortgage (CPM) loan and a constant amortizing (CAM) loan. In your report, compare the amortization schedule of the CPM and CAM loans (How are they similar? How are they different? Which would you prefer and why?) Part 1: Monthly Payment Consider a $10,000 loan made at a 12 percent annual (nominal) rate of interest for 3 years. A) Calculate...
Question: What is an amortization schedule?
  Question: What is an amortization schedule? Waht is the use of amortizatio schedule?
An amortization schedule is a common concept within a banking enterprise. Create your own amortization schedule...
An amortization schedule is a common concept within a banking enterprise. Create your own amortization schedule for a $10,000 loan with monthly payments paid over two years. Assume the annual percentage rate (APR) is 4%. Create the amortization schedule within Excel or another spreadsheet application. Use page 184 as a template. Keep in mind that the example on page 184 uses annual payments, while your schedule will use monthly payments. You will need to adjust the number of payment periods...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT