Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

# futval.py # A program to compute the value of an investment # carried 10 years into the future def main(): print This program calculates

# futval.py # A program to compute the value of an investment # carried 10 years into the future def main(): print "This program calculates the future value" print "of a 10 year investment." principal = input("Enter the initial principal: ") apr = input("Enter the annualized interest rate: ") for i in range(10): principal = principal * (1 + apr) print "The value in 10 years is:", principal main() 

Write an improved python version of thefutval.py program. Your program will prompt for amount of investment, annualized interest rate, and number of years of investment. The program will then output a nicely formatted table that tracks the value of investment year by year (for 30 years), both to the screen, and to a csv file. For the csv file, start with $10,000 and an interest rate of 2%.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database Technology

Authors: Suad Alagic

1st Edition

354096276X, 978-3540962762

More Books

Students also viewed these Databases questions

Question

Provide a definition of a shareholder rights plan.

Answered: 1 week ago