jueves, 6 de marzo de 2014

CODIGO TAREA EN VISUAL BASIC 2008

Queridos Estudiantes Les Dejo El Codigo Para Que Ustedes Creen La Interface Sobre Los Controles CheckBox. Saludos. 
Public Class Form1
    Dim a, b, c As Double

    Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
        If Me.CheckBox1.Checked = True Then

            a = Val(Me.TextBox1.Text)
            b = Val(Me.TextBox2.Text)
            c = (a + b)
            Me.TextBox3.Text = Str(c)
        Else
            Me.TextBox3.Clear()
        End If
    End Sub

    Private Sub CheckBox2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox2.CheckedChanged
        If Me.CheckBox2.Checked = True Then

            a = Val(Me.TextBox1.Text)
            b = Val(Me.TextBox2.Text)
            c = (a - b)
            Me.TextBox3.Text = Str(c)
        Else
            Me.TextBox3.Clear()
        End If
    End Sub

    Private Sub CheckBox3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox3.CheckedChanged
        If Me.CheckBox3.Checked = True Then

            a = Val(Me.TextBox1.Text)
            b = Val(Me.TextBox2.Text)
            c = (a * b)
            Me.TextBox3.Text = Str(c)
        Else
            Me.TextBox3.Clear()
        End If
    End Sub

    Private Sub CheckBox4_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox4.CheckedChanged
        If Me.CheckBox4.Checked = True Then

            a = Val(Me.TextBox1.Text)
            b = Val(Me.TextBox2.Text)
            c = (a / b)
            Me.TextBox3.Text = Str(c)
        Else
            Me.TextBox3.Clear()
        End If
    End Sub

    Private Sub CheckBox5_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox5.CheckedChanged
        If Me.CheckBox5.Checked = True Then
            Me.Label1.Visible = False
            Me.Label2.Visible = False
            Me.Label5.Visible = True
            Me.Label6.Visible = True
            a = Val(Me.TextBox1.Text)
            b = Val(Me.TextBox2.Text)
            c = (a ^ b)
            Me.TextBox3.Text = Str(c)
        Else
            Me.TextBox3.Clear()
            Me.Label1.Visible = True
            Me.Label2.Visible = True
            Me.Label5.Visible = False
            Me.Label6.Visible = False

        End If
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Me.TextBox1.Clear()
        Me.TextBox2.Clear()
        Me.TextBox3.Clear()

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        End

    End Sub
End Class

QUERIDOS ESTUDIANTES QUIEN DISEÑE LA INTERFACES CORRECTA Y ME DIGA QUE HACE ESPECÍFICAMENTE EL SIGUIENTE CÓDIGO  Y ME ENVIÉ LA RESPUESTA A MI CORREO HASTA EL SÁBADO ANTES DE LAS 6 DE LA MAÑANA TENDRÁ 10 PUNTOS EN PRACTICAS, SUERTE.

Public Class Form1
    Dim dato1 As Double
    Dim dato2 As Double
    Dim resul As Double
    Dim punto As Double
    Dim opera As Double


    Private Sub BT10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT0.Click
        Me.TextBox1.Text = Me.TextBox1.Text & "0"


    End Sub

    Private Sub BTLIM_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTLIM.Click
        Me.TextBox1.Clear()
        Me.BTPU.Enabled = True

    End Sub

    Private Sub BT7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT7.Click
        Me.TextBox1.Text = Me.TextBox1.Text & "1"

    End Sub

    Private Sub BT8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT8.Click
        Me.TextBox1.Text = Me.TextBox1.Text & "2"
    End Sub

    Private Sub BT9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT9.Click
        Me.TextBox1.Text = Me.TextBox1.Text & "3"
    End Sub

    Private Sub BT4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT4.Click
        Me.TextBox1.Text = Me.TextBox1.Text & "4"
    End Sub

    Private Sub BT5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT5.Click
        Me.TextBox1.Text = Me.TextBox1.Text & "5"
    End Sub

    Private Sub BT6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT6.Click
        Me.TextBox1.Text = Me.TextBox1.Text & "6"
    End Sub

    Private Sub BT1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT1.Click
        Me.TextBox1.Text = Me.TextBox1.Text & "7"
    End Sub

    Private Sub BT2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT2.Click
        Me.TextBox1.Text = Me.TextBox1.Text & "8"
    End Sub

    Private Sub BT3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BT3.Click
        Me.TextBox1.Text = Me.TextBox1.Text & "9"
    End Sub

    Private Sub BT11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTPU.Click
        Me.TextBox1.Text = Me.TextBox1.Text & "."
        punto = 1
        If punto = 1 Then
            Me.BTPU.Enabled = False
        End If
    End Sub

    Private Sub BTMULTI_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTMULTI.Click
        opera = 2
        dato1 = Val(Me.TextBox1.Text)
        Me.TextBox1.Clear()
        Me.BTPU.Enabled = True


    End Sub

    Private Sub BTSUMA_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTSUMA.Click
        opera = 1
        dato1 = Val(Me.TextBox1.Text)
        Me.TextBox1.Clear()
        Me.BTPU.Enabled = True

    End Sub

    Private Sub BTIGUAL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTIGUAL.Click
        dato2 = Val(Me.TextBox1.Text)
        Me.TextBox1.Clear()
        Me.BTPU.Enabled = True
        If opera = 1 Then
            resul = (dato1 + dato2)
            Me.TextBox1.Text = Str(resul)
        Else

            If opera = 2 Then
                resul = (dato1 * dato2)
                Me.TextBox1.Text = Str(resul)
            Else
                If opera = 3 Then
                    resul = (dato1 - dato2)
                    Me.TextBox1.Text = Str(resul)
                Else
                    If opera = 4 Then
                        resul = (dato1 / dato2)
                        Me.TextBox1.Text = Str(resul)
                    Else
                        If opera = 5 Then
                            resul = (dato1 ^ dato2)
                            Me.TextBox1.Text = Str(resul)
                        End If
                    End If
                End If


            End If
        End If

    End Sub

    Private Sub BTRESTA_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTRESTA.Click
        opera = 3
        dato1 = Val(Me.TextBox1.Text)
        Me.TextBox1.Clear()
        Me.BTPU.Enabled = True

    End Sub

    Private Sub BTDIVI_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTDIVI.Click
        opera = 4
        dato1 = Val(Me.TextBox1.Text)
        Me.TextBox1.Clear()
        Me.BTPU.Enabled = True
    End Sub

    Private Sub BTPO_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTPO.Click
        opera = 5
        dato1 = Val(Me.TextBox1.Text)
        Me.TextBox1.Clear()
        Me.BTPU.Enabled = True

    End Sub
End Class



No hay comentarios:

Publicar un comentario