Question
Not sure what I am doing wrong here but for some reason my output for Larry under amounts deposited is showing as 160,000 when it
Not sure what I am doing wrong here but for some reason my output for Larry under amounts deposited is showing as 160,000 when it should be 165,000. However, for the amounts in IRA upon retirement, my outputs for both Larry and Earl are correct. What am I doing wrong?
Problem:
Individual Retirement Accounts: Money earned in an ordinary savings account is subject to federal, state, and local income taxes. However, a special type of retirement savings account called a traditional individual retirement account (traditional IRA), allows these taxes to be deferred until after retirement. IRAs are highly touted by financial planners. The purpose of this programming project is to show the value of starting an IRA early. Earl and Larry each begin full-time jobs in January 2015 and plan to retire in January 2063 after working for 48 years. Assume that any money they deposit into IRAs earns 4% interest compounded annually. Earl opens a traditional IRA account immediately and deposits $5,000 into his account at the end of each year for fifteen years. After that he plans to make no further deposits and just let the money earn interest. Larry plans to wait fifteen years before opening his traditional IRA and then deposit $5,000 into the account at the end of each year until he retires. Write a program that calculates the amount of money each person has deposited into his account and the amount of money in each account upon retirement. Output should match Fig. 3.83 exactly
Here is figure 3.83:
AMOUNTS DEPOSITED Earl: $75,000.00 Larry: $165,000.00 AMOUNTS IN IRA UPON RETIREMENT Earl: $365, 268.39 Larry: $331, 047. 64 FIGURE 3.83 Outcome of Programming Project 5.principal = 5000 initial = principal rate = 4 deposit = 0 principal2 = 5000 initial2 = principal2 rate2 = 4 deposit2 = 0 for i in range(0, 15) : deposit = deposit + initial compoundInterest = principal * ((1 + rate / 100)**1) principal = compoundInterest + initial principal = (compoundInterest) * ((1 + rate / 100)**32) for i in range (0, 32) : deposit2 = deposit2 + initial2 compoundInterest2 = principal2 * ((1 + rate2 / 100) **1) principal2 = compoundInterest2 + initial2 print ( "\\tAMOUNT DEPOSITED" ) print ( "\ Earl: ", "${:, . 2f}" . format (deposit), "\\tLarry : ", "${:, .2f}". format (deposit2) ) print ( "\ \\tAMOUNTS IN IRA UPON RETAIRMENT") print ("\ Earl: ", "${:, .2f}" . format (principal), "\\tLarry : ", "${:, .2f}". format(principal2) )\fStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started