Professional Documents
Culture Documents
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim medico, accidentes, incendios, robo As Integer Dim parcial, parcial1, parcial2, parcial3 As Double Dim pagoparcial As Double Dim desc, desc1, desc2, desc3, desc4, desc5 As Double Dim pagofinal As Double Dim formap As Double medico = Val(TextBox5.Text) accidentes = Val(TextBox6.Text) incendios = Val(TextBox7.Text) robo = Val(TextBox8.Text) pagoparcial = Val(TextBox17.Text)
If accidentes = 2 Then parcial1 = TextBox10.Text Else parcial1 = 0 End If If incendios = 3 Then parcial2 = TextBox11.Text Else parcial2 = 0 End If If robo = 4 Then parcial3 = TextBox12.Text Else parcial3 = 0 End If pagoparcial = parcial + parcial1 + parcial2 + parcial3 TextBox17.Text = Str(pagoparcial) If accidentes = 2 And incendios = 3 Then desc = pagoparcial * 0.03 Else desc = 0 End If If medico = 1 And accidentes = 2 And incendios = 3 And robo = 4 Then desc1 = pagoparcial * 0.07 Else desc1 = 0 End If If TextBox19.Text = "A" Then desc2 = pagoparcial * 0.05 Else desc2 = 0 End If If TextBox19.Text = "B" Then desc5 = pagoparcial * 0.02 Else desc5 = 0 End If If TextBox19.Text = "C" desc3 = pagoparcial Else desc3 = 0 End If If TextBox19.Text = "D" desc4 = pagoparcial Else desc4 = 0 End If
Then * 0.03
Then * 0.04
pagofinal = pagoparcial - desc - desc1 - desc2 - desc3 - desc4 - desc5 TextBox18.Text = Str(pagofinal) If TextBox13.Text = "M" Then formap = pagofinal / 12
End If If TextBox13.Text = "A" Then formap = pagofinal End If Label13.Text = "se pagara " & formap & "al " & TextBox13.Text 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() TextBox9.Clear() TextBox10.Clear() TextBox11.Clear() TextBox12.Clear() TextBox13.Clear() TextBox17.Clear() TextBox18.Clear() TextBox19.Clear() TextBox1.Focus() End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click If MsgBox("desea salir del programa", vbQuestion + vbYesNo, "mensaje salida") = vbYes Then End End If End Sub End Class
PROBLEMA2
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim tema1, tema2, tema3 As Double Dim conferencia As String Dim pagoparcial As Double Dim desc1, desc2 As Double Dim pago As String conferencia = TextBox4.Text
If conferencia = software Then tema1 = 150 tema2 = 250 tema3 = 275 End If
If conferencia = 5ecnica Then tema1 = 175 tema2 = 200 tema3 = 295 End If If conferencia = derecho Then tema1 = 225 tema2 = 255 tema3 = 285 End If
pagoparcial = tema1 + tema2 + tema3 TextBox9.Text = Str(pagoparcial) If conferencia = software Then desc1 = pagoparcial * 0.02 End If If conferencia = mecanica Then desc1 = pagoparcial * 0.03 End If If conferencia = derecho Then desc1 = pagoparcial * 0.04 End If
If pago = E Then desc2 = pagoparcial * 0.05 End If If pago = c Then desc2 = pagoparcial * 0.02 End If If pago = D Then desc2 = pagoparcial * 0.04 End If TextBox10.Text = desc1 + desc2 TextBox11.Text = pagoparcial desc1 desc2 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() TextBox8.Clear() TextBox9.Clear() TextBox10.Clear() TextBox11.Clear() TextBox1.Focus() End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click If MsgBox(desea salir del programa, vbQuestion + vbYesNo, mensaje salida) = vbYes Then End End If End Sub End Class
PROBLEMA3
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim diasusar As Double Dim prekilometro As Double Dim totkilometro As Double Dim pagoparcial As Double Dim multi As Double Dim desc1 As Double Dim pagofinal As Double Dim dao, dao1, dao2 As String Dim cobro, cobro1, cobro2 As Double Dim cobrodao As Double
End If If TextBox6.Text = "P" Then multi = 175 End If If TextBox6.Text = "C" Then multi = 195 End If If TextBox6.Text = "L" Then multi = 275
End If pagoparcial = (prekilometro * totkilometro) + multi TextBox7.Text = Str(pagoparcial) If diasusar > 1 < 5 Then desc1 = pagoparcial * 0.02 End If If diasusar desc1 = End If If diasusar desc1 =
End If TextBox14.Text = Str(desc1) pagofinal = pagoparcial - desc1 TextBox8.Text = Str(pagofinal) If dao = "1" Then cobro = pagofinal * 0.1 Else cobro = 0 End If If dao1 = cobro1 Else cobro1 End If If dao2 = cobro2 Else cobro2 End If "2" Then = pagofinal * 0.05 = 0 "3" Then = pagofinal * 0.07 = 0
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() TextBox9.Clear() TextBox10.Clear() TextBox11.Clear() TextBox12.Clear() TextBox14.Clear() TextBox1.Focus() End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click If MsgBox("desea salir del programa", vbQuestion + vbYesNo, "mensaje salida") = vbYes Then End End If End Sub End Class