The Project: We have ten athletes and the user defines the time they did. Those times are saved in a table called times(10). Clicking a button calculates the minimum time, the maximum and the average time. Also it finds the place of (i) in the table and sends it to a TextBox.
The Problem: What if we have 2 same minimum times, for example (10 sec and 10 sec) or 2 maximum times (20 sec and 20 sec), in the same table. How are we supposed to send to the textbox 2 places of (i)?
The Code:

Picture related above with translation
Any help will be appreciated. I feel like it's something too simple and i just can't seem to find it.
Thanks in advance, Sleazy
The Problem: What if we have 2 same minimum times, for example (10 sec and 10 sec) or 2 maximum times (20 sec and 20 sec), in the same table. How are we supposed to send to the textbox 2 places of (i)?
The Code:
VB.NET:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim max As Double
Dim min As Double
Dim avg As Double
Dim i As Double
max = times(1)
For i = 1 To 10 Step 1
If max < times(i) Then
max = times(i)
If times(i) = max Then
Place2.Text = i
End If
End If
Next
Last.Text = max
min = times(1)
For i = 1 To 10 Step 1
If min > times(i) Then
min = times(i)
End If
If times(i) = min Then
Place1.Text = (i)
End If
Next
First.Text = min
avg = times(0)
For i = 0 To 10 Step 1
avg = avg + times(i)
Next
avg = avg / 10
MO.Text = avg
End Sub

Picture related above with translation
Any help will be appreciated. I feel like it's something too simple and i just can't seem to find it.
Thanks in advance, Sleazy
Last edited: