Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Instructions: For this assignment, you will write complete a program that allows a customer to plan for retirement . Part 2: Generate a Retirement Planning

Instructions: For this assignment, you will write complete a program that allows a customer to plan for retirement.

Part 2: Generate a Retirement Planning Table:

It's hard to decide how much you need to save for retirement. To help your customer visualize how much she needs to save for retirement, write a program that allows the user to generate a retirement planning table for a specified annual savings amount showing the final account balance upon retirement for various combinations of starting age for saving and interest rate.

Here is one important goal of this assignment: You must use ("call") the 'calc_final_balance' function you wrote for Assignment #4 in this assignment. This means that you need to put a copy of that function definition at the beginning of your code for this assignment.

Specification:

  • Get just one input value from the user: the amount to be saved each year. Make sure that the user has entered a number greater than or equal to $100 (i.e. input validation is required).
  • Produce a table that shows the final account balance in 40 different situations:
    • 10 different starting ages should be used: 20, 25, 30, ... , 65.
    • For each starting age, vary the interest rate from 4% to 10% in steps of 2%.
    • Your program must use nested loops to produce the table.
  • Here is what the table would look like if the user specifies an annual savings of $3,000 (program output in blue, user input in black -- just the number 3000):image text in transcribed
  • 'calc_final_balance' function is:
  • '''function to calculate total savings for given period''' def calc_final_balance(strart_age,savings_each,percentage_int): sum_of_money = 0 for i in range(strart_age,71): if i==70: pass else: sum_of_money = sum_of_money + savings_each sum_of_money = sum_of_money*(1+(percentage_int/100)) return sum_of_money print('$' + format(calc_final_balance( 30, 3000, 6 ), '.2f')) print('$' + format(calc_final_balance( 20, 2000, 5.5 ), '.2f')) print('$' + format(calc_final_balance( 65,2000,10 ), '.2f'))

Welcome to the retirement planning tool! Enter annual savings (at least $100) $3000 Retirement Savings Table: StartingAssumed Interest Rate 4% 6% 20 476321.30 $ 923268.18 $1859015.31 $3840898.15 25 $ 377611.70 $ 676524.37 $1252278.20 $2372385.96 30 $ 296479.61 492143.05 $ 839343.12 $1460555.43 35 229794.94 $ 354362.60 558306.44 $ 894380.42 40 $ 174985.01 $ 251405.03 $ 367037.60 542830.27 45 $ 129935.23 $ 174469.15 $ 236863.25 $ 324545.30 50 $ 92907.61 $ 116978.18 $ 148268.76 $ 189007.50 55 $ 62473.59 $74017.58 87972.85 $ 104849.19 60 $37459.05 $41914.93 $ 46936.46 $ 52593.50 65 $ 16898.93 $ 17925.96 $ 19007.79 $ 20146.83 Age 8% 10% When are YOU going to start saving for ret

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

1 2 3 Data Base Techniques

Authors: Dick Andersen

1st Edition

0880223464, 978-0880223461

More Books

Students also viewed these Databases questions