Question
Code in python python simulation and modelling Consider a debt of $10,000. Your program should take as input a monthly payment amount, and an interest
Code in python
python simulation and modelling
Consider a debt of $10,000. Your program should take as input a monthly payment amount, and an interest rate. The interest rate should be accepted as a decimal, not a percentage. Your tool should then calculate the outstanding debt each month, for a time frame of 60 months. For each month, the outstanding debt at the end of the month is the amount owing at the beginning of the month (i.e., the end of the previous month), less the amount of the monthly payment, plus the amount of the interest.
The monthly rate of interest is the annual rate divided by 12. For example, if the amount owing at the start of the month was $10,000, the monthly payment was $1,000, and the annual interest rate was 12%, then: The monthly interest rate is 0.12/12 = 0.01; After the payment, the amount owing is $10,000 - $1,000 = $9,000; The amount of new interest is $9,000 * 0.01 = $90 The total owing at the end of the month is $9,000 + $90 = $9,090.
Your main simulation function should start with a balance of $10,000 owing, and take the amount of the monthly payment and the interest rate as arguments. It should then print out a list showing, for each month, the amount owing. It should also graph the outstanding over the time period of the simulation. An example of sample output (using payment of $100 and interest rate of 0.22):
Chart, line chartDescription automatically generated 0 10000.00 1 10081.50 2 10164.49 3 10249.01 4 10335.08 5 10422.72 6 10511.97 7 10602.85 8 10695.41 9 10789.66 10 10885.63 11 10983.37 12 11082.90 13 11184.25 14 11287.46 15 11392.57 16 11499.60 17 11608.59 18 11719.58 19 11832.60 20 11947.70 21 12064.91 22 12184.27 23 12305.81 24 12429.59 25 12555.63 26 12683.98 27 12814.69 28 12947.79 29 13083.33 30 13221.36 31 13361.92 32 13505.05 33 13650.81 34 13799.24 35 13950.40 36 14104.32 37 14261.07 38 14420.69 39 14583.23 40 14748.76 41 14917.32 42 15088.97 43 15263.77 44 15441.77 45 15623.04 46 15807.63 47 15995.60 48 16187.02 49 16381.95 50 16580.45 51 16782.59 52 16988.44 53 17198.06 54 17411.52 55 17628.90 56 17850.26 57 18075.69 58 18305.24 59 18539.00 60 18777.05 Submit your code and your output for a payment of $50 and an interest rate of 0.07
18000 16000 14000 12000 10000 0 10 20 30 40 50 60Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started