Getting balance from code in button

前端 未结 2 1711
庸人自扰
庸人自扰 2021-01-27 05:52

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

2条回答
  •  迷失自我
    2021-01-27 06:02

    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
    

提交回复
热议问题