Dim Datoa

Páginas: 4 (845 palabras) Publicado: 14 de marzo de 2013
Dim datos(1 To 3, 1 To 3) As String
Private Sub Command1_Click()
For i = 1 To 3 Step 1
datos(i, 1) = InputBox("Ingrese Nombre")
datos(i, 2) = InputBox("Ingrese Edad")
datos(i, 3) =InputBox("Ingrese sexo")
List1.AddItem (datos(i, 1) & " " & datos(i, 2) & " " & datos(i, 3))
Next i
End Sub
Private Sub Command2_Click()
Dim cont As Integer
cont = 0
For i= 1 To 3 Step 1
If (datos(i, 3) = "M" And Val(datos(i, 2)) >= 18) Then
cont = cont + 1
List2.AddItem (datos(i, 1) & " " & datos(i, 2) & " " & datos(i, 3))End If
Next i
List2.AddItem ("Total: " & cont)
End Sub

Private Sub Command3_Click()
Dim cont2 As Integer
con2t = 0
For i = 1 To 3 Step 1
If (datos(i, 3) = "F" And Val(datos(i,2)) < 18) Then
cont2 = cont2 + 1
List3.AddItem (datos(i, 1) & " " & datos(i, 2) & " " & datos(i, 3))
End If
Next i
List3.AddItem ("Total: " & cont2)
EndSub
Private Sub Command4_Click()
Dim mayores As Integer
Dim porcentajeMay As Integer
mayores = 0
For i = 1 To 3 Step 1
If (Val(datos(i, 2)) >= 18) Then
mayores = mayores + 1End If
Next i
Label1.Caption = "Mayores de edad: " & mayores
porcentajeMay = (mayores * 100) \ 3
Label3.Caption = "Porcentaje: " & porcentajeMay & "%"
End Sub

Private SubCommand5_Click()
Dim menores As Integer
Dim porcentajeMen As Integer

menores = 0
For i = 1 To 3 Step 1
If (Val(datos(i, 2)) < 18) Then
menores = menores + 1
End If
Next iLabel2.Caption = "Menores de edad: " & menores
porcentajeMen = (menores * 100) \ 3
Label4.Caption = "Porcentaje: " & porcentajeMen & "%"
End Sub

Dim personas(1 To 3, 1 To 3) As StringPrivate Sub Command1_Click()
For i = 1 To 3 Step 1
personas(i, 1) = InputBox("Ingrese NOmbre")
personas(i, 2) = InputBox("Ingrese Edad")
personas(i, 3) = InputBox("Ingrese sexo")...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • datoa
  • Dimar
  • Dimer
  • dime
  • Dimar
  • Dimas
  • dime
  • dimas

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS