Public Class Form1 'Private rain() As Integer = {7, 8, 0, 4, 3, 8, 1} Private rain(6) As Integer Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load rain(0) = 7 rain(1) = 8 rain(2) = 0 rain(3) = 4 rain(4) = 3 rain(5) = 8 rain(6) = 1 End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim index, value As Integer index = CInt(TextBox1.Text) value = CInt(TextBox2.Text) rain(index) = value Display() End Sub Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged End Sub Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged End Sub Private Sub TextBox3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox3.TextChanged End Sub Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click End Sub Private Sub Label2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label2.Click End Sub Private Sub Display() Dim dn As Integer TextBox3.Text = Nothing For dn = 0 To 6 TextBox3.Text = TextBox3.Text & "day " & CStr(dn) & " rain " & CStr(rain(dn)) & vbCrLf Next largest() End Sub Private Sub largest() Dim max As Integer = 0 Dim maxind As Integer = 0 Dim i As Integer For i = 0 To 6 If rain(i) > max Then max = rain(i) maxind = i End If Next Label2.Text = "largest value is " & CStr(max) & " at " & CStr(maxind) End Sub End Class