I am building for a football team can enter their points and it will display points and total points and a final Score.
the message box opens and you enter the point and the point then suppose to go into the listbox. I can't to get the points to go in the list box and calculate the final score. This my code could anyone please help me.
Dim strScores As String
Dim decScores As Decimal
Dim strTotalofallScores As String
Dim DecTotalofallScores As Decimal = 0D
Dim strInputMessage As String = "Enter the Score #"
Dim strInputHeading As String = "Points Scored"
Dim strNormalMessage As String = "Enter the Score #"
Dim strNonnumericMessage As String = "Error-Enter a number for the Point Scored #"
Dim strNegativeError As String = "Error-Enter a positive number for Points Scored#"
' Declare and initialize loop variables
Dim intMaxNumberOfEntries As Integer = 10
Dim intNumberOfEntries As Integer = 1
' This loop allows the user to enter the point Scored of up to 10 Scores
' the loop terminates when the user has entered 10 scores or the user
strScores = InputBox (strInputMessage & intNumberOfEntries, strInputHeading, "")
Do Until intNumberOfEntries > intMaxNumberOfEntries = decTotalofallScore()
If IsNumeric (decScores) Then
decScores = Convert.ToDecimal (strScores)
If decScores > 0 Then
lstScores.Items.Add (decScores)
DecTotalofallScores += DecTotalofallScores
intNumberOfEntries += 1
strInputMessage = strNormalMessage
Else
strInputMessage = strNegativeError
End If
Else
strInputMessage = strNonnumericMessage
End If
If intNumberOfEntries <= intMaxNumberOfEntries Then
strScores = InputBox (StrInputBoxMessage() & intNumberOfEntries, StringTrimming, "")
End If
Loop
' Makes label visible
lblTotalofallScore.Visible = True
' Calculate and display average speed
If intNumberOfEntries > 1 Then
decScores = decTotalofallScore()/(intNumberOfEntries - 1)
lblTotalofallScore.Text = "Final Score is " & _
decTotalofallScore.ToString ("F1") & ""
Else
lblTotalofallScore.Text = "No Score entered"
End If
'Disaables the Enter Score button
btnEnterScore.Enabled = False
End Sub