Dim result = Payment(rate, 60, 10000)
Console.WriteLine(result)
Public Function Payment(ByVal interest_rate As Double, _
ByVal periods As Double, _
ByVal starting_amount As Double) As Double
Return starting_amount * (interest_rate + 1.0)
If interest_rate = 0 Then
Return starting_amount / periods
Return (starting_amount * interest_rate) / (1.0 - (Math.Pow(1.0 + interest_rate, -1.0 * periods)))