CODIGOS FUENTES
Enviado por enoeliaromero • 24 de Octubre de 2017 • Tarea • 2.223 Palabras (9 Páginas) • 180 Visitas
CODIGOS FUENTES
1) CALCULO FACTORIAL DE UN NUMERO
Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click
End
End Sub
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim valor, factorial As Long
valor = Val(TextBox1.Text)
factorial = 1
For i = 1 To valor Step 1
factorial = factorial * i
Next
Label3.Text = "El factorial es: " & factorial
End Sub
Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
TextBox1.Clear()
Label3.Text = "El Factorial es..."
End Sub
End Class
2) CALCULO DE GRADOS FARENHEIT A CELCIUS
Private Sub Button5_Click(sender As System.Object, e As System.EventArgs) Handles Button5.Click
LblR.Text = (Val(TextBox1.Text) * (9) / (5)) + 32
Lbl1.Text = "Gados Farenheit"
End Sub
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
LblR.Text = ((Val(TextBox1.Text) - 32) * (5) / (9))
Lbl1.Text = "Gados Celcius"
End Sub
Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click
TextBox1.Text = ""
LblR.Text = ""
Lbl1.Text = ""
End Sub
Private Sub Button4_Click(sender As System.Object, e As System.EventArgs) Handles Button4.Click
End
End Sub
3)LAS TABLAS DE MULTIPLICACION
Dim, Num, i As Integer
Num=Val(textbox1.Text)
For i=1 to 12
Listbox1.Items.Add(i & Space(3) & "x" & Space(3) & Num & Space(3) & "=" & Space(3) & Num * i)
Next
End Sub
4) CALCULO PROMEDIO DE NOTAS
Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Bttborrar.Click
Txtn1.Text = ""
Txtn2.Text = ""
Txtn3.Text = ""
Txtn4.Text = ""
Txtn5.Text = ""
Txtn6.Text = ""
Txtprom.Text = ""
TextBox8.Text = ""
LstN1.Items.Clear()
End Sub
Private Sub Button1_Click_1(sender As System.Object, e As System.EventArgs) Handles Bttcalcular.Click
Dim n1, n2, n3, n4, n5, n6 As Integer
n1 = Txtn1.Text
n2 = Txtn2.Text
n3 = Txtn3.Text
n4 = Txtn4.Text
n5 = Txtn5.Text
n6 = Txtn6.Text
Txtprom.Text = (n1 + n2 + n3 + n4 + n5 + n6) / 6
LstN1.Items.Add(Str(n1))
LstN1.Items.Add(Str(n2))
LstN1.Items.Add(Str(n3))
LstN1.Items.Add(Str(n4))
LstN1.Items.Add(Str(n5))
LstN1.Items.Add(Str(n6))
If Txtprom.Text >= 90 And Txtprom.Text <= 100 Then
TextBox8.Text = "A"
ElseIf Txtprom.Text >= 80 And Txtprom.Text <= 89 Then
TextBox8.Text = "B"
ElseIf Txtprom.Text >= 70 And Txtprom.Text <= 79 Then
TextBox8.Text = "C"
ElseIf Txtprom.Text >= 60 And Txtprom.Text <= 69 Then
TextBox8.Text = "F"
Else
MsgBox("Promedio Ivalido, verificar NOTAS ingresadas")
End If
End Sub
Private Sub Bttsalir_Click(sender As System.Object, e As System.EventArgs) Handles Bttsalir.Click
End
End Sub
End Class
5) CALCULO NUMEROS PARES, IMPARES Y DESENDENTES
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim H, T, A As Integer
H = 1
A = 200
For H = 1 To 200 Step 2
ListBox1.Items.Add(Str(H))
T = T + H
Next
TextBox1.Text = Str(T)
ListBox1.Items.Add(Str(A))
Dim A1, T1 As Integer
A1 = 300
While A1 >= 1
ListBox2.Items.Add(Str(A1))
T1 = T1 + A1
A1 = A1 - 1
End While
TextBox2.Text = Str(T1)
Dim A2, T2, H1, Tg As Integer
A2 = 2
H1 = 1
ListBox3.Items.Add(Str(H1))
Do While A2 <= 400
T2 = T2 + A2
ListBox3.Items.Add(Str(A2))
A2 = A2 + 2
Loop
TextBox3.Text = Str(T2)
Tg = T + T1 + T2
TextBox4.Text = Str(Tg)
End Sub
Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
ListBox1.Items.Clear()
...