Answered step by step
Verified Expert Solution
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 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
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