|
Now that I ’ve asked, I ’ll tell you, I ’m also from that stage where I ca n’t, but I wo n’t remember that I can go online
Public Class Form1
Private Sub Button1_Click (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim oRandom As New Random
Dim iNum As Integer = 0
Dim maxOfArray As Integer = 0
Dim minOfArray As Integer = 0
Dim aveOfArray As Double = 0
Dim sumOfArray As Integer = 0
Dim array As New List (Of String)
Dim i As Integer = 0
For i = 0 To 10
iNum = oRandom.Next (100)
sumOfArray = sumOfArray + iNum
array.Add (iNum.ToString)
Label1.Text = Label1.Text + iNum.ToString () + "," 'Display the 10 numbers generated immediately
Next
aveOfArray = sumOfArray / 10
array.Sort ()
Label2.Text = "Maximum" + array (9) .ToString () + "Minimum" + array (0) .ToString () + "Average" + aveOfArray.ToString ()
End Sub
End Class |
|