+ All Categories
Home > Documents > Programas en visual

Programas en visual

Date post: 12-Mar-2016
Category:
Upload: tania-maldonado
View: 217 times
Download: 0 times
Share this document with a friend
Description:
17 programas
Popular Tags:
26
COLEGIO “HUMBERTO MATA MARTÍNEZ” PROGRAMACION TEMA: VISUAL BASIC LICENCIADO: RODRIGO MULLO ALUMNA: TANIA MALDONADO CURSO: SEGUNDO TECNICO
Transcript

COLEGIO

“HUMBERTO MATA MARTÍNEZ”

PROGRAMACION

TEMA: VISUAL BASIC

LICENCIADO: RODRIGO MULLO

ALUMNA: TANIA MALDONADO

CURSO: SEGUNDO TECNICO

IDENTIFICA NUMEROS POSITIVOS Y NEGATIVOS

Public Class Form1 Dim numero As Double Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click numero = TextBox1.Text If numero > 0 Then MsgBox("el numero es positivo") Else MsgBox("el numero es negativo") End If End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

TextBox1.Text = "" End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click End End Sub End Class

TABLAS DE MULTIPLICAR

Public Class Form1 Dim calcular As Double Private Sub TextBox10_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox10.TextChanged End Sub Private Sub TextBox11_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox11.TextChanged End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click calcular = Val(TextBox1.Text) TextBox2.Text = calcular * 1 TextBox3.Text = calcular * 2 TextBox4.Text = calcular * 3 TextBox5.Text = calcular * 4 TextBox6.Text = calcular * 5 TextBox7.Text = calcular * 6 TextBox8.Text = calcular * 7 TextBox9.Text = calcular * 8 TextBox10.Text = calcular * 9 TextBox11.Text = calcular * 10

TextBox12.Text = calcular * 11 TextBox13.Text = calcular * 12 TextBox14.Text = calcular TextBox15.Text = calcular

TextBox16.Text = calcular TextBox17.Text = calcular TextBox18.Text = calcular TextBox19.Text = calcular TextBox20.Text = calcular TextBox21.Text = calcular TextBox22.Text = calcular TextBox23.Text = calcular TextBox24.Text = calcular TextBox25.Text = calcular End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" TextBox4.Text = "" TextBox5.Text = "" TextBox6.Text = "" TextBox7.Text = "" TextBox8.Text = "" TextBox9.Text = "" TextBox10.Text = "" TextBox11.Text = "" TextBox12.Text = "" TextBox13.Text = "" TextBox14.Text = "" TextBox15.Text = "" TextBox16.Text = "" TextBox17.Text = "" TextBox18.Text = "" TextBox19.Text = "" TextBox20.Text = "" TextBox21.Text = "" TextBox22.Text = "" TextBox23.Text = "" TextBox24.Text = "" TextBox25.Text = "" End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click End End Sub Private Sub TextBox24_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox24.TextChanged End Sub Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged End Sub End Class

PROGRAMA QUE IDENTIFICA SI EL NUMERO ES PAR

O IMPAR

Public Class Form1 Dim num As Integer Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click num = Val(TextBox1.Text) If num Mod 2 = 0 Then TextBox2.Text = " par" End If If num Mod 2 = 1 Then TextBox2.Text = " impar" End If End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Text = "" TextBox2.Text = "" End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click End End Sub Private Sub Label2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label2.Click End Sub End Class

AREA DE UN TRIANGULO

Public Class Form1 Dim BA, AL As Double Private Sub Label3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label3.Click End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click BA = Val(TextBox1.Text) AL = Val(TextBox2.Text) TextBox3.Text = (BA * AL) / 2 End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click End End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub End Class

AREA Y PERIMETRO DE LA CIRCUNFERENCIA

Public Class Form1 Dim a As Double Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click a = Val(TextBox1.Text) TextBox2.Text = (a * a) * 3.1415 TextBox3.Text = (2 * 3.1415) * a End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click End End Sub End Class

AREA Y PERIMETRO DEL CUADRADO

Public Class Form1 Dim a As Double Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click a = Val(TextBox1.Text) TextBox2.Text = a * a TextBox3.Text = 4 * a End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Text = "" TextBox2.Text = ""

TextBox3.Text = "" End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click End End Sub End Class

AREA Y PERIMETRO DEL RECTANGUL

Public Class Form1

Dim a As Double Dim b As Double Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click a = Val(TextBox1.Text) b = Val(TextBox2.Text) TextBox3.Text = a * b TextBox4.Text = (2 * a) + (2 * b) End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" TextBox4.Text = "" End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click End

End Sub End Class

AREA Y PERIMETRO DEL TRIANGULO RECTANGULO

Public Class Form1 Dim BA, AL, H As Double Private Sub Label3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label3.Click End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click BA = Val(TextBox1.Text) AL = Val(TextBox2.Text) TextBox3.Text = (BA * AL) / 2 H = 1 / 2 * ((BA ^ 2) + (AL ^ 2)) TextBox4.Text = H + BA + AL End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click End End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub End Clas

AREA Y PERIMETRO DEL ROMBO

public Class Form1 Dim DM As Double Dim Ds As Double Dim l1 As Double Dim l2 As Double Dim l3 As Double Dim l4 As Double Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click DM = Val(TextBox1.Text) Ds = Val(TextBox2.Text)

l1 = Val(TextBox3.Text) l2 = Val(TextBox4.Text) l3 = Val(TextBox5.Text) l4 = Val(TextBox6.Text) TextBox7.Text = (DM * Ds) / 2 TextBox8.Text = l1 + l2 + l3 + l4 End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Clear() TextBox2.Clear() TextBox3.Clear() TextBox4.Clear() TextBox5.Clear() TextBox6.Clear() TextBox7.Clear() TextBox8.Clear() End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click End End Sub End Class

ESCALA DE CALIFICACIONES

Public Class Form1 Dim n1 As Double Dim n2 As Double Dim n3 As Double Dim n4 As Double Dim resul As Double Dim pro As Double Dim div As Double Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles

TextBox1.TextChanged n1 = Val(TextBox1.Text) If n1 > 10 Then MsgBox("error nota mayor a 10") End If End Sub Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged n2 = Val(TextBox2.Text) If n2 > 10 Then MsgBox("error nota mayor a 10") End If End Sub Private Sub TextBox3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox3.TextChanged n3 = Val(TextBox3.Text) If n3 > 10 Then MsgBox("error nota mayor a 10") End If End Sub End class

TRANSFORMACION DE HORAS A MINUTOS Y SEGUNDOS

Public Class Form1 Dim calcular As Double Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

Handles Button1.Click calcular = Val(TextBox1.Text) TextBox2.Text = calcular * 60 TextBox3.Text = calcular * 3600 End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click End End Sub End Class

TRANSFORMACION DE DIAS A HORAS, MINUTOS Y SEGUNDOS

Public Class Form1 Dim convertir As Double Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" textbox4.Text = "" End Sub Private Sub

Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click End End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click convertir = (TextBox1.Text) TextBox2.Text = convertir * 24 TextBox3.Text = convertir * 24 * 60 TextBox4.Text = convertir * 60 * 3600 End Sub End Class

Private Sub TextBox4_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox4.TextChanged n4 = Val(TextBox4.Text) If n4 > 10 Then MsgBox("error nota mayor a 10")

End If End Sub Private Sub BT5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT5.Click TextBox5.Text = TextBox5.Text TextBox5.Text = (n1 + n2 + n3 + n4) End Sub Private Sub BT6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT6.Click div = 4 TextBox6.Text = (n1 + n2 + n3 + n4) / div resul = (n1 + n2 + n3 + n4) / div End Sub Private Sub BT7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT7.Click If resul = 10 Then TextBox7.Text = " supera los aprendizajes requeridos" Else If resul >= 8 Then TextBox7.Text = "domina los aprendizajes requeridos " Else If resul = 7 Then TextBox7.Text = "alcansa los aprendizajes requeridos " Else If resul >= 5 Then TextBox7.Text = "proximo los aprendizajes requeridos " Else If resul <= 4 Then TextBox7.Text = "no alcansa los aprendizajes requeridos " End If End If End If End If End If End Sub End Class

CONVERSION DE DOLAR A EUROS

Public Class Form1 Dim convertir As Double Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click convertir = Val(TextBox1.Text) TextBox2.Text = convertir * 0.772778 End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Text = "" TextBox2.Text = "" End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click End

End Sub End Class

TRANSFORMACION DE DOLAR A DIEZ MONEDAS DIFERENTES

Public Class Form1 Dim DOL As Double Private Sub TextBox5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox5.TextChanged End Sub Private Sub Label9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label9.Click End Sub Private Sub Label11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label11.Click End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As

System.EventArgs) Handles Button1.Click DOL = Val(TextBox1.Text) TextBox2.Text = DOL * 0.772778 TextBox3.Text = DOL * 12.4472 TextBox4.Text = DOL * 95.417 TextBox5.Text = DOL * 78.9419 TextBox6.Text = DOL * 3.7502 TextBox7.Text = DOL * 1.49825 TextBox8.Text = DOL * 30.9005 TextBox9.Text = DOL * 6.90964 TextBox10.Text = DOL * 1.97992 TextBox11.Text = DOL * 1.49883 End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" TextBox4.Text = "" TextBox5.Text = "" TextBox6.Text = "" TextBox7.Text = "" TextBox8.Text = "" TextBox9.Text = "" TextBox10.Text = "" TextBox11.Text = "" End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click End End Sub End Class

CALCULADORA

Public Class Form1 Dim dato As Double Dim dato2 As Double Dim RESUL As Double Dim OPE As Double Dim PUN As Double Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT14.Click TextBox1.Text = TextBox1.Text & "8" End Sub Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT1.Click TextBox1.Text = TextBox1.Text & "0" End Sub Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT2.Click TextBox1.Text = TextBox1.Text & "." PUN = 1 If PUN = 1 Then BT2.Enabled = False End If End Sub Private Sub BT3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT3.Click dato2 = Val(TextBox1.Text) If OPE = 1 Then RESUL = dato + dato2 TextBox1.Text = RESUL Else If OPE = 2 Then

RESUL = dato - dato2 TextBox1.Text = RESUL Else If OPE = 3 Then RESUL = dato * dato2 TextBox1.Text = RESUL Else If OPE = 4 Then RESUL = dato / dato2 TextBox1.Text = RESUL End If End If End If End If End Sub Private Sub BT4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT4.Click OPE = 4 dato = Val(TextBox1.Text) TextBox1.Clear() BT2.Enabled = True End Sub Private Sub BT5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT5.Click TextBox1.Text = TextBox1.Text & "1" End Sub Private Sub BT6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT6.Click TextBox1.Text = TextBox1.Text & "2" End Sub Private Sub BT7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT7.Click TextBox1.Text = TextBox1.Text & "3" End Sub Private Sub BT9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT9.Click TextBox1.Text = TextBox1.Text & "4" End Sub Private Sub BT10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT10.Click TextBox1.Text = TextBox1.Text & "5" End Sub

Private Sub BT11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT11.Click TextBox1.Text = TextBox1.Text & "6" End Sub Private Sub BT13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT13.Click TextBox1.Text = TextBox1.Text & "7" End Sub Private Sub BT15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT15.Click TextBox1.Text = TextBox1.Text & "9" End Sub Private Sub BT8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT8.Click OPE = 3 dato = Val(TextBox1.Text) TextBox1.Clear() BT2.Enabled = True End Sub Private Sub BT12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT12.Click OPE = 2 dato = Val(TextBox1.Text) TextBox1.Clear() BT2.Enabled = True End Sub Private Sub BT16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT16.Click OPE = 1 dato = Val(TextBox1.Text) TextBox1.Clear() BT2.Enabled = True End Sub Private Sub BT17_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT17.Click TextBox1.Clear() End Sub End class

CUATRO OPERACIONES BASICAS

Public Class Form1 Dim Text3 As Integer Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click TextBox3.Text = Val(TextBox2.Text) + Val(TextBox1.Text) End Sub Private Sub Button2_Click_1(ByVal sender As System.Object,

ByVal e As System.EventArgs) Handles Button2.Click TextBox3.Text = Val(TextBox2.Text) - Val(TextBox1.Text) End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click TextBox3.Text = Val(TextBox2.Text) * Val(TextBox1.Text) End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click TextBox3.Text = Val(TextBox2.Text) / Val(TextBox1.Text) End Sub End Class

FACTURA

Public Class Form1 Dim CT As Double Dim CT1 As Double Dim CT2 As Double Dim CT3 As Double Dim CT4 As Double Dim VU As Double Dim VU1 As Double Dim VU2 As Double Dim VU3 As Double Dim VU4 As Double Dim vt As Double Dim vt1 As Double Dim vt2 As Double Dim vt3 As Double Dim vt4 As Double Dim R As Double Dim V2 As Double Dim v3 As Double Private Sub Button1_Click(ByVal

sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click CT = Val(TextBox1.Text) CT1 = Val(TextBox2.Text) CT2 = Val(TextBox3.Text) CT3 = Val(TextBox4.Text) CT4 = Val(TextBox5.Text) VU = Val(TextBox11.Text) VU1 = Val(TextBox12.Text) VU2 = Val(TextBox13.Text) VU3 = Val(TextBox14.Text) VU4 = Val(TextBox15.Text) TextBox16.Text = CT * VU TextBox17.Text = CT1 * VU1 TextBox18.Text = CT2 * VU2 TextBox19.Text = CT3 * VU3 TextBox20.Text = CT4 * VU4 vt = Val(TextBox16.Text) vt1 = Val(TextBox17.Text)

vt2 = Val(TextBox18.Text) vt3 = Val(TextBox19.Text) vt4 = Val(TextBox20.Text) TextBox21.Text = vt + vt1 + vt2 + vt3 + vt4 If (TextBox21.Text > 10000) Then TextBox22.Text = (TextBox21.Text * 100) / 25 MsgBox("DESCUENTO DE 25%") Else If (TextBox21.Text > 5000 & TextBox21.Text < 10000) Then TextBox22.Text = (TextBox21.Text * 100) / 20 MsgBox("DESCUENTO DE 20%") Else If (TextBox21.Text >= 2500 & TextBox21.Text < 5000) Then TextBox22.Text = (TextBox21.Text * 100) / 15 MsgBox("DESCUENTO DE 15%") Else If (TextBox21.Text >= 1200 & TextBox21.Text < 2500) Then TextBox22.Text = (TextBox21.Text * 100) / 10 MsgBox("DESCUENTO DE 10%") Else If (TextBox21.Text >= 350 & TextBox21.Text < 1200) Then TextBox22.Text = (TextBox21.Text * 100) / 5 MsgBox("DESCUENTO DE 5%") Else If (TextBox21.Text < 350) Then TextBox22.Text = 0.0 MsgBox("NO HAY DESCUENTO") End If End If End If End If End If End If TextBox23.Text = TextBox21.Text - TextBox22.Text R = TextBox21.Text * 0.1 V2 = Val(TextBox22.Text) v3 = Val(TextBox24.Text) TextBox24.Text = TextBox21.Text - R TextBox25.Text = (TextBox21.Text - V2) + v3

End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" TextBox4.Text = "" TextBox5.Text = "" TextBox6.Text = "" TextBox7.Text = "" TextBox8.Text = "" TextBox9.Text = "" TextBox10.Text = "" TextBox11.Text = "" TextBox12.Text = "" TextBox13.Text = "" TextBox14.Text = "" TextBox15.Text = "" TextBox16.Text = "" TextBox17.Text = "" TextBox18.Text = "" TextBox19.Text = "" TextBox20.Text = "" TextBox21.Text = "" TextBox22.Text = "" TextBox23.Text = "" TextBox24.Text = "" TextBox25.Text = "" End Sub End Class


Recommended