title: Visual Basic sum and average calculation
body: <p>So this part I have for average does not work... </p>
  
  <pre><code>For Each s As String In IO.File.ReadAllLines("textfileishere")
      Dim testScore As Integer
      Dim count As Integer = s.Count
      If Integer.TryParse(s, testScore) Then
          averageWeight = s.Count / s
      End If
  Next
  AverageKgTextBox.Text = averageWeight.ToString
  </code></pre>
  
  <p>I have the maximum working but not the minimum which this is the code for and I have no idea how to fix it. </p>
  
  <pre><code>Dim lowestWeight As Integer = 0
  For Each s As String In IO.File.ReadAllLines("textfile")
      Dim testScore As Integer
      If Integer.TryParse(s, testScore) Then
          lowestWeight = Math.Min(lowestWeight, testScore)
      End If
  Next
  LowestKgTextBox.Text = lowestWeight.ToString
  </code></pre>
  
  <p>Again these all have to read from the textfile and give the output, I would like to code this in the simplest manner possible.</p>