Mi lista de blogs

martes, 22 de noviembre de 2011


PROGRAMA PARA PROMEDIAR LA NOTA

Este programa nos sirve para sacar el promedio y desempeño de cuatro notas .


Dim N1, N2, N3, N4 As Double
Dim PROMEDIO As Double
Private Sub Command1_Click()
N1 = Val(Text3)
N2 = Val(Text4)
N3 = Val(Text5)
N4 = Val(Text6)
PROMEDIO = ((N1 + N2 + N3 + N4) / 4)
Text7 = PROMEDIO
 If PROMEDIO < 3.2 And PROMEDIO >= 1 Then
  Text8 = "BAJO"
 ElseIf PROMEDIO > 3.2 And PROMEDIO < 4 Then
 Text8 = "BASICO"
 ElseIf PROMEDIO >= 4 And PROMEDIO <= 4.5 Then
 Text8 = "ALTO"
 ElseIf PROMEDIO > 4.6 And PROMEDIO <= 5 Then
 Text8 = "SUPERIOR"
  End If
End Sub
Private Sub Command2_Click()
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
Text5 = ""
Text6 = ""
Text7 = ""
Text8 = ""
End Sub
Private Sub Command3_Click()
 Beep
 End
End Sub


Private Sub Form_Load()
Dim N1, N2, N3, N4 As Double
Dim PROMEDIO As Integer
N1 = Val(Text3)
N2 = Val(Text4)
N3 = Val(Text5)
N4 = Val(Text6)
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If Text1.Text = "" Then
MsgBox ("digite el nombre del estudiante")
Text1.SetFocus
Else
Text2.SetFocus
End If
End If
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If Text2.Text = "" Then
MsgBox ("digite la materia")
Text2.SetFocus
Else
Text3.SetFocus
End If
End If
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
'este codigo sirve para ingresar la nota1 en el sisitema
Dim N1, N2, N3, N4 As Double
N1 = Val(Text3)
If KeyAscii = 13 Then
   If Text3.Text = "" Then
     MsgBox ("digite la nota 1")
    Text3.SetFocus
  ElseIf N1 > 0.9 And N1 < 5.1 Then
      Text4.SetFocus
   Else
      MsgBox ("la nota no es del rango")
   Text3.SetFocus
End If
End If
End Sub
Private Sub Text4_KeyPress(KeyAscii As Integer)
'este codigo sirve para ingresar la nota2 en el sisitema
Dim N1, N2, N3, N4 As Double
N2 = Val(Text4)
If KeyAscii = 13 Then
   If Text4.Text = "" Then
     MsgBox ("digite la nota 2")
   Text4.SetFocus
ElseIf N2 > 0.9 And N2 < 5.1 Then
   Text5.SetFocus
   Else
     MsgBox ("la nota no es del rango")
    Text4.SetFocus
End If
End If
End Sub
Private Sub Text5_KeyPress(KeyAscii As Integer)
'este codigo sirve para ingresar la nota3 en el sisitema
Dim N1, N2, N3, N4 As Double
N3 = Val(Text5)
If KeyAscii = 13 Then
If Text5.Text = "" Then
      MsgBox ("digite la nota 3")
   Text5.SetFocus
  ElseIf N3 > 0.9 And N3 < 5.1 Then
  Text6.SetFocus
  Else
    MsgBox ("la nota no es del rango")
   Text4.SetFocus
End If
End If
End Sub
Private Sub Text6_KeyPress(KeyAscii As Integer)
'este codigo sirve para ingresar la nota4 en el sisitema
Dim N1, N2, N3, N4 As Double
N4 = Val(Text6)
If KeyAscii = 13 Then
If Text6.Text = "" Then
      MsgBox ("digite la nota 4")
   Text7.SetFocus
  ElseIf N4 > 0.9 And N4 < 5.1 Then
  Text6.SetFocus
  Else
    MsgBox ("la nota no es del rango")
   Text4.SetFocus
End If
End If
End Sub

OBJETOS DE LA PAPELERIA

Private Sub Command1_Click()
  Beep
  End
End Sub

Private Sub Label1_Click()
Label2.Caption = "CALCULADORA"
End Sub
Private Sub Label10_Click()
Label2.Caption = "CAJA DE GANCHOS"
End Sub
Private Sub Label11_Click()
Label2.Caption = "COLORES"
End Sub
Private Sub Label12_Click()
Label2.Caption = "CAJA DE PAPEL PERIODICO"
End Sub
Private Sub Label4_Click()
Label2.Caption = "SACAPUNTAS"
End Sub
Private Sub Label5_Click()
Label2.Caption = "CINTA"
End Sub
Private Sub Label6_Click()
Label2.Caption = "REGLAS"
End Sub
Private Sub Label7_Click()
Label2.Caption = "CUADERNO"
End Sub
Private Sub Label8_Click()
Label2.Caption = "COCEDORA"
End Sub
Private Sub Label9_Click()
Label2.Caption = "PEGASTIC"

jueves, 17 de noviembre de 2011

SALARIO DE UN TRABAJADOR

Private Sub Command1_Click()
HT = Val(Text2)
PH = Val(Text3)
salario = HT * PH
Text4 = salario
Descuento = 0.2 * Text4
Text5 = Descuento
SalarioNeto = SalarioBruto - Descuento
Text6 = SalarioNeto
End Sub

Private Sub Command2_Click()
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
Text5 = ""
Text6 = ""
End Sub

Private Sub Command3_Click()
Beep
End
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If Text1.Text = "" Then
MsgBox ("digite el nombre del trabajador")
Text1.SetFocus
Else
Text2.SetFocus
End If
End If
End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If Text2.Text = "" Then
MsgBox ("digite el numero de horas trabajadas")
Text2.SetFocus
Else
Text3.SetFocus
End If
End If
End Sub

Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If Text3.Text = "" Then
MsgBox ("digite el pago por horas")
Text3.SetFocus
Else
Text4.SetFocus
End If
End If
End Sub

Private Sub Text4_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If Text4.Text = "" Then
MsgBox ("digite el salario bruto")
Text4.SetFocus
Else
Text5.SetFocus
End If
End If
End Sub

Private Sub Text5_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If Text5.Text = "" Then
MsgBox ("digite el descuento")
Text5.SetFocus
Else
Text6.SetFocus
End If
End If
End Sub

Private Sub Text6_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If Text6.Text = "" Then
MsgBox ("digite el salario neto")
Text6.SetFocus
Else
Command1.SetFocus
End If
End If
End Sub

CALCULA LA EDAD DE UNA PERSONA

Private Sub Command1_Click()
Dim FecNac As Date, Edad As Integer
FecNac = CDate(Text1)
Edad = CInt((Date - FecNac) / 365)
Text2 = Str(Edad) & "años"
End Sub

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

Private Sub Command3_Click()
Beep
End
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If Text1.Text = "" Then
MsgBox ("DIGITE LA FECHA DE NACIMIENTO")
Text1.SetFocus
Else
Text2.SetFocus
End If
End If

End Sub

RESTAURANTE

Dim h, g, c, e, s, r, so, p, vt, i As Integer
Private Sub Command1_Click()
h = Val(Text1)
g = Val(Text2)
c = Val(Text3)
e = Val(Text4)
s = Val(Text5)
r = Val(Text6)
so = Val(Text7)
p = Val(Text8)
vt = (h * 3500) + (g * 1200) + (c * 1300) + (e * 3500) + (s * 2000) + (r * 1000) + (so * 2000) + (p * 2800)
i = (18 / 100) * vt
Text9.Text = vt + i
Text10 = i



End Sub

Private Sub Command2_Click()
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
Text5 = ""
Text6 = ""
Text7 = ""
Text8 = ""
Text9 = ""
Text10 = ""
End Sub

Private Sub Command3_Click()
Beep
End
End Sub

Private Sub Form_Load()
GrdMenu.Cols = 2
GrdMenu.Rows = 9
GrdMenu.FixedCols = 0
GrdMenu.FixedRows = 1
GrdMenu.TextArray(0) = "Menú2"
GrdMenu.TextArray(1) = "Precio"
GrdMenu.TextArray(2) = "Hamburguesa"
GrdMenu.TextArray(3) = "3500"
GrdMenu.TextArray(4) = "Cerveza"
GrdMenu.TextArray(5) = "1300"
GrdMenu.TextArray(6) = "Gaseosa"
GrdMenu.TextArray(7) = "1200"
GrdMenu.TextArray(8) = "Ensalada"
GrdMenu.TextArray(9) = "3500"
GrdMenu.TextArray(10) = "Salchichas"
GrdMenu.TextArray(11) = "2000"
GrdMenu.TextArray(12) = "Refresco"
GrdMenu.TextArray(13) = "1000"
GrdMenu.TextArray(14) = "Sopa"
GrdMenu.TextArray(15) = "2000"
GrdMenu.TextArray(16) = "Postre"
GrdMenu.TextArray(17) = "2800"
End Sub

Private Sub Text1_keypress(keyascci As Integer)
If keyascci = 13 Then
If Text1.Text = "" Then
MsgBox ("Digite la cantidad de hamburguesas")
Text1.SetFocus
Else
Text2.SetFocus
End If
End If
End Sub

Private Sub Text2_keypress(keyascci As Integer)
If keyascci = 13 Then
If Text2.Text = "" Then
MsgBox ("Digite la cantidad de Cervezas")
Text2.SetFocus
Else
Text3.SetFocus
End If
End If

End Sub

Private Sub Text3_keypress(keyascci As Integer)
If keyascci = 13 Then
If Text3.Text = "" Then
MsgBox ("Digite la cantidad de gaseosas")
Text3.SetFocus
Else
Text4.SetFocus
End If
End If

End Sub

Private Sub Text4_keypress(keyascci As Integer)
If keyascci = 13 Then
If Text4.Text = "" Then
MsgBox ("Digite la cantidad de ensalada")
Text4.SetFocus
Else
Text5.SetFocus
End If
End If

End Sub

Private Sub Text5_keypress(keyascci As Integer)
If keyascci = 13 Then
If Text5.Text = "" Then
MsgBox ("Digite la cantidad de salchichas")
Text5.SetFocus
Else
Text6.SetFocus
End If
End If

End Sub

Private Sub Text6_keypress(keyascci As Integer)
If keyascci = 13 Then
If Text6.Text = "" Then
MsgBox ("Digite la cantidad de refresco")
Text6.SetFocus
Else
Text7.SetFocus
End If
End If

End Sub

Private Sub Text7_keypress(keyascci As Integer)
If keyascci = 13 Then
If Text7.Text = "" Then
MsgBox ("Digite la cantidad de sopa")
Text7.SetFocus
Else
Text8.SetFocus
End If
End If

End Sub

Private Sub Text8_keypress(keyascci As Integer)
If keyascci = 13 Then
If Text8.Text = "" Then
MsgBox ("Digite la cantidad de Postre")
Text8.SetFocus
Else
Command1.SetFocus
End If
End If
End Sub

jueves, 6 de octubre de 2011

componentes del computador

Private Sub Command1_Click()
  Beep
  End
End Sub
Private Sub Label1_Click()
Label5.Caption = "MONITOR"
End Sub
Private Sub Label2_Click()
Label5.Caption = "TECLADO"
End Sub
Private Sub Label3_Click()
Label5.Caption = "TORRE"
End Sub
Private Sub Label4_Click()
Label5.Caption = "MOUSE"
End Sub