Labo 3 de Programacion 2013
Labo 3 de Programacion 2013
PROBLEMA NRO 1
End If
TextBox4.Text = HA
TextBox5.Text = HB
TextBox6.Text = HC
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 = ""
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button3.Click
End
End Sub
End Class
PROBLEMA 3
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
Dim X, Y As Double
Y = TextBox1.Text
If Y > 0 And Y <= 11 Then
X = 3 * Y + 30
ElseIf Y > 11 And Y <= 33 Then
X = Y * Y - 10
ElseIf Y > 33 And Y <= 64 Then
X=Y*Y*Y+Y*Y-1
Else
X=0
End If
TextBox2.Text = X
End Sub
PROBLEMA 5
Public Class Form1
Public C1, C2, C3, C4 As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
Dim V As Integer
V = TextBox1.Text
ListBox1.Items.Add(V)
If V = 1 Then
C1 = C1 + 1
ElseIf V = 2 Then
C2 = C2 + 1
ElseIf V = 3 Then
C3 = C3 + 1
ElseIf V = 4 Then
C4 = C4 + 1
Else : MessageBox.Show("ERROR..VOTO INVALIDO")
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button2.Click
Dim TOT As Integer
Dim P1, P2, P3, P4 As Double
TOT = C1 + C2 + C3 + C4
P1 = (C1 / TOT) * 100
P2 = (C2 / TOT) * 100
P3 = (C3 / TOT) * 100
P4 = (C4 / TOT) * 100
TextBox2.Text = C1
TextBox3.Text = C2
TextBox4.Text = C3
TextBox5.Text = C4
TextBox6.Text = P1
TextBox7.Text = P2
TextBox8.Text = P3
TextBox9.Text = P4
C1 = 0
C2 = 0
C3 = 0
C4 = 0
P1 = 0
P2 = 0
P3 = 0
P4 = 0
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button3.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox6.Text = ""
TextBox7.Text = ""
TextBox8.Text = ""
TextBox9.Text = ""
ListBox1.Items.Clear()
End Sub
PROBLEMA 6
Else
SB = (48 * TN) + (HT - 48) * (1.15 * TN)
End If
If SB > 1000 Then
D = 0.12 * SB
Else
D=0
End If
SNETO = SB - D
TextBox3.Text = SB
TextBox4.Text = D
TextBox5.Text = SNETO
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 = ""
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button3.Click
End
End Sub
End Class