Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Basic C program. Stuck on this hw problem A 401(k) plan is a type of tax-qualified account for people to save for retirement. Employees typically

Basic C program. Stuck on this hw problem

image text in transcribed

A 401(k) plan is a type of tax-qualified account for people to save for retirement. Employees typically have part of their pre-tax pay check deposited into such an account and employers may match a certain amount of those contributions. As of 2018, there was a maximum annual contribution limit of $18,500 The money contributed to a 401(k) account may be invested in many different ways. While the account may grow tax free, it is not immune to inflation. To account for inflation, you can use the following formula which is the inflation-adjusted rate of return inflation-adjusted rate of return rate of return)/(1 + inflation rate)) -1 Write a program that produces an amortization table for a 401(k) account. Your program will read the following inputs as command line arguments .An initial starting balance . A monthly contribution amount (we'll assume its the same over the life of the savings plan) An (average) annual rate of return (on the scale [0, 1]) An (average) annual rate of inflation (on the scale [0, 11) . A number of years until retirement Your program will then compute a monthly savings table detailing the (inflation-adjusted) interest earned each month, contribution, and new balance. To get the monthly rate, simply divide by 12. Each month, interest is applied to the balance at this rate (prior to the monthly deposit) and the monthly contribution is added. Thus, the earnings compound month to month. Be sure to round appropriately, to the nearest cent so that rounding errors do not compound Your program will need to validate the input and quit with an error message on any potential bad input(s). For inputs 10000 500 0.09 0.012 10 your output should look something like the following Month Interest Balance 1 $ 64.23 10564.23 2 $ 67.85$11132.08 3 $ 71.50$11703.58 4 $ 75.17 $ 12278.75 5 78.87 $ 12857.62 6 $ 82.58 13440.20 7 $ 86.33 $ 14026.53 8 $ 90.09 $ 14616.62 9 93.88 15210.50 116 $678.19 $ 106767.24 117 $685.76 $ 107953.00 118 693.37 $ 109146.37

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

Databases In Networked Information Systems 6th International Workshop Dnis 2010 Aizu Wakamatsu Japan March 2010 Proceedings Lncs 5999

Authors: Shinji Kikuchi ,Shelly Sachdeva ,Subhash Bhalla

2010th Edition

3642120377, 978-3642120374

More Books

Students also viewed these Databases questions