Hey Guys,
I'm new to VB and taking an online course and need help.
Here is the problem. I am to write a VB program that will take a Loan of $563 that is to be paid off with 5 monthly payments of $116. The interest Rate is 1% per month. I need to display a table giving the number of months and the balance on the loan after each month.
The Table displayed should look like this:
Month Amount Owed
1 $452.63
2 $341.16
3 $228.57
4 $114.86
5 $0.00
Here is my code but I do not understand why it only shows "Month" and "Amount Owed" and nothing else. Any help would be greatly appreciated. Maybe someone can point me in the right direction and I can figure it out.
Private Sub btnDisplay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplay.Click
Dim numMonths As Integer = 1
Dim Payment As Double = 116.0
Dim Balance As Double = 563.0
Dim Rate As Double = 0.01
Dim EndBal As Double
lstResult.Items.Clear()
Dim fmtStr As String = "{0, 2}{3, 10:C}"
Do While Balance = 0
numMonths += 1
EndBal += Balance * Rate - Payment
Loop
lstResult.Items.Add("Months" & "Ammount Owed")
End Sub
I'm new to VB and taking an online course and need help.
Here is the problem. I am to write a VB program that will take a Loan of $563 that is to be paid off with 5 monthly payments of $116. The interest Rate is 1% per month. I need to display a table giving the number of months and the balance on the loan after each month.
The Table displayed should look like this:
Month Amount Owed
1 $452.63
2 $341.16
3 $228.57
4 $114.86
5 $0.00
Here is my code but I do not understand why it only shows "Month" and "Amount Owed" and nothing else. Any help would be greatly appreciated. Maybe someone can point me in the right direction and I can figure it out.
Private Sub btnDisplay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplay.Click
Dim numMonths As Integer = 1
Dim Payment As Double = 116.0
Dim Balance As Double = 563.0
Dim Rate As Double = 0.01
Dim EndBal As Double
lstResult.Items.Clear()
Dim fmtStr As String = "{0, 2}{3, 10:C}"
Do While Balance = 0
numMonths += 1
EndBal += Balance * Rate - Payment
Loop
lstResult.Items.Add("Months" & "Ammount Owed")
End Sub