title: Grade Array Averager troubles
body: <p>I am currently in an IT curriculum in college. Advance Visual Basic 2010 is a requirement however, I am not a programmer. I have been struggling to find my way through VB but this last assignment has me stumped.I am able to get the first name into the array and the 5 grades for that name . At that point, the loop will continue to ask for the next name and that names 5 grades and so on until the 4th name and grades are entered and then it should display all 4 names and grade averages in the listbox. </p>
  
  <p>Here is the assignment...</p>
  
  <p>Write a program that will input four students’ names and average five test grades for each student. The program should have an array for the students name and then a two-dimensional array for all their grades.
  Your program should ask for the students name and then five test scores for that student.
  Create a method that does the averaging and pass the arrays to that method. That method can also output the student name and average in a list box.
  Call a method to figure up the average once you get all the grades. Do not figure it up as you get the information!! You’ll get a big ole zero if you do! Then have that same method output the results into the list box:</p>
  
  <p>After 4 days of struggling with this, here is what I have come up with so far. Any guidance is greatly appreciated. Thank you in advance. </p>
  
  <pre><code>Public Class Form1
  
      Private Sub btnNames_Click(sender As System.Object, e As System.EventArgs) Handles btnNames.Click
          Dim NamesList(3) As String
  
          Dim GradeArray(4) As Integer
          Dim x As Integer
          Dim y As Integer
          Dim Sum As Integer
          Dim Avg As Integer
  
          For y = 0 To NamesList(3)
              NamesList(x) = InputBox("Enter student number " &amp; y + 1 &amp; "'s name:", "Enter a name")
          Next
  
          For y = 0 To GradeArray.Length - 1
              GradeArray(y) = InputBox("Enter grade number " &amp; y + 1 &amp; " for " &amp; NamesList(0) &amp; " in the box:", "Enter the grades")
          Next
  
          For Each item In GradeArray
              Sum = Sum + item
          Next
  
          Avg = Sum / 5
  
          lstAverages.Text = Avg.ToString
  
      End Sub
  
      Private Sub btnExit_Click(sender As System.Object, e As System.EventArgs) Handles btnExit.Click
          Me.Close()
      End Sub
  End Class
  </code></pre>