# Future Value Calculator

The concept of future value is related to time value of money. For example, if you deposit your money in a bank as a savings account or a fixed deposit account for a certain period of time, you will earn a certain amount of money based on the compound interest computed periodically, and this amount is added to the principal if you continue to keep the money in the bank. Interest for the following period is now computed based on the initial principal plus the interest (the amount which becomes your new principal). Subsequent interests are computed in the same way.

For example, let's say you deposited \$1000 in a bank and the bank is paying you 5% compound interest annually. After the first year, you will earn an interest of \$1000x0.05=\$50 . Your new principal will be \$1000+\$1000x0.05=\$1000(1+0.05)=\$1000(1.05)=\$1050.

After the second year, your new principal is \$1000(1.05)x1.05=\$1000(1.05)2 =\$1102.50. This new principal is called the future value.

Following the above calculation, the future value after n years will be

FV = PV * (1 + i / 100)n

Where PV represents the present value, FV represents the future value , i is the interest rate and n is the number of periods (Normally months or years).

### The code

Public Function FV(PV As Variant, i As Variant, n As Variant) As Variant
'Formula to calculate Future Value(FV)
'PV denotes Present Value
FV = PV * (1 + i / 100) ^ n

End Function

Private Sub compute_Click()
'This procedure will calculate Future Value
Dim FutureVal As Currency
Dim PresentVal As Currency
Dim interest As Variant
Dim period As Variant PresentVal = PV.Text

interest = rate.Text
period = years.Text

FutureVal = FV(PresentVal, interest, period)
Label5.Caption = Format(FutureVal, "currency")
End Sub

Private Sub period_Change()

End Sub