You are on page 1of 4

PRIMERA PRACTICA DE INFORMATICA APLICADA A LA INGENIERIA

Public Class Form1


Public wmenor As Integer = 999999
Public sp, si As Integer
Public wmayor, suma, x As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
Dim numero, par, impar As Integer
numero = TextBox1.Text
ListBox1.Items.Add(numero)
If numero > wmayor Then
wmayor = numero
End If
If numero < wmenor Then
wmenor = numero
End If
If numero Mod 2 = 0 Then
par = numero
sp = sp + par
End If
If numero Mod 2 <> 0 Then
impar = numero
si = si + impar
End If
suma = suma + numero
x=x+1
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button2.Click
Dim prom As Double
prom = suma / x
TextBox2.Text = wmayor
TextBox3.Text = wmenor
TextBox4.Text = prom
TextBox5.Text = Sp
TextBox6.Text = si
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 = ""
TextBox4.Text = ""
ListBox1.Items.Clear()
End Sub
End Class

You might also like