Question: While many simulations involve randomness, many others are deterministic. We saw an example of this in class ( the braking simulation ) . As we
While many simulations involve randomness, many others are deterministic. We saw an example of this in class the braking simulation As we learn the basics of discrete timebased simulation, we will consider another simple deterministic scenario.
Here, we want to build a tool to compare the financial implications of different forms of debt. People are often familiar with the idea that credit card debt is very costly but dont understand the impacts of various interest rates and repayment plans.
Consider a debt of $ 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 months. For each month, the outstanding debt at the end of the month is the amount owing at the beginning of the month ie 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
For example, if the amount owing at the start of the month was $ the monthly payment was $ and the annual interest rate was then:
The monthly interest rate is ;
After the payment, the amount owing is $ $ $;
The amount of new interest is $ $
The total owing at the end of the month is $ $ $
Your main simulation function should start with a balance of $ 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.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
