Getting balance from code in button

前端 未结 2 1713
庸人自扰
庸人自扰 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:08

    For TheYear = 2013 to 2016
      SubTotal = balance * (1 + interestRate)
      balance = SubTotal
    Next
    

    UPDATE

    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
    

提交回复
热议问题