This document contains code for three different programs that perform various operations on arrays and vectors. The first program allows the user to input numbers into an array and finds the largest number. The second program counts how many times a number occurs in a vector. The third program checks if a number exists in a vector and displays a message.
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 ratings0% found this document useful (0 votes)
37 views
Ejercicio 1: Form1 Object Eventargs
This document contains code for three different programs that perform various operations on arrays and vectors. The first program allows the user to input numbers into an array and finds the largest number. The second program counts how many times a number occurs in a vector. The third program checks if a number exists in a vector and displays a message.
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/ 5
EJERCICIO 1
Public Class Form1
Public NRO(19), I,K,W1 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 As Integer K = I - 1 For I = 0 To K If NRO(I) > WMAYOR Then WMAYOR = NRO(I) W1 = I
End If Next TextBox2.Text = WMAYOR TextBox3.Text = W1 End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" ListBox1.Items.Clear() For I = 0 To K NRO(I) = 0 Next W1 = 0 I = 0
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button4.Click End End Sub End Class
Public Class Form1
Public VECT(99), I As Integer Public 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 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 End Sub End Class
Public Class Form1
Public A(14), B(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 B(I) = TextBox2.Text ListBox1.Items.Add(A(I)) 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 C(14), 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
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button4.Click End End Sub End Class
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 End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click Dim K, NUM, C As Integer K = I - 1 NUM = TextBox2.Text For I = 0 To K If NRO(I) = NUM Then C = C + 1 End If Next If C = 0 Then
TextBox3.Text = "NO SE ENCUENTRA EN EL VECTOR"
Else TextBox3.Text = "SI SE ENCUENTRA EN EL VECTOR"
End If 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 End Sub End Class