0% found this document useful (0 votes)
49 views6 pages

Labo 6 de Progra Vectores

This document contains code for multiple forms that allow users to enter data into arrays and lists and perform calculations on that data. Form1 contains code to accept user input into arrays and lists, find the maximum value in an array, and clear the lists and textboxes. Form2 contains similar code to track the number of occurrences of a value in an array. Additional forms perform calculations by adding array values and checking for the existence of an array value.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views6 pages

Labo 6 de Progra Vectores

This document contains code for multiple forms that allow users to enter data into arrays and lists and perform calculations on that data. Form1 contains code to accept user input into arrays and lists, find the maximum value in an array, and clear the lists and textboxes. Form2 contains similar code to track the number of occurrences of a value in an array. Additional forms perform calculations by adding array values and checking for the existence of an array value.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Public Class Form1 Public NRO(19), I As Integer Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.

Click NRO(I) = TextBox1.Text ListBox1.Items.Add(NRO(I)) I = I + 1 TextBox1.Text = "" TextBox1.Focus() End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim WMAYOR, K As Integer K = I + 1 For I = 0 To K If NRO(I) > WMAYOR Then WMAYOR = NRO(I) End If Next TextBox2.Text = WMAYOR End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

TextBox1.Text = "" TextBox2.Text = "" ListBox1.Items.Clear() End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click End Sub End Class

Public Class Form1 Public VECT(99), I As Integer Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click VECT(I) = TextBox1.Text ListBox1.Items.Add(VECT(I)) I = I + 1 TextBox1.Clear() TextBox1.Focus() End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim NUM, K, X As Integer NUM = TextBox2.Text K = I - 1 For I = 0 To K If VECT(I) = NUM Then X = X + 1 End If Next TextBox3.Text = X End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click TextBox1.Clear() TextBox2.Clear() TextBox3.Clear() ListBox1.Items.Clear()

End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click End Sub End Class

Ejercicio N5:
Public Class Form1 Public A(14), B(14), C(14), I As Integer Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click A(I) = TextBox1.Text ListBox1.Items.Add(A(I)) B(I) = TextBox2.Text ListBox2.Items.Add(B(I)) I = I + 1 End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim K, WMAYOR As Integer K = I - 1 For I = 0 To K C(I) = A(I) + B(I) ListBox3.Items.Add(C(I)) If C(I) > WMAYOR Then WMAYOR = C(I) End If Next TextBox3.Text = WMAYOR

End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click End Sub End Class

Ejercicio N7
Public Class Form1 Public A(19), I As Integer Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click A(I) = TextBox1.Text ListBox1.Items.Add(A(I)) I = I + 1 End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim K, NRO, X As Integer K = I - 1 NRO = TextBox2.Text For I = 0 To K If A(I) = NRO Then X = X + 1 End If Next If X > 0 Then TextBox3.Text = "<<EXISTE>>" Else TextBox3.Text = "<<NO EXISTE>>" End If End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click End Sub End Class

You might also like