You are on page 1of 2

EJERCICIO 3

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button1.Click
Dim DIA, MES, AÑO As Integer
DIA = TextBox1.Text
MES = TextBox2.Text
AÑO = TextBox3.Text
If AÑO > 1990 Then
Select Case MES
Case 1, 3, 5, 7, 8, 10, 12
If DIA <= 31 Then
TextBox4.Text = "FECHA VALIDA"
Else
TextBox4.Text = "FECHA INVALIDA"
End If
Case 4, 6, 9, 11
If DIA <= 30 Then
TextBox4.Text = "FECHA VALIDA"
Else
TextBox4.Text = "FECHA INVALIDA"
End If
Case 2
If AÑO Mod 4 = 0 Then
If DIA <= 29 Then
TextBox4.Text = "FECHA VALIDA"
Else
TextBox4.Text = "FECHA INVALIDA"
End If
Else
If DIA <= 28 Then
TextBox4.Text = "FECHA VALIDA"
Else
TextBox4.Text = "FECHA INVALIDA"
End If
End If
End Select
Else
TextBox4.Text = "FECHA INVALIDA"
End If

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button2.Click

End Sub
End Class
EJERCICIO 5
Public TIPO, P, P1, P2, P3, P4, P5, A, C, CAM, O, OT As Integer
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
TIPO = TextBox1.Text
P = TextBox2.Text
ListBox1.Items.Add(TIPO)
ListBox2.Items.Add(P)
Select Case TIPO
Case 1 : P1 = P1 + 1
A = A + P
Case 2 : P2 = P2 + 1
C = C + P
Case 3 : P3 = P3 + 1
CAM = CAM + P
Case 4 : P4 = P4 + 1
O = O + P
Case 5 : P5 = P5 + 1
OT = OT + P
Case Else
MessageBox.Show("ERROR")
End Select

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button1.Click
TextBox3.Text = P1
TextBox4.Text = P2
TextBox5.Text = P3
TextBox6.Text = P4
TextBox7.Text = P5
TextBox8.Text = A
TextBox9.Text = C
TextBox10.Text = CAM
TextBox11.Text = O
TextBox12.Text = OT
End Sub

You might also like