I am having a little bit of trouble calculating the balance in my code.
In this program (balance = balance * (1 + interestRate)
. The thing is that we are
I wasn't allowed to edit Zafs answer to include the extra line, so here is my take. The important point being that the initialization of finalBalance
is outside of the for-loop.
finalBalance = initialBalanceSavings + initialBalanceCorporate
For theYear = 2013 To 2016
subtotal = finalBalance * (1 + interestRate)
finalBalance = subTotal
Next
For TheYear = 2013 to 2016
SubTotal = balance * (1 + interestRate)
balance = SubTotal
Next
The code block above is just to give you an IDEA of HOW to do the loop and what should be calculated INSIDE the loop. To get the actual ANSWER you MUST remember that 2013 is the CURRENT year so you would not ACTUALLY calculate the interest for that year. And key to the way in which you accomplish this is the formatting of your loop, which in reality should begin the FOLLOWING year.
For Year = 2013 + 1 to 2016
'blah blah blah
Next