Question 1
Question
1.- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
REM ¿QUÉ VALOR DE X SE IMPRIME?
Dim X As Integer
For X = 1 To 5
Next
MessageBox.Show(" X = " & X)
End Sub
Question 2
Question
2.- Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
REM CUANTOS ASTERISCOS IMPRIME EL PROGRAMA?
Dim X As Integer
For X = 3 To 1
MessageBox.Show("*")
Next
End Sub
Question 3
Question
3.- Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
REM ¿QUÉ VALOR DE X SE IMPRIME?
Dim X As Integer
X = 5
X = X + 2
X = -1
MessageBox.Show("X = " & X)
End Sub
Question 4
Question
4.- Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
REM CUANTOS ASTERISCOS IMPRIME EL PROGRAMA?
Dim X As Integer
For X = 5 To 7 Step 2
MessageBox.Show("*")
Next
End Sub
Question 5
Question
5.- Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
REM ¿QUÉ IMPRIME ESTE PROGRAMA?
Dim X As Integer
X = 5 + 3
X = X + X
If X > 16 Then
MessageBox.Show(" # ")
Else
MessageBox.Show(" $ ")
End If
End Sub
Question 6
Question
6.- Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
REM ¿QUÉ VALOR DE Y SE IMPRIME? 2
Dim X As Integer
Dim Y As Integer
X = 5
Y = 2
X = Y
Y = X
MessageBox.Show("Y = " & Y)
End Sub
Question 7
Question
7.- Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click
REM ¿QUÉ SECUENCIA DE CARACTERES IMPRIME ESTE PROGRAMA?
Dim X As Integer
Dim Y As Integer
MessageBox.Show("%")
If X > Y Then
MessageBox.Show(">")
Else
MessageBox.Show("<")
End If
MessageBox.Show("*")
End Sub
Question 8
Question
8.- Private Sub Button8_Click(sender As Object, e As EventArgs) Handles Button8.Click
REM ¿QUÉ VALOR DE X IMPRIME ESTE PROGRAMA?
Dim X As Integer
X = 8
Select Case X
Case 1 To 7
X = X + 1
Case Is > 7
X = X + 2
Case Else
X = X + 3
End Select
X = X + 1
MessageBox.Show("X = " & X)
End Sub
Question 9
Question
9.- Private Sub Button9_Click(sender As Object, e As EventArgs) Handles Button9.Click
REM ¿CUÁNTOS * IMPRIME ESTE PROGRAMA?
Dim X As Integer
Do
MessageBox.Show(" * ")
Loop While X > 1
End Sub
Question 10
Question
10.- Private Sub Button10_Click(sender As Object, e As EventArgs) Handles Button10.Click
REM ¿QUÉ IMPRIME EL SIGUIENTE PROBLEMA?
Dim X As Double
Dim Y As Integer
X = 3.1416
Y = X + 1
MessageBox.Show(" Y = " & Y)
End Sub
End Class