P(Where P is principle amount) is borrowed at R(R is Interest Rate) for N(Number of months) and compounded monthly.
I'm struggling to convert this to VB language. To be honest I haven't tried the formula yet.
![Name: Capture.PNG
Views: 54
Size: 3.8 KB]()
Here's my code so far:
I'm struggling to convert this to VB language. To be honest I haven't tried the formula yet.
Here's my code so far:
Code:
Sub Main()
Dim amount As Decimal
Dim rate As Decimal
Dim years As Double
Dim months As Double
Dim payment As Decimal
'INPUT Gathering required information.
Console.Write("Enter the amount of the loan: ")
Decimal.TryParse(Console.ReadLine, amount)
Console.Write("Enter the interest rate (%): ")
Decimal.TryParse(Console.ReadLine, rate)
Console.Write("Enter the number of years: ")
Double.TryParse(Console.ReadLine, years)
Console.WriteLine()
'PROCESSING
months = years * 12
'OUTPUT
Console.WriteLine("Your monthly payment will be " & payment.ToString("c2"))
Console.Read()
End Sub