viernes, 14 de noviembre de 2008

COMENTARIOS RESPECTO AL GRUPO


EL GRUPO, ES UNA PEQUEÑA COMUNIDAD MUY UNIDA PUES SE LE AYUDA AL QUE NESECITA ESA AYUDA, SIN PONERLE NINGUN OBSTACULO, ESTA COMUNIDAD ES UN POCO PEQUEÑA.
ESTA ES MUY AMIGALE, PUES A LA HORA DE COMPARTIR SON MUY AMPLIOS PUES NO LES IMPORTA QUE ELLOS TENGAN LO MISMO QUE UNO TIENE, PORQUE DE ESO EN REALIDAD SE TRATA LA COMUNIDAD DE COLABORARSEN LOS UNOS CON OTROS.

COMENTARIOS HACERCA DE LA MATERIA


RESPECTO A LA MATERIA ME PARESE QUE LA METODOLOGIA QUE IMPLANTA EL DOCENTE ES BUENA, DINAMICA PORQUE PRIMERO QUE TODO NOS HACE UNA GRAN INDUCCION HACERCA DEL TEMA QUE VAMOS O ESTAMOS VIENDO, MOSTRANDONOS VIDEOS HACERCA DE LA HISTORIA DE LAS GRANDES MULTINACIONALES QUE HAN INFLUIDO DEMASIADO EN LA HISTORIA DE LA COMPUTACION COMO APPLE.


CRONOGRAMA DE ACTIVIDADES

EL ANTERIOR CUADRO MUESTRA LAS ACTIVIDADES QUE SE DESARROLLARON DURANTE EL SEMESTRE, AL FRENTE LES MUESTRA EN QUE DIA SE SOLUCIONARON LOS ANTERIORES PROGRAMAS.

miércoles, 12 de noviembre de 2008

CREACION DEL MENU


Private Sub menu_cuadrado_Click()
FIG.Shape = square
menu_cuadrado.Checked = True
menu_circulo.Checked = False
End Sub

Private Sub menu_delgado_Click()
FIG.BorderWidth = 1
menu_delgado.Checked = True
menu_grueso.Checked = False
End Sub

Private Sub menu_grueso_Click()
FIG.BorderWidth = 20
menu_grueso.Checked = True
menu_delgado.Checked = False
End Sub

Private Sub menu_ovalo_Click()
FIG.Shape = oval
menu_cuadrado.Checked = False
menu_ovalo.Checked = True
End Sub


Private Sub menu_salir_Click()
End
End Sub


VALIDAR SI LOS NUMEROS SON IGUALES


Dim num1 As Integer
Dim num2 As Integer

Private Sub Command1_Click()
If num1 = num2 Then
Text3.Text = "LOS NUMEROS SON IGUALES"
ElseIf num1 > num2 Then
Text3.Text = num1
Else
Text3.Text = num2
End If
End Sub

Private Sub Command2_Click()
Text1.Text = " "
Text2.Text = " "
Text3.Text = " "
Text1.SetFocus
End Sub

Private Sub Command3_Click()
End
End Sub

Private Sub Text1_Change()
If Text1.Text <> " " Then
num1 = Val(Text1.Text)
End If
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii <> 57 Then
KeyAscii = 0
End If
End Sub

Private Sub Text2_Change()
If Text2.Text <> " " Then
num2 = Val(Text2.Text)
End If
End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii <> 57 Then
KeyAscii = 0
End If
End Sub

Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii <> 57 Then
KeyAscii = 0
End If
End Sub

TABLAS DE MULTIPLICAR HASTA 1000



Dim num As Integer
Dim resultado As Double

Private Sub BOTONBORRAR_Click()
NUMERO.Text = " "
TABLA.Clear
NUMERO = 0
NUMERO.SetFocus
End Sub

Private Sub BOTONCALCULAR_Click()
If NUMERO.Text = " " Then
MsgBox "DEBE DIGITAR UN NUMERO", 16, "ERROR"
NUMERO.SetFocus
Else
For CONT = 1 To 1000
resultado = num * CONT
TABLA.AddItem " " & num & " x " & CONT & " = " & resultado
Next
End If
End Sub

Private Sub BOTONSALIR_Click()
End
End Sub

Private Sub NUMERO_Change()
If NUMERO.Text <> " " Then
num = NUMERO.Text
End If
End Sub

Private Sub NUMERO_KeyPress(KeyAscii As Integer)
If KeyAscii <> 57 Then
KeyAscii = 0
End If
End Sub

SOLUCIONES DE LA ECUACION


Dim b As Double
Dim c As Double
Dim h1 As Double
Dim x2 As Double
Dim a As Double
Dim res As Double


Private Sub Command1_Click()
If a < a =" a" b =" b" c =" c"> 0 Then
x1 = (-b + Sqr(b * b - 4 * a * c)) / (2 * a)
x2 = (-b - Sqr(b * b - 4 * a * c)) / (2 * a)

Text4.Text = x1
Text5.Text = x2
Else
MsgBox ("Los valores no son validos")

End If
ElseIf b * b - 4 * a * c > 0 Then
x1 = (-b + Sqr(b * b - 4 * a * c)) / (2 * a)
x2 = (-b - Sqr(b * b - 4 * a * c)) / (2 * a)

Text4.Text = x1
Text5.Text = x2
Else
MsgBox ("Escriba bien los valores")
End If

End Sub

Private Sub Command2_Click()
Text1.Text = " "
Text2.Text = " "
Text3.Text = " "
Text4.Text = " "
Text5.Text = " "
Text1.SetFocus
a = 0
b = 0
c = 0

End Sub

Private Sub Command3_Click()
End
End Sub

Private Sub Text1_Change()
If Text1.Text <> " " Then
a = Val(Text1.Text)
End If
End Sub

Private Sub Text2_Change()
If Text2.Text <> " " Then
b = Val(Text2.Text)
End If
End Sub

Private Sub Text3_Change()
If Text3.Text <> " " Then
c = Val(Text3.Text)
End If
End Sub

SERVICIO MILITAR OBLIGATORIO

Dim sexo As Integer
Dim nacion As Integer
Dim edad As Integer

Private Sub Command1_Click()
Text1.Text = " "
Text2.Text = " "
Text3.Text = " "
Text1.SetFocus
End Sub

Private Sub Command2_Click()
End
End Sub

Private Sub Command3_Click()
If edad > 17 And edad < 26 Then
If sexo = 1 Then
If nacion = 1 Then
MsgBox (" es apto")
Else
MsgBox (" no es apto")
End If
Else
MsgBox (" no es apto")
End If
Else
MsgBox (" no es apto")
End If
End Sub

Private Sub Text1_Chalge()
If Text1.Text <> " " Thdn
edad = Val(Text1.Text)
End If
Ejd Sub

Private Sub Text2_Change()
If Text".Text <> " " Then
sexo = Val(Text2*Text)
End If
End Sub

Private Sub Text3_Change((
If Text3.Text << " " Then
nacion = Val(Text3.Text)
End If
End Sub

PROGRAMAS QUE PIDAN CLAVE DE ACCESO


PRESTAMO DE UN BANCO POR UN AÑO

Private Sub Command1_Click()
Text3.Text = Val(Text1.Text) * Val(Text2.Text) * Val(12) / Val(100)
End Sub

Private Sub Command2_Click()
Text1.Text = " "
Text2.Text = " "
Text3.Text = " "
Text1.SetFocus
End Sub

Private Sub Command3_Click()
End
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii <> 57 Then
KeyAscii = 0
End If
End Sub

Private Sub Text2_Change()
If Text2.Text <> " " Then
NUM2 = Val(Text2.Text)
End If
End Sub

Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii <> 57 Then
KeyAscii = 0
End If
End Sub


ORDENAR CUATRO NUMEROS EN FORMA DESCENDENTE

Dim num1, num2, num3, num4 As Integer
Dim mayor, medio, menor, medio1 As Double


Private Sub Command1_Click()
If num1 = num2 And num2 = num3 And num3 = num4 And num1 = num4 Then
Label10.Caption = "todos los numeros son iguales"
Else
If num1 = num2 And num2 = num3 Then
Label10.Caption = "primero, segundo y tercero son iguales"
If num2 > num4 Then
mayor = num2
menor = num4
Else
mayor = num4
menor = num2
End If
Label5.Caption = "Numero mayor: " & mayor
Label6.Caption = "Numero menor: " & menor
Else
If num1 = num2 And num2 = num4 Then
Label10.Caption = "primero, segundo y cuarto son iguales"
If num2 > num3 Then
mayor = num2
menor = num3
Else
mayor = num3
menor = num2
End If
Label5.Caption = "Numero mayor: " & mayor
Label6.Caption = "Numero menor: " & menor
Else
If num1 = num3 And num3 = num4 Then
Label10.Caption = "primero, tercero y cuarto son iguales"
If num1 > num2 Then
mayor = num1
menor = num2
Else
mayor = num2
menor = num1
End If
Label5.Caption = "Numero mayor: " & mayor
Label6.Caption = "Numero menor: " & menor
Else
If num2 = num3 And num3 = num4 Then
Label10.Caption = "segundo, tercero y cuarto son iguales"
If num1 > num2 Then
mayor = num1
menor = num2
Else
mayor = num2
menor = num1
End If
Label5.Caption = "Numero mayor: " & mayor
Label6.Caption = "Numero menor: " & menor
Else
If num1 = num2 And num3 <> num4 Then
Label10.Caption = "primero y el segundo son iguales"
If num1 > num3 And num1 > num4 Then
mayor = num1
If num3 > num4 Then
medio = num3
menor = num4
Else
medio = num4
menor = num3
End If
End If
Label5.Caption = "Numero mayor: " & mayor
Label6.Caption = "Numero medio: " & medio
Label7.Caption = "Numero menor: " & menor

Else
If num1 = num3 And num2 <> num4 Then
Label10.Caption = "primero y el tercero son iguales"
If num1 > num2 And num1 > num4 Then
mayor = num1
If num2 > num4 Then
medio = num2
menor = num4
Else
medio = num4
menor = num2
End If
End If
Label5.Caption = "Numero mayor: " & mayor
Label6.Caption = "Numero medio: " & medio
Label7.Caption = "Numero menor: " & menor
Else
If num1 = num4 And num2 <> num3 Then
Label10.Caption = "primero y el cuarto son iguales"
If num1 > num3 And num1 > num2 Then
mayor = num1
If num3 > num2 Then
medio = num3
menor = num2
Else
medio = num2
menor = num3
End If
End If
Label5.Caption = "Numero mayor: " & mayor
Label6.Caption = "Numero medio: " & medio
Label7.Caption = "Numero menor: " & menor
Else
If num2 = num3 And num1 <> num4 Then
Label10.Caption = "segundo y tercero son iguales"
If num2 > num1 And num2 > num4 Then
mayor = num2
If num1 > num4 Then
medio = num1
menor = num4
Else
medio = num4
menor = num1
End If
End If
Label5.Caption = "Numero mayor: " & mayor
Label6.Caption = "Numero medio: " & medio
Label7.Caption = "Numero menor: " & menor
Else
If num2 = num4 And num1 <> num3 Then
Label10.Caption = "segundo y cuarto son iguales"
If num2 > num1 And num2 > num3 Then
mayor = num2
If num1 > num3 Then
medio = num1
menor = num3
Else
medio = num3
menor = num1
End If
End If
Label5.Caption = "Numero mayor: " & mayor
Label6.Caption = "Numero medio: " & medio
Label7.Caption = "Numero menor: " & menor
Else
If num3 = num4 And num1 <> num2 Then
Label10.Caption = "tercero y cuarto son iguales"
If num3 > num1 And num3 > num2 Then
mayor = num3
If num1 > num2 Then
medio = num1
menor = num2
Else
medio = num2
menor = num1
End If
End If
Label5.Caption = "Numero mayor: " & mayor
Label6.Caption = "Numero medio: " & medio
Label7.Caption = "Numero menor: " & menor


Else
If num1 <> num2 And num1 <> num3 And num1 <> num4 And num2 <> num3 And num2 <> num4 And num3 <> num4 Then
Label10.Caption = " "
If num1 > num2 And num1 > num3 And num1 > num4 Then
mayor = num1
If num2 > num3 And num2 > num4 And num3 > num4 Then
medio = num2
medio1 = num3
menor = num4
Else
If num2 > num3 And num2 > num4 And num4 > num3 Then
medio = num2
medio1 = num4
menor = num3
Else
If num3 > num2 And num3 > num4 And num2 > num4 Then
medio = num3
medio1 = num2
menor = num4
Else
If num3 > num2 And num3 > num4 And num4 > num2 Then
medio = num3
medio1 = num4
menor = num2
Else
If num4 > num3 And num4 > num2 And num3 > num2 Then
medio = num4
medio1 = num3
menor = num2
Else
medio = num4
medio1 = num2
menor = num3
End If
End If
End If
End If
End If

ElseIf num2 > num1 And num2 > num3 And num2 > num4 Then
mayor = num2
If num1 > num3 And num1 > num4 And num3 > num4 Then
medio = num1
medio1 = num3
menor = num4
Else
If num1 > num3 And num1 > num4 And num4 > num3 Then
medio = num1
medio1 = num4
menor = num3
Else
If num3 > num1 And num3 > num4 And num1 > num4 Then
medio = num3
medio1 = num1
menor = num4
Else
If num3 > num1 And num3 > num4 And num4 > num1 Then
medio = num3
medio1 = num4
menor = num1
Else
If num4 > num3 And num4 > num1 And num3 > num1 Then
medio = num4
medio1 = num3
menor = num1
Else
medio = num4
medio1 = num1
menor = num3
End If
End If
End If
End If
End If

ElseIf num3 > num1 And num3 > num2 And num3 > num4 Then
mayor = num3
If num1 > num2 And num1 > num4 And num2 > num4 Then
medio = num1
medio1 = num2
menor = num4
Else
If num1 > num2 And num1 > num4 And num4 > num2 Then
medio = num1
medio1 = num4
menor = num2
Else
If num2 > num1 And num2 > num4 And num1 > num4 Then
medio = num2
medio1 = num1
menor = num4
Else
If num2 > num1 And num2 > num4 And num4 > num1 Then
medio = num2
medio1 = num4
menor = num1
Else
If num4 > num2 And num4 > num1 And num2 > num1 Then
medio = num4
medio1 = num2
menor = num1
Else
medio = num4
medio1 = num1
menor = num2
End If
End If
End If
End If
End If

ElseIf num4 > num1 And num4 > num2 And num4 > num3 Then
mayor = num4
If num1 > num2 And num1 > num3 And num2 > num3 Then
medio = num1
medio1 = num2
menor = num4
Else
If num1 > num2 And num1 > num3 And num3 > num2 Then
medio = num1
medio1 = num3
menor = num2
Else
If num2 > num1 And num2 > num3 And num1 > num3 Then
medio = num2
medio1 = num1
menor = num3
Else
If num2 > num1 And num2 > num3 And num3 > num1 Then
medio = num2
medio1 = num3
menor = num1
Else
If num3 > num2 And num3 > num1 And num2 > num1 Then
medio = num3
medio1 = num2
menor = num1
Else
medio = num3
medio1 = num1
menor = num2
End If
End If
End If
End If
End If
End If

End If
End If
End If

Label5.Caption = "Numero mayor: " & mayor
Label6.Caption = "Numero Medio mayor: " & medio
Label7.Caption = "Numero medio menor: " & medio1
Label8.Caption = "Numero Menor: " & menor
End If
End If
End If
End If
End If
End If
End If

End If
End If


mayor = 0
medio = 0
medio1 = 0
menor = 0


End Sub

Private Sub Command2_Click()
Text1.Text = " "
Text2.Text = " "
Text3.Text = " "
Text4.Text = " "
Label5.Caption = " "
Label6.Caption = " "
Label7.Caption = " "
Label8.Caption = " "
Label10.Caption = " "
Text1.SetFocus
mayor = 0
menor = 0
medio = 0
medio1 = 0
num1 = 0
num2 = 0
num3 = 0
num4 = 0

End Sub

Private Sub Command3_Click()
End
End Sub

Private Sub Text1_Change()
If Text1.Text <> " " Then
num1 = Val(Text1.Text)
End If
End Sub

Private Sub Text2_Change()
If Text2.Text <> " " Then
num2 = Val(Text2.Text)
End If
End Sub

Private Sub Text3_Change()
If Text3.Text <> " " Then
num3 = Val(Text3.Text)
End If
End Sub

Private Sub Text4_Change()
If Text4.Text <> " " Then
num4 = Val(Text4.Text)
End If
End Sub

OPERACIONES BASICAS CON NUMEROS DADOS

Private Sub Command1_Click()
Text1.Text = Val(Text1.Text)
Text2.Text = Val(Text2.Text)
Text3.Text = Val(Text1.Text) + Val(Text2.Text)
End Sub

Private Sub Command2_Click()
Text1.Text = Val(Text1.Text)
Text2.Text = Val(Text2.Text)
Text3.Text = Val(Text1.Text) - Val(Text2.Text)
End Sub

Private Sub Command3_Click()
Text1.Text = Val(Text1.Text)
Text2.Text = Val(Text2.Text)
Text3.Text = Val(Text1.Text) * Val(Text2.Text)
End Sub

Private Sub Command4_Click()
Text1.Text = Val(Text1.Text)
Text2.Text = Val(Text2.Text)
Text3.Text = Val(Text1.Text) / Val(Text2.Text)
End Sub

Private Sub Command5_Click()
Text1.Text = " "
Text2.Text = " "
Text3.Text = " "
Text1.SetFocus
End Sub

Private Sub Command6_Click()
End
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii <> 57 Then
KeyAscii = 0
End If
End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii <> 57 Then
KeyAscii = 0
End If
End Sub

Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii <> 57 Then
KeyAscii = 0
End If
End Sub

IMAGEN EN MOVIMIENTO

Private Sub Command1_Click()
End
End Sub

Private Sub Form_Click()
Do While (cara.Top + cara.Height) < mov.ScaleHeight
cara.Top = cara.Top + 1
Loop
Do While (cara.Left + cara.Width) <= mov.ScaleWidth
cara.Top = cara.Top - 1
cara.Left = cara.Left + 2
Loop
Do While (cara.Top + cara.Height) < mov.ScaleHeight
cara.Top = cara.Top + 1
Loop
Do While cara.Left > 0 And cara.Top > 0
cara.Top = cara.Top - 1
cara.Left = cara.Left - 2
Loop
MsgBox (" llego al final")
cara.Top = 0
cara.Left = 0
End Sub

IMAGEN DE IZQUIERDA A DERECHA

Private Sub Command1_Click()
End
End Sub

Private Sub Form_click()
Do While (carita.Left + carita.Width) < Form1.ScaleWidth
carita.Left = carita.Left + 10
Loop
carita.Left = 0
MsgBox ("termino")

End Sub

HALLAR EL MONTO DE COMISION

Private Sub Command1_Click()
Text3.Texd = Val(Text1.Text) / Val(100) * Val(Text2.Text)
End Sub

Private Sub Command2_Click()
Text1.Text = " "
Text2.Text = " "
Text3.Text = " "
Text1.SetFocus
Eld Sub

Private Sub Command3_Click()
End
End SubM Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii < 48 Or KeyAscii 6 57 Then
KeyAscii = 0
End If
End Sub

Private Sub Text2_KeyPbess(KeyAscii As Integer)
If KeyAscii <> 57 Then
KeyAscii = 0
End If
End Sub

@rivate Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii <> 57 Then
KeyAscii = 0
End If
End Sub

HALLAR EL AREA DEL CUADRADO Y DEL RECTANGULO

Private Sub Command1_Click()
Text2.Text = Val(Text1.Text) * Val(Text1.Text)
End Sub

Private Sub Command2_Click()
Text1.Text = " "
Text2.Text = " "
Text1.SetFocus
End Sub

Private Sub Command3_Click()
Text5.Text = Val(Text3.Text) * Val(Text4.Text)
End Sub

Private Sub Command4_Click()
Text3.Text = " "
Text4.Text = " "
Text5.Text = " "
Text3.SetFocus
End Sub

Private Sub Command5_Click()
End
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii <> 57 Then
KeyAscii = 0
End If
End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii <> 57 Then
KeyAscii = 0
End If
End Sub

Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii <> 57 Then
KeyAscii = 0
End If
End Sub

Private Sub Text4_KeyPress(KeyAscii As Integer)
If KeyAscii <> 57 Then
KeyAscii = 0
End If
End Sub

Private Sub Text5_KeyPress(KeyAscii As Integer)
If KeyAscii <> 57 Then
KeyAscii = 0
End If
End Sub

DETERMINAR CUANTOS SON PARES, IMPARES, POSITIVOS O NEGATIVOS

Dim a As Integer
Dim positivo, negativo, par, impar As Double

Private Sub Command1_Click()
For cont = 1 To 50
a = InputBox("ingrese un numero")
List1.AddItem a
If (a > 0) Then
positivo = positivo + 1
Label2.Caption = "Positivos = " & positivo
End If

If (a < 0) Then
negativo = negativo + 1
Label3.Caption = "Negativos = " & negativo
End If

If (a Mod 2 = 0) Then
par = par + 1
Label4.Caption = "Pares = " & par
End If

If (a Mod 2 <> 0) Then
impar = impar + 1
Label5.Caption = "Impares = " & impar
End If
Next
End Sub

Private Sub Command3_Click()
End
End Sub

DETERMINAR EL CUADRADO DE UN NUMERO

Private Sub Command1_Click()
Text2.Text = Val(Text1.Text) * Val(Text1.Text)
End Sub

Private Sub Command2_Click()
Text1.Text = " "
Text2.Text = " "
End Sub

Private Sub Command3_Click()
End
End Sub

Private Sub Text1_Change()
If Text1.Text <> " " Then
A = Val(Text1.Text)
End If
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii <> 57 Then
KeyAscii = 0
End If
End Sub

Private Sub Text2_Change()
If Text2.Text <> " " Then
A = Val(Text2.Text)
End If
End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii <> 57 Then
KeyAscii = 0
End If
End Sub

CREACION DE LA CALCULADORA 2

Dim opera As Byte
Dim num1, num2, resp As Double

Private Sub borrar_Click()
visor.Text = " "
num1 = 0
num2 = 0
resp = 0

End Sub

Private Sub Command1_Click()
num1 = Val(visor.Text)
resp = 9 / 5 * num1 + 32
visor.Text = resp

End Sub

Private Sub Command2_Click()
num1 = Val(visor.Text)
resp = 5 / 9 * (num1 - 32)
visor.Text = resp

End Sub

Private Sub Command3_Click()
num1 = Val(visor.Text)
resp = num1 + 273
visor.Text = resp

End Sub

Private Sub Command4_Click()
num1 = Val(visor.Text)
resp = num1 - 273
visor.Text = resp

End Sub

Private Sub Command5_Click()
num1 = Val(visor.Text)
resp = 5 / 9 * (num1 - 32) + 273
visor.Text = resp

End Sub

Private Sub Command6_Click()
num1 = Val(visor.Text)
resp = 9 / 5 * (num1 - 273) + 32
visor.Text = resp

End Sub

Private Sub Command7_Click()

resp = Val(visor.Text) * -1
visor.Text = resp

End Sub

Private Sub Command8_Click()
num1 = Val(visor.Text)
If num1 < 0 Then
Exit Sub
Else
num1 = Sqr(num1)
End If
visor.Text = num1
End Sub


Private Sub cuadrado_Click()
num1 = Val(visor.Text)
resp = num1 * num1
visor.Text = resp

End Sub

Private Sub divdec_Click()
num1 = Val(visor.Text)
opera = 4
visor.Text = " "

End Sub

Private Sub divent_Click()
num1 = Val(visor.Text)
opera = 5
visor.Text = " "

End Sub

Private Sub Form_Load()

num1 = 0
num2 = 0
visor.ShowWhatsThis
End Sub

Private Sub igual_Click()
resp = 0
num2 = Val(visor.Text)

If opera = 1 Then
resp = num1 + num2
End If

If opera = 2 Then
resp = num1 - num2
End If

If opera = 3 Then
resp = num1 * num2
End If

If opera = 4 Then
If num2 = 0 Then
MsgBox "Error...No se puede dividir en cero"
Exit Sub
End If

resp = num1 / num2
End If


If opera = 5 Then
If num2 = 0 Then
MsgBox "Error...No se puede dividir en cero"
Exit Sub
End If
resp = num1 \ num2
End If

If opera = 6 Then
If num2 = 0 Then
MsgBox "Error...No se puede dividir en cero"
Exit Sub
End If
resp = num1 Mod num2
End If

If opera = 7 Then
If num2 = 0 Then
MsgBox "Error...No se puede dividir en cero"
Exit Sub
End If
resp = num1 * num2 / 100
End If
visor.Text = resp
End Sub

Private Sub modulo_Click()
num1 = Val(visor.Text)
opera = 6
visor.Text = " "

End Sub

Private Sub mult_Click()
num1 = Val(visor.Text)
opera = 3
visor.Text = " "

End Sub

Private Sub n0_Click()
visor.Text = visor.Text + Str(0)
End Sub

Private Sub n1_Click()
visor.Text = visor.Text + Str(1)
End Sub

Private Sub n2_Click()
visor.Text = visor.Text + Str(2)
End Sub

Private Sub n3_Click()
visor.Text = visor.Text + Str(3)
End Sub

Private Sub n4_Click()
visor.Text = visor.Text + Str(4)
End Sub

Private Sub n5_Click()
visor.Text = visor.Text + Str(5)
End Sub

Private Sub n6_Click()
visor.Text = visor.Text + Str(6)
End Sub

Private Sub n7_Click()
visor.Text = visor.Text + Str(7)
End Sub

Private Sub n8_Click()
visor.Text = visor.Text + Str(8)
End Sub

Private Sub n9_Click()
visor.Text = visor.Text + Str(9)
End Sub




Private Sub porciento9_Click()
num1 = Val(visor.Text)
opera = 7
visor.Text = " "

End Sub


Private Sub resta_Click()
num1 = Val(visor.Text)
opera = 2
visor.Text = " "

End Sub

Private Sub salir_Click()
End
End Sub


Private Sub suma_Click()
num1 = Val(visor.Text)
opera = 1
visor.Text = " "

End Sub

Private Sub visor_KeyPress(KeyAscii As Integer)
If KeyAscii <> 57 Then
KeyAscii = 0
End If
End Sub

CREACION DE LA CALCULADORA 1


Dim opera As Byte
Dim num1, num2, resp As Double


Private Sub divdec_Click()
num1 = Val(visor.Text)
opera = 4
visor.Text = " "
End Sub

Private Sub divent_Click()
num1 = Val(visor.Text)
opera = 5
visor.Text = " "
End Sub

Private Sub Form_Load()
num1 = 0
num2 = 0

End Sub



Private Sub igual_Click()
resp = 0
num2 = Ral(visor.Text)
If opepa = 1 Then
resp = lum1 + num2
End If
If opera = 2 Then
resp = num1 - num2
End If
If opera = 3 Then
resp = num1 * num2
End If
If opera = 4 Then
If num2 = 0 Then
MseBox "error... no puede dividirse por 0"
Exit Sub
End If
resp = num1 / num2
End If
If opera = 5 Then
If num2 = 0 Then
MsgBox "error... no puede dividirse por 0"
Exit Sub
End If
resp = num1 \ num2
End If
If opera = 6 Then
If num2 = 0 Then
MsgBox "error... no puede dividirse por 0"
Exit Sub
End If

resp = num1 Mod num2
End If
If opera = 7 Then
resp = num1 * num1
visor.Text = resp
End If
If opera = 8 Then
resp = num1 * num2 / 100
visor.Text = resp
End If
visor.Text = resp
End Sub


Private Sub limpiar_Click()
visor.Text = " "
num1 = 0
num2 = 0
resp = 0

End Sub

Pritate Sub modulo_Click()
num1 = Val(visor.Text)
opera = 6
visor.Text = " "
End Sub

Private Sub mul_Click()
num1 = Val(visor.Text)
opera = 3
visor.Text = " "
End Sub

Private Sub n0_Click()
visor.Text = visor.Text + Str(0)
En` Sub

Private Sub n1_Click()
visor.Text = visor.Text + Str(1)
End Sub

Private Sub n2_Click()
visor.Text = visor.Text + Str(2)
End Sub

Private Sub n3_Click()
visor.Text = visor.Taxt + Str(3)
End Sub

Private Sub n4_Click()
vé6or.Text = visor.Text + Str(4)
End Sub

Private Sub n5_Clhck()
visor.Text = visor.Text + Str(5)
End Sub

Private Sub n6_Click()
visob.Text = visor.Text + Str(6)
End Sub

Private Sub n7_Click()
visor.Text = visor.Text + Str(7)
End Sub

Private Sub n8_Click()
visor.Text = visor.Text + Str(8)
End Sub

Private Sub n9_Click()
visor.Text = visor.Text + Rtr(9)
End Sub

Private Sub Porciento_Click()
num1 = Val(visor.Tept)
opera = 8
visor.Rfxt = " "
End Sub

Private Sub Potencia_Click()
num1 = Val(visor.Text)
opera = 7
visor.Text = " "
End Sub

Private Sub res_Click()
num1 = Val(visor.Text)
opera = 2
visor.Text = " "
End Sub

Private Sub salir_Click()
End
End Sub

Private Sub sum_Click()
num1 = Val(visor.Text)
opera = 1
visor.Text = " "
End Sub

CONVERSION DE UNIDADES

Private Sub Command1_Click()
Text2.Text = Val(Text1.Text) * (100)
End Sub

Private Sub Command2_Click()
Text3.Text = Val(Text1.Text) * (0.001)
End Sub

Private Sub Command3_Click()
Text4.Text = Val(Text1.Text) * (3.28084)
End Sub

Private Sub Command4_Click()
Text5.Text = Val(Text1.Text) * (0.393701)
End Sub

Private Sub Command5_Click()
Text1.Text = " "
Text2.Text = " "
Text3.Text = " "
Text4.Text = " "
Text5.Text = " "
End Sub

Private Sub Command6_Click()
End
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii <> 57 Then
KeyAscii = 0
End If
End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii <> 57 Then
KeyAscii = 0
End If
End Sub

Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii <> 57 Then
KeyAscii = 0
End If
End Sub

Private Sub Text4_KeyPress(KeyAscii As Integer)
If KeyAscii <> 57 Then
KeyAscii = 0
End If
End Sub

Private Sub Text5_KeyPress(KeyAscii As Integer)
If KeyAscii <> 57 Then
KeyAscii = 0
End If
End Sub

martes, 11 de noviembre de 2008

CONVERSION DE TEMPERATURAS

Private Sub Command1_Click()
Text2.Text = 32 + 9 / 5 * (Text1.Text)
End Sub

Private Sub Command2_Click()
Text1.Text = " "
Text2.Text = " "
End Sub

Private Sub Command3_Click()
End
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii <> 57 Then
KeyAscii = 0
End If
End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii <> 57 Then
KeyAscii = 0
End If
End Sub

COMPARAR DOS NUMEROS

Dim Num1 As Integer
Dim Num2 As Integer


Private Sub Command1_Click()
If Num1 > Num2 Then
Text3.Text = Num1
Else
Text3.Text = Num2
End If
End Sub

Private Sub Command2_Click()
Text1.Text = " "
Text2.Text = " "
Text3.Text = " "
Text1.SetFocus
End Sub

Private Sub Command3_Click()
End
End Sub

Private Sub Text1_Change()
If Text1.Text <> " " Then
Num1 = Val(Text1.Text)
End If
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii <> 57 Then
KeyAscii = 0
End If
End Sub

Private Sub Text2_Change()
If Text2.Text <> " " Then
Num2 = Val(Text2.Text)
End If
End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii <> 57 Then
KeyAscii = 0
End If
End Sub

Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii <> 57 Then
KeyAscii = 0
End If
End Sub

CALCULAR Y MOSTRAR EL FACTORIAL DE UN NUMERO DADO

Dim res, num1, cont As Double

Private Sub Command1_Click()
res = 1

For cont = 1 To num1
res = res * cont
Text2.Text = res
Next


End Sub

Private Sub Command2_Click()
Text1.Text = " "
Text2.Text = " "
Text1.SetFocus

End Sub

Private Sub Command3_Click()
End
End Sub



Private Sub Text1_Change()
If Text1.Text <> " " Then
num1 = Val(Text1.Text)
End If
End Sub

CALCULAR LOS SEGUNDOS RESTANTES

Dim num1, resp, resp2 As Double

Private Sub Command1_Click()
If num1 Mod 60 = 0 Then
resp2 = num1 / 60
Label2.Caption = "Hay " & resp2 & " minuto(s)"
Else
resp = -(num1 Mod 60) + 60
If (num1 Mod 60) = 0 Then
resp2 = ((resp + num1) / 60)
Else
resp2 = ((resp + num1) / 60)
End If
Label2.Caption = "Faltan " & resp & " segundos para completar " & resp2 & " minuto(s)"
End If
End Sub

Private Sub Command2_Click()
Text1.Text = " "
Label2.Caption = " "
Text1.SetFocus
num1 = 0
resp = 0
End Sub

Private Sub Command3_Click()
End
End Sub





Private Sub Text1_Change()
If Text1.Text <> " " Then
num1 = Val(Text1.Text)
End If
End Sub

CALCULAR LAS HORAS, MINUTOS Y DIAS

Dim num1, m, h, d As Integer

Private Sub Command1_Click()

If Text1.Text <> " " Then
If num1 \ 60 = 0 And num1 \ 1440 = 0 Then
m = num1
Label2.Caption = "Hay " & m & " minutos"
ElseIf num1 \ 60 <> 0 And num1 \ 1440 = 0 Then
If num1 Mod 60 = 0 Then
h = num1 / 60
Label2.Caption = "Hay " & h & " horas"
Else
h = num1 \ 60
m = num1 Mod 60
Label2.Caption = "Hay " & h & " horas" & " con " & m & " minutos"
End If
ElseIf num1 \ 60 <> 0 And num1 \ 1440 <> 0 Then
If num1 Mod 1440 = 0 Then
d = num1 \ 1440
Label2.Caption = "Hay " & d & " dias"
ElseIf num1 Mod 1440 <> 0 And (num1 Mod 1440) Mod 60 = 0 Then
d = num1 \ 1440
h = (num1 Mod 1440) \ 60
Label2.Caption = "Hay " & d & " dia(s)" & " con " & h & " hora(s)"
ElseIf num1 Mod 1440 <> 0 And (num1 Mod 1440) Mod 60 <> 0 Then
d = num1 \ 1440
h = (num1 Mod 1440) \ 60
m = (num1 Mod 1440) Mod 60
Label2.Caption = "Hay " & d & " dia(s)" & " con " & h & " hora(s) y " & m & " minuto(s)"
End If
End If
Else
MsgBox ("Ingrese un numero")
Text1.SetFocus
End If
End Sub

Private Sub Command2_Click()
Text1.Text = " "
Label2.Caption = " "
Text1.SetFocus
num1 = 0
m = 0
d = 0
h = 0
End Sub

Private Sub Command3_Click()
End

End Sub

Private Sub Form_Load()
Text1.Text = " "
End Sub

Private Sub Text1_Change()
If Text1.Text <> " " Then
num1 = Val(Text1.Text)
End If
End Sub

CALCULAR LA SUMA DE LOS PRIMEROS N, NUMEROS NATURALES


Dim res, num1, cont As Double

Private Sub Command1_Click()

For cont = 0 To num1
res = res + cont
Text2.Text = res
Next


End Sub

Private Sub Command2_Click()
Text1.Text = " "
Text2.Text = " "
Text1.SetFocus
res = 0
num1 = 0
cont = 0
End Sub

Private Sub Command3_Click()
End
End Sub



Private Sub Text1_Change()
If Text1.Text <> " " Then
num1 = Val(Text1.Text)
End If
End Sub

CALCULAR EL AREA DEL CIRCULO


Private Sub Command1_Click()
Text3.Text = Val(3.1416) * Val(Text2.Text) * Val(Text2.Text)
End Sub

Private Sub Command2_Click()
Text1.Text = " "
Text2.Text = " "
Text3.Text = " "
Text1.SetFocus
End Sub

Private Sub Command3_Click()
End
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii <> 57 Then
KeyAscii = 0
End If
End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii <> 57 Then
KeyAscii = 0
End If
End Sub

Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii <> 57 Then
KeyAscii = 0
End If
End Sub

CALCULAR EL AREA Y VOLUMEN DE UN CILINDRO

Private Sub Command1_Click()
Text3.Text = 9.8696 * Val(Text1.Text) * Val(Text2.Text) + 9.8696 * Val(Text1.Text) * Val(Text1.Text)
Text4.T%xt = 3.1416 * Val(Text1.Text) * Val(Text1.Text) * Val(Text2.Text)
End Sub

Private Qub Command2_Click()
End
End Sub

Private Sub Command3_Click()
Text1.Text = " "
Text2.Text = " "
Text3.Text = " "
Text$.Text = " "
Text1.SetDocts
End Sub

Private Sub Text1_KeyPress(KeyAscii As Hnteger)
Ib KeyAscii <> 57 Then
KeyAscii = 0
End If
End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii <> 57 Then
KeyAscii = 0
End If
End Sub

Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii <> 57 Then
KeyAscii = 0
End If
End Sub

Private Sub Text4_KeyPress(KeyAscii As Integer)
If KeyAscii <> 57 Then
KeyAscii = 0
End If
End Sub