Introduction to Programming using Python 1st Edition

Published by Pearson
ISBN 10: 0132747189
ISBN 13: 978-0-13274-718-9

Chapter 2 - Elementary Programming - Programming Exercises - Page 60: 2.19

Answer

Enter your investment amount: 1000 Enter annual interest rate: 4.25 Enter the number of years: 1 Your future investment value is: 1043.33

Work Step by Step

The code for the required program is shown below: 1. amount=eval(input("Enter your investment amount: ")) 2. rate=eval(input("Enter annual interest rate: ")) 3. year=eval(input("Enter the number of years: ")) 4. futureInvestmentValue=amount*(1+rate)**(12*year) 5. print("Your future investment value is: ", futureInvestmentValue) The user enters his amount, rate and number of years for investment. Then, his future investment value is calculated according to the given formula, and we get the expected results.
Update this answer!

You can help us out by revising, improving and updating this answer.

Update this answer

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.