title: How can I Calculate the Average of the Array List
body: <p>Ok I need to get size of the array and the array inputs through a msgbox and display the array list in a list box and then get the average of the array list. here is the code I have so far:</p>
  
  <pre><code>Private Sub btnCalculate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCalculate.Click
  
      Dim i, size As Integer
      size = Val(InputBox("Please enter array size"))
  
      Dim sequence(size) As Integer
  
      'get array values
      i = 0
      Do While i &lt; size
          sequence(i) = Val(InputBox("Please enter element of array"))
          i = i + 1
      Loop
  
      i = 0
      Do While i &lt; size
          lstoutArray.Items.Add(sequence(i))
          i = i + 1
      Loop
  End Sub
  </code></pre>