Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Prerequisites Before starting this micro assignment, participants should be able to: Write Python code Overview and Requirements For this micro assignment you are going to

image text in transcribed

image text in transcribedimage text in transcribedimage text in transcribed

Prerequisites Before starting this micro assignment, participants should be able to: Write Python code Overview and Requirements For this micro assignment you are going to derive a loan payment schedule numerically and graphically using Jupiter Notebook. Background Information: Amortized Loans From Wikipedia: An amortized loan is a loan where the principal of the loan is paid down over the life a loan (that is, amortized) according to an amortization schedule. Each payment to the lender will consist of a portion of interest and a portion of principal. Mortgage loans are typically amortizing loans. The calculations for an amortizing loan are those of an annuity using the time value of money formulas, and can be done using an amortization calculator. Monthly Payment Calculation For calculating monthly payments, use the following formula: mpymt=r(P)1-(1+r)-nmpymt=r(P)1-(1+r)-n Where rr is the monthly interest rate, PP is the cost of the car, and nn is the number of monthly payments. You can figure out rr by converting the interest rate the user enters to a decimal (divide by 100) and then dividing by 12 (12 months in a year). You can check your program output by comparing the computed monthly payment to an online pavment calculator. Remaining Loan Balance For calculating the remaining balance on a loan, use the following formula: Balance=P(1+r)n-mpymt(1+r)n-1rBalance=P(1+r)n-mpymt(1+r)n-1r Note: you can also compute this iteratively. For each month, compute the interest (i=r* PremainingizrPremaining) and subtract the interest from the monthly payment to get the monthly principal paid (Pmonthlypaid=mpymt-iPmonthlypaid=mrymt-1). Subtract the accumulated monthly principal paid from the original principal PP to find the remaining balance. Program Details Open a new Jupiter Notebook and include the following items in Markdown and code: 1. A description of amortized loans 2. Relevant formulas using Latex 3. Code to prompt the user for: A. What the loan is for B. Principal loan amount C. Yearly interest rate of the loan as a percent D. Number of years of the loan 4. Code to display the monthly payment, total amount paid in interest, and total amount paid for the loan. 5. Code to display the loan repayment schedule. 6. An inline matplotlib plot that looks like the loan payment graph on ...... Graph 250 Balance Principal Interest 200 150 amount in thousands dollars 100 50 2 3 www.calcamo.net 4 duration in years Include balance, principal paid, and interest paid curves Shade the area under the principal paid and interest paid curves appropriately (see fadele between() Include a legend Include grid lines Include a title stating what the loan graph is for (from the user) Your X-axis can be in months or in years (see Bonus) All values should be rounded to 2 decimal places and displayed with a $. Example The following example is for a loan for a BMW BMW has a loan estimator on their website. Try it for the i8 to check your work! User Interaction What is this loan for? BMW i8 Please enter the principal amount for the loan: 141695.00 Please enter the yearly interest rate (as a percent) for the lo an: 25.0 Please enter the number of years for the loan: 5 Calculation Output Monthly payment: $4158.94 Total loan amount: $249536.15 Total interest paid: $107841.15 Month Start Balance Principal Interest Payment 1 $141695.00 $1206.96 $2951.98 $4158.94 2 $140488.04 $1232.10 $2926.83 $4158.94 60 $ 4074.06 $ 4074.06 $ 84.88 $4158.94 61 $ 0.00 $ 0.00 $ 0.00 $ 0.00 L Loan Payment Graph $250000 BMW i8 Balance Remaining Interest Paid Principal Paid $200000 $150000 $100000 $50000 $0 1 2 3 5 Years Bonus (2 pts) As in the example plot above, make the units for the x axis be years and add $ signs to the y tick labels. Prerequisites Before starting this micro assignment, participants should be able to: Write Python code Overview and Requirements For this micro assignment you are going to derive a loan payment schedule numerically and graphically using Jupiter Notebook. Background Information: Amortized Loans From Wikipedia: An amortized loan is a loan where the principal of the loan is paid down over the life a loan (that is, amortized) according to an amortization schedule. Each payment to the lender will consist of a portion of interest and a portion of principal. Mortgage loans are typically amortizing loans. The calculations for an amortizing loan are those of an annuity using the time value of money formulas, and can be done using an amortization calculator. Monthly Payment Calculation For calculating monthly payments, use the following formula: mpymt=r(P)1-(1+r)-nmpymt=r(P)1-(1+r)-n Where rr is the monthly interest rate, PP is the cost of the car, and nn is the number of monthly payments. You can figure out rr by converting the interest rate the user enters to a decimal (divide by 100) and then dividing by 12 (12 months in a year). You can check your program output by comparing the computed monthly payment to an online pavment calculator. Remaining Loan Balance For calculating the remaining balance on a loan, use the following formula: Balance=P(1+r)n-mpymt(1+r)n-1rBalance=P(1+r)n-mpymt(1+r)n-1r Note: you can also compute this iteratively. For each month, compute the interest (i=r* PremainingizrPremaining) and subtract the interest from the monthly payment to get the monthly principal paid (Pmonthlypaid=mpymt-iPmonthlypaid=mrymt-1). Subtract the accumulated monthly principal paid from the original principal PP to find the remaining balance. Program Details Open a new Jupiter Notebook and include the following items in Markdown and code: 1. A description of amortized loans 2. Relevant formulas using Latex 3. Code to prompt the user for: A. What the loan is for B. Principal loan amount C. Yearly interest rate of the loan as a percent D. Number of years of the loan 4. Code to display the monthly payment, total amount paid in interest, and total amount paid for the loan. 5. Code to display the loan repayment schedule. 6. An inline matplotlib plot that looks like the loan payment graph on ...... Graph 250 Balance Principal Interest 200 150 amount in thousands dollars 100 50 2 3 www.calcamo.net 4 duration in years Include balance, principal paid, and interest paid curves Shade the area under the principal paid and interest paid curves appropriately (see fadele between() Include a legend Include grid lines Include a title stating what the loan graph is for (from the user) Your X-axis can be in months or in years (see Bonus) All values should be rounded to 2 decimal places and displayed with a $. Example The following example is for a loan for a BMW BMW has a loan estimator on their website. Try it for the i8 to check your work! User Interaction What is this loan for? BMW i8 Please enter the principal amount for the loan: 141695.00 Please enter the yearly interest rate (as a percent) for the lo an: 25.0 Please enter the number of years for the loan: 5 Calculation Output Monthly payment: $4158.94 Total loan amount: $249536.15 Total interest paid: $107841.15 Month Start Balance Principal Interest Payment 1 $141695.00 $1206.96 $2951.98 $4158.94 2 $140488.04 $1232.10 $2926.83 $4158.94 60 $ 4074.06 $ 4074.06 $ 84.88 $4158.94 61 $ 0.00 $ 0.00 $ 0.00 $ 0.00 L Loan Payment Graph $250000 BMW i8 Balance Remaining Interest Paid Principal Paid $200000 $150000 $100000 $50000 $0 1 2 3 5 Years Bonus (2 pts) As in the example plot above, make the units for the x axis be years and add $ signs to the y tick labels

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