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 time-based 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 re-payment plans.
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.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!