Vous êtes sur la page 1sur 30

Private Sub Cmdcalcular_Click()

Dim b As Double
Dim h As Double
Dim area As Double

b = Val(Txtbase.Text)
h = Val(Txtaltura.Text)
area = (b * h / 2)
MsgBox ("el area es :" & area)
End Sub

Private Sub cmdsalir_Click()


End
End Sub

Private Sub Command1_Click()


Dim ht, he, hr, sueldo As Integer
ht = InputBox("ingrese horas trabajadas")
he = InputBox("ingrese horas extras")
hr = InputBox("ingrese horas retraso")
sueldo = (ht * 80 + he * 160) - (hr * 90)
MsgBox ("el sueldo es:" & sueldo & "bs")
End Sub

Private Sub Command1_Click()


Dim r As Double
Dim l As Double
Dim s As Double
Dim v As Double
Const pi = 3.1416
r = InputBox("ingrese el radio de la circunferencia")
l = 2 * pi * r
MsgBox ("la longitud es :" & l)
s = pi * r * r
MsgBox ("la superficie es :" & s)
v = 4 * pi * r * r * r / 3
MsgBox ("el volumen es: " & v)
End Sub

.
Private Sub Command1_Click()
Dim a, b As Integer
Dim s As Integer
Dim r As Integer
Dim m As Integer
Dim c As Double
a = InputBox("ingrese el primer numero")
b = InputBox("ingrese el segundo numero")
s=a+b
MsgBox ("la suma es:" & s)
r=a-b
MsgBox ("la resta es:" & r)
m=a*b
MsgBox ("la multiplicacion es:" & m)
c=a/b
MsgBox ("el cociente es:" & c)
End Sub

.

Private Sub Command1_Click()


Dim a As Integer
Dim b As Integer
Dim s As Integer

a = InputBox("ingrese numero")
b = InputBox("ingrese numero")
s=a+b
MsgBox ("la suma...." & s)
End Sub

..

Private Sub Command1_Click()


Dim a As Integer
Dim b As Integer
Dim c As Double
Dim r As Integer
Dim p As Integer

a = InputBox("ingrese num")
b = InputBox("ingerese num")
c=a/b
MsgBox ("la division normal es:" & c)
p = a Mod b
MsgBox ("el residuo es:" & p)
r=a\b
MsgBox ("la divisuion entera es :" & r)
End Sub
Private Sub Command2_Click()
End
End Sub

Private Sub Commandverificar_Click()


Dim numero As Integer
Txtsalida.Text = ""
numero = InputBox("ingrese numero")
If numero > 0 Then
Txtsalida.Text = "es numero natural"
End If
End Sub

Private Sub Command1_Click()


Dim n As Integer
n = InputBox("ingrese numero")
If n = 0 Then
MsgBox (n & "es neutro")
End If
If n > 0 Then
MsgBox (n & "es positivo")
End If
If n < 0 Then
MsgBox (n & "es negativo")
End If
End Sub

Private Sub Command1_Click()


Dim a As Integer
Dim b As Integer
Dim s As Integer
a = InputBox("ingre njumero")
b = InputBox("ingre njumero")
If a > 0 And b > 0 Then
s=a+b
MsgBox ("la suma es:" & s)
End If
End Sub

Private Sub Command1_Click()


Dim a As Integer
Dim b As Integer
Dim c As Integer
a = InputBox("ingrese numero")
b = InputBox("ingrese numero")
c = InputBox("ingrese numero")
If (a > b And b > c) Then
MsgBox ("mayor:" & a & "menor:" & c)
End If
If (a > c And c > b) Then
MsgBox ("mayor:" & a & "menor:" & b)
End If
End Sub

Private Sub Command1_Click()


Dim nota As Integer
nota = InputBox("ingrse nota")
Txtsalida.Text = ""
If nota >= 51 Then
Txtsalida.Text = "aprobado"
Else
Txtsalida.Text = "reprobado"
End If
End Sub

..

Private Sub Command1_Click()


Dim n As Integer
n = InputBox("ingrese numero")
Text1.Text = n
If n > 0 Then
MsgBox (n & "es positivo")
Else
If n < 0 Then
MsgBox (n & "es negativo")
Else

MsgBox (n & "es neutro")

End If
End If
End Sub

Private Sub Command1_Click()


Dim nota As Integer
nota = InputBox("ingrese la nota")
txtsalida.Text = ""
If nota > 0 And nota < 101 Then
If nota > 50 Then
MsgBox ("aprobado:" & nota)
txtsalida.Text = nota
Else
If nota < 51 Then
MsgBox ("reprobado:" & nota)
txtsalida.Text = nota
End If
End If
Else
MsgBox ("error:")
txtsalida.Text = nota
End If
End Sub

Private Sub Command1_Click()


a = InputBox("ingrese dia 1 al 7")
If (a >= 1) And (a < 8) Then
If a = 1 Then
MsgBox ("lunes")
End If
If a = 2 Then
MsgBox ("martes")
End If
If a = 3 Then
MsgBox ("miercoles")
End If
If a = 4 Then
MsgBox ("jueves")
End If
If a = 5 Then
MsgBox ("viernes")
End If
If a = 6 Then
MsgBox ("sabado")
End If
If a = 7 Then
MsgBox ("domingo")
End If
Else
MsgBox ("no pertenece al dia de la semana")
End If
End Sub

Private Sub Command1_Click()


Dim n As Integer
n = InputBox("ingrese numero")
If n > 0 Then
MsgBox (n & "es positivo")
Else
If n < 0 Then
MsgBox (n & "es negativo")
Else

MsgBox (n & "es neutro")

End If
End If
End Sub

Private Sub Command1_Click()


Dim n As Integer
n = InputBox("ingrese numero")
If (n Mod 2 = 0 Or n Mod 3 = 0) And Not (n Mod 5 = 0) Then
MsgBox ("es")
Else
MsgBox ("no es")
End If
End Sub

Private Sub Command1_Click()


Dim t As Integer
t = InputBox("ingrese temperatura")
If t > 89 And t < 101 Then
MsgBox ("funcionamiemto reactor octimo")
Else
If t > 100 Then
MsgBox ("peligro funcionamiento critico")
Else
If t >= 50 And t < 90 Then
MsgBox ("funcionamiemto no optimo")
Else
If t < 50 Then
MsgBox ("funciomiento no correcto apagar reactor")
End If
End If
End If
End If
End Sub

..
rivate Sub Command1_Click()
Dim nota As Double
nota = InputBox("ingresar nota entre 0-10")
Txtsalida.Text = ""
If nota < 5 Then
Txtsalida.Text = "reprobado"
Else
If nota >= 5 And nota < 7 Then
Txtsalida.Text = "aprobado"
Else
If nota >= 7 And nota < 9 Then
Txtsalida.Text = "notable"
Else
If nota >= 9 And nota < 10 Then
Txtsalida.Text = "sobresaliente "
Else
Txtsalida.Text = "excelente"
End If
End If
End If
End If
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Command1_Click()
Dim n As Integer
n = InputBox("ingrese dia de semana")
If n = 1 Then
MsgBox ("el dia es lunes")
Else
If n = 2 Then
MsgBox ("el dia es martes")
Else
If n = 3 Then
MsgBox ("el dia es miercoles")
Else
If n = 4 Then
MsgBox ("el dia es jueves")
Else
If n = 5 Then
MsgBox ("el dia es viernes")
Else
If n = 6 Then
MsgBox ("el dia es sabado")
Else
If n = 7 Then
MsgBox ("el dia es domingo")
Else
MsgBox ("no pertece al dia semana")
End If
End If
End If
End If
End If
End If

End If
End Sub

..

Private Sub Command1_Click()


Dim n As Integer
n = InputBox("ingrese numero")
Select Case n
Case 1
MsgBox ("lunes")
Case 2
MsgBox ("martes")
Case 3
MsgBox ("miercoles")
Case 4
MsgBox ("jueves")
Case 5
MsgBox ("viernes")
Case 6
MsgBox ("sabado")
Case 7
MsgBox ("domingo")
Case Else
MsgBox ("lo sentimoe error")
End Select
End Sub

Private Sub Form_Load()

End Sub
Private Sub Command1_Click()
Dim n1 As Integer
Dim n2 As Integer
Dim n3 As Integer
n1 = InputBox("ingrese el primer numero")
n2 = InputBox("ingrese el segundo numero")
n3 = InputBox("ingrese el tercer numero")
If (n1 > n2 And n1 > n3) Then
may = n1
Else
If (n2 > n1 And n2 > n3) Then
may = n2
Else
may = n3
End If
End If
MsgBox ("el numero mayor es;" & may)
End Sub

Private Sub Command1_Click()


Dim n1 As Integer
Dim n2 As Integer
Dim n3 As Integer
n1 = InputBox("ingrese el primer numero")
n2 = InputBox("ingrese el segundo numero")
n3 = InputBox("ingrese el tercer numero")
If (n1 > n2 And n1 > n3) Then
may = n1
If n2 > n3 Then
medio = n2
menor = n3
Else
medio = n3
menor = n2
End If
MsgBox (may & "mayor" & medio & "MEDIO" & menor & "menor")
Else
If (n2 > n1 And n2 > n3) Then
may = n2
If n1 > n3 Then
medio = n1
menor = n3
Else
medio = n3
nenor = n1
End If
MsgBox (may & "mayor" & medio & "MEDIO" & menor & "menor")
Else
may = n3
If n1 > n2 Then
medio = n1
menor = n2
Else
medio = n2
menor = n1
End If
MsgBox (may & "mayor" & medio & "MEDIO" & menor & "menor")
End If
End If
End Sub

Private Sub cmdverificar_Click()


Dim edad As Integer
edad = Val(TxtEdad.Text)
If (edad >= 18) Then
MsgBox ("puede ingresar")
Else
MsgBox (" no puede ingresar")
End If
End Sub

Private Sub Command1_Click()


Dim n As Integer
n = InputBox("ingrse nmero")
If n = 0 Then
MsgBox ("es cero")
Else
If n Mod 2 = 0 Then
MsgBox ("es par")
Else
MsgBox ("es impar")
End If
End If
End Sub

Private Sub Command1_Click()


Dim n As Integer
n = InputBox("ingrese numero")
If (n Mod 7 = 0 And n Mod 2 = 0) Then
MsgBox ("es multiplo de 7 y par")
Else
MsgBox ("no cumple")
End If
End Sub

..

Private Sub Command1_Click()


Dim a As Integer
Dim b As Integer
a = InputBox("ingrese numero")
b = InputBox("ingrese numero")
If a = b Then
MsgBox ("son iguales")
Else
If a > b Then
MsgBox ("el mayor" & a)
Else
MsgBox ("el mayor" & b)
End If
End If
End Sub

Private Sub Command1_Click()


Dim x As Integer
Dim y As Integer
x = InputBox("ingrese numero")
0 y = InputBox("ingrese numero")
If x <> 0 And y <> 0 Then
If x > 0 And y > 0 Then
MsgBox ("cuadrante I")
Else
If x < 0 And y > 0 Then
MsgBox ("cuadrante II")
Else
If x < 0 And y < 0 Then
MsgBox ("cuadrante III")
Else
MsgBox ("cuadrante IV")
End If
End If
End If
Else
MsgBox ("falla error")
End If
End Sub

Private Sub Cmdcalcular_Click()


Dim a As Double
Dim b As Double
Dim c As Double
Dim x1 As Double
Dim x2 As Double
a = Txta.Text
b = Txtb.Text
c = Txtc.Text
x1 = (-b + sqrt * (b ^ 2 - 4 * a * c)) / 2 * a
x2 = (-b - sqrt * (b ^ 2 - 4 * a * c)) / 2 * a
Lblresp1.Caption = ("respuesta 1:::...." & x1)
Lblresp2.Caption = ("respuesta 2:::..." & x2)
End Sub
Private Sub Cmdinicio_Click()
Dim a As Double
Dim b As Double
Dim c As Double
Dim x1 As Double
Dim x2 As Double
Dim d As Double
a = Txta.Text
b = Txtb.Text
c = Txtc.Text
d=b^2-4*a*c
If d >= 0 Then
x1 = (-b + sqrt * (b ^ 2 - 4 * a * c)) / 2 * a
Lblresp1.Caption = ("respuesta 1:::...." & x1)
x2 = (-b - sqrt * (b ^ 2 - 4 * a * c)) / 2 * a
Lblresp2.Caption = ("respuesta 2:::..." & x2)
Else
MsgBox ("error no tiene solucion real")
End If
End Sub

Private Sub Command1_Click()


Dim n As Integer
Dim k As Integer
Dim i As Integer
n = InputBox("ingrese un numero")
If n > 0 Then
i=1
k=0
While i <= n
If n Mod i = 0 Then
List1.AddItem i
k=k+1
End If
i=i+1
Wend
Text1.Text = k 'Numero de divisores'
Else
MsgBox ("ingrese un numero positivo")
End If
End Sub
Private Sub Command2_Click()
End
End Sub

..

Private Sub Command1_Click()


Dim n As Integer
n = InputBox("leer #")
If n > 0 Then
fact = 1
While n <> 0
fact = fact * n
n=n-1
Text1.Text = fact
Wend
Else
If n = 0 Then
fact = 1
Else
MsgBox ("otro # que sea positivo")
End If
End If
End Sub
Private Sub Command2_Click()
End
End Sub

Private Sub Command1_Click()


Dim a As Integer
Dim b As Integer
Dim c As Integer
a = InputBox("leer #")
If a > 0 Then
b=1
c=0
While b < a
If a Mod b = 0 Then
c=c+b
End If
b=b+1
Wend
If c = a Then
MsgBox ("a es perfecto")
Else
MsgBox ("a no es perfecto")
End If

Else
MsgBox ("error")
End If
End Sub

Private Sub Command2_Click()


End
End Sub

Private Sub Command1_Click()


N = InputBox(" ingrese #")
Dim aux As Integer
Dim resp As Integer
Dim b As Integer
b=N
aux = 0
While b > 0
dig = b Mod 10
b = b \ 10
aux = aux * 10 + dig
List1.AddItem aux
Wend
If aux = N Then
Text1.Text = (" es espejo")
Else
Text1.Text = ("no es espejo")
End If
end
End Sub

Private Sub Command1_Click()


Dim a As Integer
Dim b As Integer
Dim c As Integer
Dim cont As Integer
Dim n As Integer
Lstsalida.Clear
a=0
b=1
n = Txtentrada.Text
cont = 0
While cont < n
Lstsalida.AddItem (a)
c=a+b
a=b
b=c
cont = cont + 1
Wend
End Sub

Private Sub Command1_Click()


Dim n As Integer
Dim d As Integer
n = InputBox("ingrese numero")
If n >= 100 And n < 1000 Then
d = n Mod 10
List1.AddItem d
n = n \ 10
d = n Mod 10
List1.AddItem d
n = n \ 10
d = n Mod 10
List1.AddItem d
Else
MsgBox ("no corresponde")
End If
End Sub

Private Sub Command1_Click()


Dim n As Integer
Dim d As Integer
Dim c As Integer
List1.Clear

n = InputBox("ingrese numero")
While n > 0
d = n Mod 10
List1.AddItem d
n = n \ 10
Wend
End Sub

Private Sub Command1_Click()


Dim n As Integer
Dim cd As Integer
Dim d As Integer
n = InputBox("ingrese numero")
If n > 0 Then
cd = 0
d=1
While d <= n
If n Mod d = 0 Then
cd = cd + 1
End If
d=d+1
Wend
If cd = 2 Then
MsgBox (n & "es prrimo")
Else
MsgBox ("es compuesto")

End If
Else
MsgBox ("no correswponde")
End If
End Sub

Private Sub Command1_Click()


n = 20
While n <= 70
If (n Mod 7 = 0) Then
List1.AddItem (n)
End If
n=n+1
Wend
End Sub

Private Sub Command1_Click()


Dim n As Integer
Dim n1 As Integer
Dim aux As Integer
Dim dig As Integer
n = InputBox("ingrese numeeero")
aux = n
n1 = 0
While n > 0
dig = n Mod 10
n = n \ 10
n1 = n1 * 10 + dig
Wend
If n1 = aux Then
MsgBox (n1 & "es espejo")
Else
MsgBox ("No es espejo")
End If
End Sub

Private Sub Command1_Click()


Dim n As Integer
Dim dig As Integer
n = InputBox("ingrese numero")
While n > 0
dig = n Mod 10
n = n \ 10
If (dig Mod 2 = 0) Then
List1.AddItem (dig)
End If
Wend
End Sub

.

Private Sub Command1_Click()


Dim n As Integer
Dim dig As Integer
n = InputBox("ingrese numero")
c=0
s=0
While n > 0
dig = n Mod 10
n = n \ 10
If (dig Mod 2 = 0) Then
List1.AddItem (dig)
c=c+1
s = s + dig
End If
Wend
MsgBox ("son" & c & "diguitos pares")
MsgBox ("la sumA es" & s)
End Sub

Private Sub Command1_Click()


Dim n As Integer
Dim cont As Integer
n = InputBox("ingrese num")
cont = 0
While n > 0
n = n \ 10
cont = cont + 1
Wend
MsgBox ("cantidad de diguitos " & cont)

End Sub

Private Sub Command1_Click()


Dim n As Integer
Dim may As Integer
Dim men As Integer
Dim cont As Integer
Dim suma As Integer
Dim pm As Double
n = InputBox("ingrese numeros")
cont = 0
suma = 0
may = n
men = n
While n <> 0
cont = cont + 1
If n > may Then
may = n
End If
If n < men Then
men = n
End If
suma = suma + n
n = InputBox("ingrese numeros")
Wend
pm = suma / cont
MsgBox ("la cantidad de num es ; " & cont)
MsgBox ("el mayor es ; " & may)
MsgBox ("el menor es ; " & men)
MsgBox ("la media es ; " & pm)
End Sub

Private Sub Command1_Click()


Dim n As Integer
Dim suma As Integer
Dim d As Integer
n = InputBox("ingrese numero")
While n > 9
suma = 0
While n > 0
d = n Mod 10
suma = suma + d ^ 2
n = n \ 10
Wend
n = suma
Wend
If n = 1 Then
MsgBox ("es un mumero felis")
Else
MsgBox ("no es un mumero felis")
End If
End Sub

..

Private Sub Command1_Click()


Dim n As Integer
Dim d As Integer
n = InputBox("ingresde numero")
While n > 0
d = n Mod 10
List1.AddItem (n)
n = n \ 10
Wend
End Sub

..

Private Sub Command1_Click()


Dim n As Integer
Dim m As Integer
Dim cn As Integer
Dim cm As Integer
Dim s As Integer
Dim i As Integer
Dim l As Integer
Dim p As Integer
n = InputBox("ingrese primer numero")
m = InputBox("ingrese segundo numero")
If (n > 0 And m > 0) And n <> m Then
i=1
cn = 0
cm = 0
While i <= n
If n Mod i = o Then
cn = cn + 1
End If
i=i+1
Wend
MsgBox ("cuantas veces es contado cn:::" & cn)
MsgBox ("cuantas veces es contado i=n::" & i - 1)
l=1
While l <= m
If m Mod l = 0 Then
cm = cm + 1
End If
l=l+1
Wend
MsgBox ("cuantas veces es contado cm:::" & cm)
MsgBox ("cuantas veces es contado l=m::" & l - 1)
If (cn = 2 And cm = 2) Then
p=n*m
MsgBox ("el producto de los numeros primos es:" & p)
Else
MsgBox ("uno o ambos no es primo")
End If
Else
MsgBox ("el numero es incorrecto intente de nuevo:")
End If
End Sub

Vous aimerez peut-être aussi