The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
a
Assignment 4 -- Retirement Planning, Part 1
Instructions:
 write the first part of a program that allows a customer to plan for retirement.
Note:Â This program has no user input
Write a "pure" Python function named 'calc_final_balance' that calculates the final balance in a retirement account after annual savings accrue for and earn interest for a number of years. This is a simulation problem similar to the Credit Card sample program, except it is to be written as a function definition (which means, among other things, that it uses parameters instead of user input). Here is the specification:
TESTÂ the 'calcFinalBalance' function by adding statements in the 'main program' to print out the final balance for several test cases and confirm that it is correct. For example, these statements:
print('$' + format(calc_final_balance( 30, 3000, 6 ), '.2f'))
print('$' + format(calc_final_balance( 20, 2000, 5.5 ), '.2f'))
should write on the web page the results $492143.05 and $519518.88. Choose test cases that check the function thoroughly, and document your testing in comments.
Here is a simple test case you can more easily trace by hand:Â calc_final_balance( 65, 2000, 10 )Â should return the value 13431.22.
Documentation & Style Specifications