PROBLEMA 1 - Ramón
Enviado por • 24 de Mayo de 2014 • 2.270 Palabras (10 Páginas) • 141 Visitas
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim a As Integer
Dim b As String
Dim c As Byte
a = InputBox("Ingresar el modelo del auto")
b = InputBox("Ingrese la marca del auto")
c = InputBox("Edad del conductor")
If a = 2013 Then
If b = "a" Then
If c > 17 And c < 26 Then
MsgBox(250 + 200)
ElseIf c > 25 And c < 36 Then
MsgBox(250 + 100)
ElseIf c > 35 And c < 50 Then
MsgBox(250 + 200)
End If
ElseIf b = "b" Then
If c > 17 And c < 26 Then
MsgBox(350 + 200)
ElseIf c > 25 And c < 36 Then
MsgBox(350 + 100)
ElseIf c > 35 And c < 50 Then
MsgBox(350 + 50)
End If
ElseIf b = "c" Then
If c > 17 And c < 26 Then
MsgBox(550 + 200)
ElseIf c > 25 And c < 36 Then
MsgBox(550 + 100)
ElseIf c > 35 And c < 50 Then
MsgBox(550 + 50)
End If
End If
ElseIf a = 2014 Then
If b = "a" Then
If c > 17 And c < 26 Then
MsgBox(300 + 200)
ElseIf c > 25 And c < 36 Then
MsgBox(300 + 100)
ElseIf c > 35 And c < 50 Then
MsgBox(300 + 200)
End If
ElseIf b = "b" Then
If c > 17 And c < 26 Then
MsgBox(420 + 200)
ElseIf c > 25 And c < 36 Then
MsgBox(420 + 100)
ElseIf c > 35 And c < 51 Then
MsgBox(420 + 50)
End If
End If
End If
End Sub
PROBLEMA 1 - JuanK
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim modelo As String
Dim marca As String
Dim edad As Integer
Dim AcuotaA As Integer
Dim AcuotaB As Integer
Dim AcuotaC As Integer
Dim BcuotaA As Integer
Dim BcuotaB As Integer
modelo = InputBox("ingrese el año de modelo de su auto: 2013 o 2014")
marca = InputBox("ingrese la marca de su auto: A,B o C")
edad = InputBox("ingrese la edad del conductor")
If edad > 17 And edad < 26 Then
AcuotaA = 250 + 200
AcuotaB = 350 + 200
AcuotaC = 550 + 200
BcuotaA = 300 + 200
BcuotaB = 420 + 200
ElseIf edad > 25 And edad < 36 Then
AcuotaA = 250 + 100
AcuotaB = 350 + 100
AcuotaC = 550 + 100
BcuotaA = 300 + 100
BcuotaB = 420 + 100
ElseIf edad > 35 And edad < 51 Then
AcuotaA = 250 + 50
AcuotaB = 350 + 50
AcuotaC = 550 + 50
BcuotaA = 300 + 50
BcuotaB = 420 + 50
End If
If modelo = "2013" Then
If marca = "A" Or marca = "a" Then
MsgBox(AcuotaA)
ElseIf marca = "B" Or marca = "b" Then
MsgBox(AcuotaB)
ElseIf marca = "C" Or marca = "c" Then
MsgBox(AcuotaC)
End If
ElseIf modelo = 2014 Then
If marca = "A" Or marca = "a" Then
MsgBox(BcuotaA)
ElseIf marca = "B" Or marca = "b" Then
MsgBox(BcuotaB)
End If
End If
End Sub
PROBLEMA 2
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Dim local As Integer
Dim visitante As Integer
local = InputBox("ingrese los puntos del equipo local")
visitante = InputBox("ingrese los puntos de equipo visitante")
If local > visitante Then
MsgBox("gano local")
ElseIf visitante > local Then
MsgBox("gano visitante")
ElseIf local = visitante Then
MsgBox("empate")
End If
End Sub
PROBLEMA 3
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
Dim monto As Integer
monto = InputBox("ingrese el monto compra")
If monto > 999 And monto < 5001 Then
MsgBox("1%")
ElseIf monto > 5000 And monto < 10001 Then
MsgBox("3%")
ElseIf monto > 10000 And monto < 20002 Then
MsgBox("6%")
Else
MsgBox("vuelva pronto")
End If
End Sub
PROBLEMA 4
Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
Dim dadoA As Integer, dadoB As Integer, dadoC As Integer, total As Integer
dadoA = InputBox("ingrese el valor obtenido con el primer dado (de 1-6)")
dadoB = InputBox("ingrese el valor obtenido con el segundo dado (de 1-6)")
dadoC = InputBox("ingrese el valor obtenido con el tercer dado (de 1-6)")
total = dadoA + dadoB + dadoC
If dadoA > 6 Or dadoB > 6 Or dadoC > 6 Then
MsgBox("NÚMERO INVALIDO")
Else
If total > 12 Then
MsgBox("excelente")
ElseIf total > 8 And total < 13 Then
MsgBox("muy bien")
Else
MsgBox("vuelva a intentarlo")
End If
End If
End Sub
...