Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Recommended Textbook for

Essential SQLAlchemy Mapping Python To Databases

Authors: Myers, Jason Myers

2nd Edition

1491916567, 9781491916568

More Books

Students also viewed these Databases questions

Question

How can we confi rm both ourselves and others?

Answered: 1 week ago