At the conclusion of this micro assignment, participants should be able to:
matplotlib
Before starting this micro assignment, participants should be able to:
For this micro assignment you are going to derive a loan payment schedule numerically and graphically using Jupyter Notebook.
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.
For calculating monthly payments, use the following formula:
$$mpymt = \frac{r(P)}{1 - (1 + r)^{-n}}$$Where $r$ is the monthly interest rate, $P$ is the cost of the car, and $n$ is the number of monthly payments. You can figure out $r$ 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 payment calculator.
For calculating the remaining balance on a loan, use the following formula:
$$Balance = P(1 + r)^{n} - mpymt \frac{(1 + r)^{n} - 1}{r}$$Note: you can also compute this iteratively. For each month, compute the interest ($i = r * P_{remaining}$) and subtract the interest from the monthly payment to get the monthly principal paid ($P_{monthlypaid} = mpymt - i$). Subtract the accumulated monthly principal paid from the original principal $P$ to find the remaining balance.
Open a new Jupyter Notebook and include the following items in Markdown and code:
matplotlib
plot that looks like the loan payment graph on http://www.calcamo.net/loancalculator/paymentschedule/graph.php5:All values should be rounded to 2 decimal places and displayed with a $.
The following example is for a loan for a BMW i8:
(Image from [https://c2.staticflickr.com/8/7152/13650180553_2febc742d3_b.jpg](https://c2.staticflickr.com/8/7152/13650180553_2febc742d3_b.jpg))BMW has a loan estimator on their website. Try it for the i8 to check your work!
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 loan: 2.0
Please enter the number of years for the loan: 5
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
As in the example plot above, make the units for the x axis be years and add $ signs to the y tick labels.
<your last name>_ma2.zip
by the due date and time.This assignment is worth 50 points + 2 points bonus. Your assignment will be evaluated based on a successful compilation and adherence to the program requirements. We will grade according to the following criteria: