Geografia

Páginas: 2 (258 palabras) Publicado: 29 de septiembre de 2012
General Function Par(P As Integer) As Boolean
Par = True
If P Mod 2 <> 0 Then
Par = False
End If
End Function
General Function divisor(n As Integer, D AsInteger) As Boolean
If (n Mod D) = 0 Then
divisor = True
Else
divisor = False
End If
End Function
Private Sub Borre_Click()
E1.Text = ""
E1.SetFocusDivs.Text = ""
Sum.Text = ""
Mensaje.Caption = " "
End Sub
Private Sub Evalua_Click()
Dim i As Integer, suma As Integer, valor As Integer, tipo As String
valor = Val(E1.Text)suma = 0
Divs.Text = ""
If valor > 1 Then
For i = 1 To valor / 2
If divisor(valor, i) Then
Divs.Text = Divs.Text & i & vbCrLfsuma = suma + i
End If
Next i
If Par(valor) Then
tipo = "Par"
Else
tipo = "Impar"
End If
Sum.Text =suma
If suma = valor Then
Mensaje.Caption = valor & " es un número: Perfecto"
MsgBox valor & " es un Número " & tipo & " y Perfecto",vbInformation, "Propiedades del Número"
ElseIf suma < valor Then
Mensaje.Caption = valor & " es un número: Deficiente"
MsgBox valor & " es un Número " &tipo & " y Deficiente", vbInformation, "Propiedades del Número"
Else
Mensaje.Caption = vr & " es un número: Abundante"
MsgBox valor & " es un Número "& tipo & " y Abundante", vbInformation, "Propiedades del Número"
End If
Else
MsgBox "Número ingresado es Menor de 2", vbCritical, "Error de Lectura"E1.Text = ""
E1.SetFocus
End If
End Sub
Private Sub Salir_Click()
Dim s As Integer
s = MsgBox("Realmente desea Salir?", vbYesNo, "Terminar")
If s = 6 Then
End
End If
End Sub
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Geografia
  • Geografia
  • Geografia
  • Geografia
  • Geografia
  • Geografía
  • Geografia
  • Geografia

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS