Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
'a loop that will repeat between 0 and the value of size - 1 (so it doesn't loop one
too many times)
For x = 0 To size - 1
'it will use x from the loop to add the correct element from the list to the
total
Next
'the loop has now finished, the average is calculated by dividing the total by the
size
Dim average As Decimal = total / size
This program gives the average of 9 based on the values in the scores
array. This is because 10 + 12 + 7 + 6 + 10 = 45. This is then divided
by the size of the list (5) to give 9.