Question: python! Task 2C: Retirement [30 marks] You decided to sign up for a retirement scheme which typically requires yearly deposit into a retirement account. The

python! Task 2C: Retirement [30 marks] You decided to sign up fora retirement scheme which typically requires yearly deposit into a retirement account.python!

Task 2C: Retirement [30 marks] You decided to sign up for a retirement scheme which typically requires yearly deposit into a retirement account. The money deposited into this account would then "grow" in the form of compound interest. The yearly deposit would continue until you are at the retirement age. After the retirement age, you would instead be withdrawing money from the retirement account based on your preference. This account would still be gathering compound interest, but less due to withdrawal of money. Let's make this more concrete by using the table of values below. We start with a simple deposit of $10,000 every year for 35 years (assume you start depositing money at 30 years old until you retire at 65 years old) compounded yearly at 3% per annum. The amount of money you will get when you retire is shown below. Assume you make new deposit at the start of the year. Year Amount $10,000 $20,300 $30,909 $41,836.27 Interest $300 $609 $927.27 $1,255.09 Amount at year end $10,300 $20,909 $31,836.27 $43,091.36 3 4 35 $604,620.82 $18,138.62 $622,759.44 At the start of your retirement, you are going to have $622,759.44 in your retirement account. Let's say you are going to take $3,000 per month from this retirement account, how long will it take until the retirement account is empty? Let's answer this again with a table! Assume that you are taking at the start of every month, and the interest is given based on your account at the end of the year. Month Amount Withdraw Interest Amount at month end $622,759.44 $3,000 SO $619,759 44 2 $619,759.44 $3,000 $0 $616.759.44 $616,759.44 $3,000 I5613.759 44 12 13 $589,759.44 $604,362.22 $3,000 $3,000 $17,602.78 $0 $604,362.22 $601,362.22 284 285 $4,716.71 $1,716.71 $3,000 $1,716.71 $0 $0 $1,716.71 $O Note that the amount in both tables are rounded to 2 decimal places for display. However, you should keep the precision as high as possible when computing. Since you withdraw money from the account every month, but the interest is only computed per year, the interest will be non-zero only when the months are multiple of 12. Your last drawn money will be $1,716.71 after 285 months (roughly 23 years and 9 months). It means you can survive with roughly $3,000 a month from your retirement age of 65 until you are 88 years of age. Write a function retirement (amount, rate, year, monthly) that takes in four inputs: the amount of yearly contribution, the annual interest rate compounded yearly, the number of years of contribution, and the monthly payout fi.e, withdrawal) once you reached the retirement age. The function returns the number of months you can get payout (i.e., withdrawal) that are non-zero. Assumptions amount > rate > year > monthly amount rate Note You may assume that the functions loan_amount_left(amount, rate, payment, year) and loan_length(amount, rate, payment) are already implemented for you correctly based on the assumption above. Hint: what does a negative amount mean? Example Run >>> retirement (1980e, 3, 35, 3000) 285 >>> retirement (1880e, 1, 35, 3000) 149

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!