Agustin G. answered 03/21/24
Tutor
5
(2)
Effective English Tutor Specializing in Reading and Test Prep Skills
"""
For this problem, we will be using the Future
Value of an Annuity Formula:
FV = M * ((1+r)^n - 1) / r)
where
FV = Future value ($),
M = Periodic payment ($),
r = interest rate per period, and
n = number of periods.
From the problem, we know that FV = $20,000,
the annual interest rate is 0.02, and the total time
is 6 years. The problem asks for the amount of the
monthly payment, so we solve for 'M' in the expression
above:
M = (FV * r) / ((1+r)^n - 1)).
"""
# Given data from the problem
future_value = 20000 # future value needed for retirement ($)
annual_interest_rate = 0.02 # annual interest rate
years = 6 # number of years until retirement
# Convert annual interest rate to monthly and calculate the number of months
monthly_interest_rate = annual_interest_rate / 12
total_months = years * 12
# Calculate the monthly deposit needed (M) using the annuity formula
monthly_deposit = (future_value * monthly_interest_rate) / ((1 + monthly_interest_rate)**total_months - 1)
# Calculate total amount deposited and interest earned
total_deposited = monthly_deposit * total_months
# Output the results
print(f"Monthly deposit needed: ${monthly_deposit:.2f}")
"""
The following output should print upon runnin this code:
Monthly deposit needed: $261.68
""";