•Private
Sub btnCompute_Click(...) Handles btnCompute.Click
• Dim score() As Integer = {0, 85, 92,
75, 68, 84, 86, _
• 94, 74, 79,
88}
• txtAverage.Text = CStr(Sum(score) /
10)
•End
Sub
•
•Function
Sum(ByVal s() As Integer) As
Integer
• Dim total, index As
Integer
• total = 0
• For index = 1 To s.GetUpperBound(0)
'The
upper bound is 10
• total += s(index)
• Next
• Return total
•End
Function