Here is a program that calculates the final value of a 10 year fixed term investment, given the initial investment amount and the interest rate.
'''calculate the future value of an investment after 10 years'''
def calcValue( initialValue, interestRate ):
period = 10
investmentValue = initialValue
for i in range(period):
investmentValue = investmentValue * ( 1 + interestRate )
principal = int(raw_input("Enter initial investment amount: "))
interest = float(raw_input("Enter interest rate as a percentage: ")) / 100
finalValue = calcValue( principal, interest )
print "Final value of the investment is $%0.2f" % finalValue
Modify the function so that the user can specify the period of the investment. Further modify the function so that the user can make additional fixed yearly investments.
Specify 5 sets of test data you can use to test the program and the expected results for that test data. Provide test listings to verify your predictions.
Recently Asked Questions
- Think about where you fit in terms of Helms' stages of racial identity development. Why do you find yourself in that particular stage (what life experience has
- explain how the racialization of Chinese immigrants provided a model for evaluating other immigrants from Asia, Mexico, and Southern Europe.
- Discuss how Asians were perceived by nativists, and why the Chinese were seen as racially threatening. Next compare the ideas behind this threat as it persists