thayl0 0 Newbie Poster

Assignment - Create a program that asks user:

  1. enter amount of money invested, number of years investing, and annual interest rate in decimal format

  2. call a user-defined function to get total value at end of investment term(futureValue)

  3. call another user defined function to get total interest earned.

  4. Display total value and total interest earned at end of the term

Note: Use the following formula to calculate totalFutureValue is:

FutureValue = InvestedAmount * (1 + AnnualInterestRate/12) ^ (InvestedYears * 12)

Here's what I have so far.

# Investment Calculator: Ask the user to enter there investment and calculates the money made.

# 1. Get user's input
investedAmount = float(input("Enter the money investing: "))
interestRate = float(input("Enter the annual interest rate: "))
years = float(input("Enter the number of years: "))


# 2. Calculate


for i in range(years):
    FutureValue = investedAmount * (1 + interestRate/12) ^ (years * 12)
    total = FutureValue
print "The value made is: %f" % total

I submitted the assignment and the teacher said "The investmentCalculate does not correctly calculate futureValue."

Now my question is how do I calculate it correctly I get an error when I use her calculation.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.