Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

VS 2012 [RESOLVED] Compounding Interest Rates in VB 2012

$
0
0
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:
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

Attached Images
 

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>