I need to write a program that reads in a set of test scores from a inputbox then displays them in a list box with a corresponding letter grade. Then from there display the Standard devation, the Mean, and the number of the test scores. I cant seem to get the right output from the input box to the lst box and so on.
Below is what I have thus far I cant really see where I am goin wrong. Any help would be a major plus. Thank you!
Public Class Form1
Private Sub btnCompute_Click(sender As Object, e As EventArgs) Handles btnCompute.Click
Dim sngTotal As Single
Dim intNumScores As Integer
Dim strInput As String
Dim Count As Integer
Dim intCounter As Integer
Dim grade As String
Dim mean, total As Double
Dim stdDev As Double = 0
strInput = InputBox("Please Enter Test Scores", "Enter Score")
sngTotal = 100
Count = 0
For intCounter = 1 To 10 Step 1
strInput = InputBox("Enter the value for test score " _
& Count.ToString, "Test Score Needed")
sngTotal = (strInput)
Next
stdDev = stdDev / (intNumScores)
stdDev = Math.Sqrt(stdDev)
txtMean.Text = FormatNumber(mean)
txtSD.Text = FormatNumber(stdDev)
txtExams.Text = FormatNumber(total)
If intNumScores >= (mean + (1.5 * stdDev)) Then
grade = "A"
ElseIf (mean + (0.5 * stdDev)) <= intNumScores And intNumScores < (mean + (1.5 * stdDev)) Then
grade = "B"
ElseIf (mean - (0.5 * stdDev)) <= intNumScores And intNumScores < (mean + (0.5 * stdDev)) Then
grade = "C"
ElseIf (mean - (1.5 * stdDev)) <= intNumScores And intNumScores < (mean - (0.5 * stdDev)) Then
grade = "D"
ElseIf intNumScores < (1.5 * stdDev) - mean Then
grade = "F"
End If
lstScores.Items.Add(lstScores.Text & intNumScores & "Grade: " & grade)
Count += 1
End Sub
Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click
Me.Close()
End Sub
End Class