domingo, 5 de junio de 2011

Ejercicio Pasar de un grupo a otro

 EJERCICIO PASAR DE UN GRUPO A OTRO



 

Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
ListBox1.Items.Add(TextBox1.Text)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
ListBox2.Items.Add(TextBox1.Text)
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
ListBox2.Items.Add(ListBox1.SelectedItem)
ListBox1.Items.RemoveAt(ListBox1.SelectedIndex)
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
ListBox1.Items.Add(ListBox2.SelectedItem)
ListBox2.Items.RemoveAt(ListBox2.SelectedIndex)
End Sub

End Class

Ejercicio Listbox




Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
ListBox1.Items.Add(TextBox1.Text)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
ListBox1.Items.RemoveAt(ListBox1.SelectedIndex)
End Sub
End
Class

lunes, 2 de mayo de 2011

Ejercicio Residencia

 EJERCICIO RESIDENCIAS


Public Class Total

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim Tipo As String
        Dim VTSs As Single = 0
        Dim Total As Single

        If RadioButton1.Checked Then
            Tipo = "Sencilla"
        Else
            If RadioButton2.Checked Then
                Tipo = "Doble"
            Else
                If RadioButton3.Checked Then
                    Tipo = " Triple"
                End If
            End If
        End If
        If CheckBox1.Checked Then
            VTSs += 10000
        End If
        If CheckBox2.Checked Then
            VTSs += 10000
        End If
        If CheckBox3.Checked Then
            VTSs += 10000
        End If
        Select Case Tipo
            Case "Sencilla"
                Total = 50000 + VTSs


            Case "Doble"
                Total = 80000 + VTSs

            Case "Triple"
                Total = 100000 + VTSs

        End Select
        TextBox1.Text = CStr(Total)
    End Sub
End Class

Ejercicio Seleccion


EJERCICIO SELECCION FIGURA




Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim figura As String
Dim grafico As Graphics
Dim lapiz As Pen

If RadioButton1.Checked Then
figura = "circulo"
Else
If RadioButton2.Checked Then
figura = "linea"
Else
If RadioButton3.Checked Then
figura = " cuadrado"
End If

End If

End If

Select Case figura

Case "circulo"
grafico = CreateGraphics()
lapiz = New Pen(Color.PaleVioletRed, 4)
grafico.DrawEllipse(lapiz, 10, 10, 110, 300)

Case "linea"


grafico = CreateGraphics()
lapiz = New Pen(Color.Blue, 4)
grafico.DrawLine(lapiz, 10, 10, 100, 100)

Case " cuadrado"

grafico = CreateGraphics()
lapiz = New Pen(Color.Red, 4)
grafico.DrawRectangle(lapiz, 50, 50, 150, 150)




End Select


End Sub

Ejercicio Cuadrado

EJERCICIO CUADRADO



Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim grafico As Graphics
Dim lapiz As Pen
grafico = CreateGraphics()
lapiz =
New Pen(Color.Blue, 2)
grafico.DrawRectangle(lapiz, 128, 10, 100, 100)

End Sub
End
Class

Ejercicio Circulo

 EJERCICIO CIRCULO

 

Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim grafico As Graphics
Dim lapiz As Pen
grafico = CreateGraphics()
lapiz =
New Pen(Color.Blue, 2)
grafico.DrawEllipse(lapiz, 128, 10, 100, 100)

End Sub
End
Class

Ejercicio Linea

 EJERCICIO LINEA


 
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim grafico As Graphics 
Dim lapiz As Pen grafico = CreateGraphics()
lapiz =
New Pen(Color.Blue, 2)
grafico.DrawLine(lapiz, 10, 10, 100, 100)

End Sub
End
Class

Ejercicio Radio Button

RADIO BUTTON


miércoles, 6 de abril de 2011

Quiz Segundo Corte

QUIZ SEGUNDO CORTE


Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.ClickDim ventas As DecimalDim tipo As StringDim basico As DecimalDim antiguedad As SingleDim comision As DecimalDim sueldo As Decimalventas = TextBox1.Text
tipo = TextBox2.Text
basico = TextBox3.Text
antiguedad = TextBox4.Text
If (tipo = "medio") ThenIf (ventas < 5000000) Thencomision = ventas * 0.15
Elsecomision = ventas * 0.3
End IfEnd IfIf (tipo = "completo") ThenIf (ventas < 5000000) Thencomision = ventas * 0.1
Elsecomision = ventas * 0.2
End IfEnd IfIf (antiguedad <= 0) Thenbasico = basico * 0.4
If (antiguedad = 3) Thenbasico = basico * 0.6
Elsebasico = basico * 1
End IfEnd Ifsueldo = basico + comision
TextBox5.Text =
 
"Sueldo: " + CStr(sueldo)End Sub

jueves, 31 de marzo de 2011

Ejercicio Programacion Tipo de Contrato‏ Sueldo Ventas‏

Ejercicio Tipo de Contrato


Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles Button1.Click
Dim ventas As Decimal
Dim basico As Decimal
Dim tipo As String
Dim comision As Decimal
Dim sueldo As Decimal
ventas = TextBox1.Text
basico = TextBox2.Text
tipo = TextBox3.Text
If (tipo = "medio") Then
basico = basico / 2
If (ventas < 3000000) Then
comision = ventas * 0.03
sueldo = basico + comision
Else
If (ventas < 7000000) Then
comision = ventas * 0.05
sueldo = basico + comision
Else
comision = ventas * 0.07
sueldo = basico + comision
End If
End If
Else
If (ventas < 7000000) Then
comision = ventas * 0.07
sueldo = basico + comision
Else
If (ventas < 13000000) Then
comision = ventas * 0.09
sueldo = basico + comision
Else
comision = ventas * 0.12
sueldo = basico + comision
End If
End If
End If
TextBox4.Text = "Sueldo: " + CStr(sueldo)
End Sub
End
Class

Ejercicio Programacion Sueldo Ventas‏

Ejercicio Sueldo Ventas


Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles Button1.Click
Dim ventas As Decimal
Dim basico As Decimal
Dim comision As Decimal
Dim sueldo As Decimal
ventas = TextBox1.Text
basico = TextBox2.Text
If (ventas < 3000000) Then
comision = ventas * 0.03
sueldo = basico + comision
Else
If (ventas < 7000000) Then
comision = ventas * 0.05
sueldo = basico + comision
Else
sueldo = basico + ventas * 0.07
End If
End If
TextBox3.Text = "Sueldo: " + CStr(sueldo)
End Sub
End
Class

Ejercicio Programacion Comision‏


Ejercicio Comision


Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim ventas As Single
Dim comision As Single
Dim valcomision As Single
TextBox1.Text = ventas
TextBox2.Text = comision
If (ventas >= 3000000) Then
valcomision = ventas * comision / 100
TextBox3.Text = "Comision: " + CStr(valcomision)
Else
TextBox3.Text = "Ventas inferiores a 3000000"

End If
End Sub
End Class

Ejercicio Programación Triangulo‏


Ejercicio Triangulo



Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim l1 As Single
Dim l2 As Single
Dim l3 As Single
l1 = TextBox1.Text
l2 = TextBox2.Text
l3 = TextBox3.Text
If (l1 = l2 And l2 = l3) Then
TextBox4.Text = "Equilatero"
Else
If (l1 <> l2) And (l1 <> l3) And (l2 <> l3) Then
TextBox4.Text = "Escaleno"
Else
TextBox4.Text = "Isoseles"
End If
End If
End Sub
End Class

Ejercicio Programación Random‏


EJERCICIO RANDOM (Rnd())



Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim num1 As Single
Dim num2 As Single
num1 = TextBox1.Text
num2 = CInt(Int((6 * Rnd())) + 1)
TextBox2.Text = CStr(num2)
If (num1 <= num2) Then
textbox3.text = "Perdio"
Else
TextBox3.Text = "Ganó"
End If
End Sub
End Class

miércoles, 16 de marzo de 2011

PRIMER PARCIAL

PRIMER PUNTO

 Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim num1 As Single
        Dim num2 As Single
        Dim num3 As Single
        Dim num4 As Single
        Dim num5 As Single
        Dim num6 As Single
        Dim num7 As Single
        Dim num8 As Single
        Dim suma As Single
        Dim multiplicacion As Single
        Dim resta As Single
        Dim division As Single
        num1 = TextBox1.Text
        num2 = TextBox2.Text
        num3 = TextBox3.Text
        num4 = TextBox4.Text
        num5 = TextBox5.Text
        num6 = TextBox6.Text
        num7 = TextBox7.Text
        num8 = TextBox8.Text
        suma = num1 + num2
        Label3.Text = CStr(suma)
        multiplicacion = num3 * num4
        Label6.Text = CStr(multiplicacion)
        resta = num5 - num6
        Label9.Text = CStr(resta)
        division = num7 / num8
        Label12.Text = CStr(division)
    End Sub
End Class

SEGUNDO PUNTO


Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim nombres(4) As String
        Dim sueldos(4) As Single
        Dim total As Single
        nombres(0) = TextBox1.Text
        nombres(1) = TextBox3.Text
        nombres(2) = TextBox5.Text
        nombres(3) = TextBox7.Text
        sueldos(0) = TextBox2.Text
        sueldos(1) = TextBox4.Text
        sueldos(2) = TextBox6.Text
        sueldos(3) = TextBox8.Text
        total = sueldos(0) + sueldos(1) + sueldos(2) + sueldos(3)
        TextBox9.Text = nombres(0) + CStr(sueldos(0)) + vbCrLf + nombres(1) + CStr(sueldos(1)) + vbCrLf + nombres(2) + CStr(sueldos(2)) + vbCrLf + nombres(3) + CStr(sueldos(3)) + vbCrLf + "total:" + CStr(total)
    End Sub
End Class