Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

i need help with this visual studio 2012 assingment. i need help with this visua

ID: 3566966 • Letter: I

Question

i need help with this visual studio 2012 assingment.

i need help with this visual studio 2012 assingment. create visual basic 2012 form to generate random lottery numbers, generate 5 random numbers ranging from anywhere from 1-60 and store them into an array. use a for....next loop to generate the random numbers.store a random number into the array, generate different numbers each time, use the appropriate data type for the array. and sort the array. and display the sorted array lottery numbers in form lables.

Explanation / Answer

Public Class Form1

    Private SampleArray(20) As Double
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim randomNum As New Random()
        For i = 0 To 5
            SampleArray(i) = randomNum.Next(1, 60)
        Next
        Array.Sort(SampleArray)
        Label2.Text = SampleArray(0)
        Label3.Text = SampleArray(1)
        Label4.Text = SampleArray(2)
        Label5.Text = SampleArray(3)
        Label6.Text = SampleArray(4)

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Label2.Text = String.Empty
        Label3.Text = String.Empty
        Label4.Text = String.Empty
        Label5.Text = String.Empty
        Label6.Text = String.Empty

    End Sub
End Class

-----------------------------------------------------------------------------------------------------------------------------------