You are a new graduate and you just landed your first job earning about $60K/year.
You vaguely recall one of your professors saying, 'You should start investing with your first pay check.' He said something like, "10% or $500.00 a month for 40 years and you would be a millionaire." Create a Java Application that you will use to calculate the compoundinginterest with a for loop.
You will use an interest rate of 6% (.06) and start with a principal investment of $2000.00 (That is what's left from graduation gifts after putting money down on a new car). You will run your code for 40 years and output annual totals. Your compounding interest equation should look something like:
Total = (Total + (Monthly * 12)) * (IntRate + 1)
Please write your application so that you can change the interest rate, allow for a different initial principal investment, and output the total amounts invested verses the total amount earned. (Note: Principal = Total for the first iteration)
For example:
Test1: Principal=2000.00, Monthly=500.00, Inrate=0.06, Years=40
Test2: Principal=0.00, Monthly=500.00, Inrate=0.04, Years=40