Study the code below;
Public Class Form1
Dim secretnum As Integer = Int (10 * Rnd() ) + 1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox1.Text <>Then TextBox2.Text = "higher"
If TextBox1.Text > secretnum Then TextBox2.Text = "lower"
If TextBox1.Text = secretnum Then TextBox2.Text = "correct"
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Randomize ()
Secretnum = Int (10 * Rnd() ) + 1
TextBox1.Text = ""
TextBox2.Text = ""
End Sub
End Class
Answer the following:
1. How many objects are referred to? What are they?
2.What is the name of the variable referred to?
3. What are the three text options that appear in textbox1?
4. What do you think this code does?
5. Build this code into a project and get it to work!!
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment