Answer
Program:
# prompt user for final account value, annual interest
# rate and number of months of deposit
finalAccountValue= eval(input(
"Enter final account value: "))
annuallnterestRate= eval(input(
"Enter annual interest rate in percent: "))
numberOfYears= eval(input("Enter number of years: "))
# Compute the initial deposit amount
initialDepositAmount = finalAccountValue $/\left((1+(\text { annuallnterestRate/1200 }))^{* *}\right.$ (numberOfYears*12))
#Display the initial deposit amount
print("Initial deposit value is ", initialDepositAmount)
Work Step by Step
Step 1 of 3:
Program Plan:
Create a python file with name 2_11PE.PY. In the file,
- Get individual inputs from user. They are the final account value, annual interest rate and
number of months of deposit.
- Compute the initial deposit amount based on the formula given in question.
- Display the initial deposit amount.
Step 2 of 3:
Program:
# prompt user for final account value, annual interest
# rate and number of months of deposit
finalAccountValue= eval(input(
"Enter final account value: "))
annuallnterestRate= eval(input(
"Enter annual interest rate in percent: "))
numberOfYears= eval(input("Enter number of years: "))
# Compute the initial deposit amount
initialDepositAmount = finalAccountValue $/\left((1+(\text { annuallnterestRate/1200 }))^{* *}\right.$ (numberOfYears*12))
#Display the initial deposit amount
print("Initial deposit value is ", initialDepositAmount)
Step 3 of 3:
Sample Output:
Enter final account value: 1000
Enter annual interest rate in percent: $4.25$
Enter number of years: 5
Initial deposit value is $808.8639197424636$