HISTORIA DE LOS COMPUTADORES | Aficiones | INTEGRANTES | TIPOS DE COMPUTADORES | ALGORITMO
 
ALGORITMO
   
ALGORITMOS

PROMEDIO NOTA
Private Sub Command1_Click()
Dim a As Double, b As Double, c As Double, d As Double, n As Integer
Text7 = Text3 * 0.25 = a
Text8 = Text4 * 0.25 = b
Text9 = Text5 * 0.25 = c
Text10 = Text6 * 0.25 = d
txt = a + b + c + d
Text11 = txt
End Sub
Private Sub Command2_Click()
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
Text5 = ""
Text6 = ""
Text7 = ""
Text8 = ""
Text9 = ""
Text10 = ""
Text3.SetFocus
End Sub
Private Sub Command3_Click()
End
End Sub
Private Sub Form_Load()
End Sub
Private Sub Text10_Change()
Text10 = Text6 * 0.25
End Sub
Private Sub Text11_Change()
End Sub
Private Sub Text7_Change()
Text7 = Text3 * 0.25
End Sub
Private Sub Text8_Change()
Text8 = Text4 * 0.25
End Sub
Private Sub Text9_Change()
Text9 = Text5 * 0.25
End Sub


AÑO BISIESTO

Private Sub Command1_Click()
Dim a As Integer
If Text1.Text <> " " And IsNumeric(Text1.Text) Then
a = Val(Text1.Text)
If (a Mod 4 = 0 And a Mod 100 <> 0) Or (a Mod 100 = 0 And a Mod 400 = 0) Then
Label2.Caption = "no es bisiesto"

Else
Label2.Caption = " es bisiesto"
End If
Else
MsgBox "entre un dato valido"
End If
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Label2.Caption = ""
Text1.SetFocus
End Sub
Private Sub Command3_Click()
Unload Me

End Sub



SERIE POTENCIA

Private Sub Command1_Click()
Dim t, suma As Double
If IsNumeric(Text1.Text) Then
For i = 1 To Text1.Text
If i Mod 2 = 0 Then
t = (((i * 2) - 1) ^ (i * 2) / (i * 2)) * -1
Text2.Text = Text2.Text & " - " & (i * 2) - 1 & "^" & i * 2 & "/" & i * 2
Else
t = ((i * 2) - 1) ^ (i * 2) / (i * 2) * 1
Text2.Text = Text2.Text & " + " & (i * 2) - 1 & "^" & i * 2 & "/" & i *
End If
suma = suma + t
Next
Text3.Text = suma
Else
MsgBox "Entre numero valido ", vbcuestion
End if
End Su
Private Sub Command2_Click()
Text1.Text = " "
Text2.Text = " "
Text3.Text = " "
Text1.SetFocus
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If IsNumeric(Text1.Text) Then
Command1.SetFocus
Else
MsgBox "Solo datos numericos", vbInformation
Text1.Text = ""
End If
End If

End Sub



DESCOMPOSICION DE UNIDADES

Private Sub Command1_Click()
Dim t, suma As Double
If IsNumeric(Text1.Text) Then
For i = 1 To Text1.Text
If i Mod 2 = 0 Then
t = (((i * 2) - 1) ^ (i * 2) / (i * 2)) * -1
Text2.Text = Text2.Text & " - " & (i * 2) - 1 & "^" & i * 2 & "/" & i * 2
Else
t = ((i * 2) - 1) ^ (i * 2) / (i * 2) * 1
Text2.Text = Text2.Text & " + " & (i * 2) - 1 & "^" & i * 2 & "/" & i *
End If
suma = suma + t
Next
Text3.Text = suma
Else
MsgBox "Entre numero valido ", vbcuestion
End
End Su
Private Sub Command2_Click()
Text1.Text = " "
Text2.Text = " "
Text3.Text = " "
Text1.SetFocus
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If IsNumeric(Text1.Text) Then
Command1.SetFocus
Else
MsgBox "Solo datos numericos", vbInformation
Text1.Text = ""
End If
End If

End Sub