Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Exercise 3 : Suppose you have some money ( the principal ) that is deposited in a bank account for a number of years and
Exercise : Suppose you have some money the principal that is deposited in a bank account for a number of years and earns a fixed annual rate of interest. The interest is compounded times per year.
The formula for determining the amount of money you will have is:
amount principal
where:
amount is the amount of money accumulated after time years, including interest.
principal is the initial amount of money deposited in the account
rate is the annual rate of interest, specified as a decimal; eg is specified as and not
i is the number of times the interest is compounded per year
time is the number of years for which the principal is deposited.
For example, if $ is deposited in an account paying an annual interest rate of compounded quarterly times a year the amount in the account after years is:
amount $~~$
In PyTutor, click'Edit this code. Delete the code in PyTutor's editor, then:
Type four assignment statements that create new variables named principal, rate, and time, and assign them the values and respectively.
Type one assignment statement that calculates the amount of money in the account after time years, using the formula presented above. This value should be assigned to a new variable named amount. Your assignment statement must demonstrate the use of the Python builtin function pow.
Click the Visualize Execution button. Execute the code, one statement at a time, and observe the memory model as the code is executed, stepbystep. Verify that the accumulated amount of money is approximately
When your code is correct, copypaste the five assignment statements from PyTutor into labtxt
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