Calculates Compounded Maturity Amount given the principal, rate and period
Calculates Compounded Maturity Amount given the principal, rate and period
Rate Calculates Compounded Maturity Amount given the principal, rate and period
(2(2 Vote))
Dim principal As Integer
Dim intRate As Integer
Dim years As Integer
Dim interest As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Principal_Amount_Changed(ByVal sender As Object, ByVal e As System.EventArgs) Handles PrincipalAmount.TextChanged
CalculateFinalTotal()
End Sub
Private Sub Interest_Rate_Changed(ByVal sender As Object, ByVal e As System.EventArgs) Handles InterestRate.TextChanged
CalculateFinalTotal()
End Sub
Private Sub Years_Deposited_Changed(ByVal sender As Object, ByVal e As System.EventArgs) Handles YearsDeposited.TextChanged
CalculateFinalTotal()
End Sub
Private Sub CalculateFinalTotal()
If PrincipalAmount.Text = "" Or InterestRate.Text = "" Or YearsDeposited.Text = "" Then
TotalAmount.Text = ""
Else
principal = CInt(PrincipalAmount.Text)
intRate = CInt(InterestRate.Text)
years = CInt(YearsDeposited.Text)
interest = CalcInt(principal, intRate, years)
TotalAmount.Text = interest
End If
End Sub
Function CalcInt(ByVal P As Integer, ByVal R As Integer, ByVal N As Integer) _
As Integer
Return P * (1 + R / 100) ^ N
End Function
End Class
Calculates Compounded Maturity Amount given the principal, rate and period Comments
No comments yet — be the first to post one!
Post a Comment