I'm new to VB, and I'm having some trouble creating an array of random numbers between 100 and 150 (where the numbers represent # of students). I'm not sure what I'm doing wrong, but my textbox is showing 0, no matter how many times I press the generate button.
here's my code:
Option Strict On
Public Class StudentGradeForm
Dim Trials(151) As Integer, Grades(100) As Integer, i As Integer
Private Sub GenerateButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GenerateButton.Click
For i As Integer = 100 To 150
ReDim Trials(i)
Next
For i As Integer = 50 To 100 : Grades(i) = i : Next
Randomize()
NumberOfTrialsText.Text = Trials(i).ToString("D")
End Sub
End Class