Labo 3
Labo 3
Labo 3
EJERCICIO N1
Public Class Form1
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles
Button1.Click
Dim GG, MM, SS, B As Integer
Dim CLASI As String
GG = TextBox1.Text
MM = TextBox2.Text
SS = TextBox3.Text
B = GG + (MM / 60) + (SS / 3600)
If B = 0 Then
CLASI = "NULO"
ElseIf B < 90 Then
CLASI = "AGUDO"
ElseIf B = 90 Then
CLASI = "RECTO"
ElseIf B < 180 Then
CLASI = "OBTUSO"
ElseIf B = 180 Then
CLASI = "LLANO"
ElseIf B < 360 Then
CLASI = "CONCAVO"
Else
CLASI = "COMPLETO"
End If
TextBox4.Text = CLASI
End Sub
Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles
Button2.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
End Sub
Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles
Button3.Click
End
End Sub
End Class
EJERCICIO N2
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
Dim CATEG As String
Dim PROM, PENSION, DSCTO, NPENSION As Double
CATEG = TextBox1.Text
PROM = TextBox2.Text
If CATEG = "A" Then
PENSION = 550
ElseIf CATEG = "B" Then
PENSION = 500
ElseIf CATEG = "c" Then
PENSION = 460
Else
PENSION = 400
End If
If PROM <= 13.99 Then
DSCTO = 0
ElseIf PROM <= 15.99 Then
DSCTO = 0.1 * PENSION
ElseIf PROM <= 17.99 Then
DSCTO = 0.12 * PENSION
Else
DSCTO = 0.15 * PENSION
End If
NPENSION = PENSION - DSCTO
TextBox3.Text = DSCTO
TextBox4.Text = NPENSION
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
EJERCICIO N3
Public Class Form1
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles
Button1.Click
EJERCICIO N4
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
Dim SUELDO, AUMENTO, NSUELDO As Double
SUELDO = TextBox1.Text
If SUELDO <= 1000 Then
AUMENTO = 0.3 * SUELDO
ElseIf SUELDO <= 1500 Then
AUMENTO = 0.25 * SUELDO
Else
AUMENTO = 0.2 * SUELDO
End If
NSUELDO = SUELDO + AUMENTO
TextBox2.Text = AUMENTO
TextBox3.Text = NSUELDO
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
EJERCICIO N5
Public Class Form1
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles
Button1.Click
Dim Y, X 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
Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles
Button2.Click
TextBox1.Text = ""
TextBox2.Text = ""
End Sub
Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles
Button3.Click
End
End Sub
End Class
EJERCICIO N6
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
Dim X As Integer
Dim FX As Double
X = TextBox1.Text
If X Mod 4 = 0 Then
FX = X ^ 3
ElseIf X Mod 4 = 1 Then
FX = X / 6
ElseIf X Mod 4 = 2 Then
FX = X ^ 2
ElseIf X Mod 4 = 3 Then
FX = X + 5
Else
FX = 0
End If
TextBox2.Text = FX
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
EJERCICIO N7
Public Class Form1
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles
Button1.Click
Dim HT, TN As Integer
Dim SB, DES, SN As Double
HT = TextBox1.Text
TN = TextBox2.Text
If HT <= 48 Then
SB = HT * TN
ElseIf HT > 48 Then
SB = (48 * TN) + ((HT - 48) * 1.15 * TN)
End If
If SB > 1000 Then
DES = 0.12 * SB
ElseIf SB <= 1000 Then
DES = 0
End If
SN = SB - DES
TextBox3.Text = SB
TextBox4.Text = DES
TextBox5.Text = SN
End Sub
Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles
Button2.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
End Sub
Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles
Button3.Click
End
End Sub
End Class
EJERCICIO N8