Programming Exercise 8

  < Previous  Next >

Due Date

See the calendar for due date.

Assignment:

Suppose you have a certain amount of money in a savings account that earns compound monthly interest, and you want to calculate the amount that you will have after a specific number of months. The formula is as follows: f = p * (1 + i/12)t

Write a program that takes the account's present value, monthly interest rate, and the number of months that the money will be left in the account as three inputs from the user. The program should pass these values to a function that returns the future value of the account, after the specified number of months. The program should print the account's future value.

Examples

The following are examples of correct execution (with the text in bold being the input from the user):
Please enter the current value: 100
You entered $100.00
Please enter the annual interest rate: 0.0075
You entered 0.0075 (which is 0.75%)
Please enter the number of months: 12
You entered 12 months
In 12 months, the value of the account will be $100.75
Please enter the current value: 15000
You entered $15,000.00
Please enter the annual interest rate: 0.0274
You entered 0.0274 (which is 2.74%)
Please enter the number of months: 60
You entered 60 months
In 60 months, the value of the account will be $17,199.74
Please enter the current value: 250000.00
You entered $250,000.00
Please enter the annual interest rate: 0.035
You entered 0.035 (which is 3.5000000000000004%)
Please enter the number of months: 360
You entered 360 months
In 360 months, the value of the account will be $713,321.79

Submission

Submit your python script using the handin program. For handin, for this lab, type the following in a terminal window exactly as it appears:
handin  pe8  pe8.py
To verify your submission, type the following in a terminal window:
handin  pe8

Notes

0.75% is a good savings account annual interest rate
2.74% is a good 60-month annual interest rate for a new car (so the future value is then what would happen to the balance of your loan if you didn't pay anything)
3.50% is a good annual interest rate for a 30-year mortgage (so the future value is then what would happen to the balance of your mortgage if you didn't pay anything)