CP1 - 5.04 - Decision-Making Structures Question Preview (ID: 43990)
CP1 - 5.04 - Decision-Making Structures.
TEACHERS: click here for quick copy question ID numbers.
If the user clicks on btn1 in the code below: Dim gen as New Random; Dim intX As Integer ; intX = gen.Next(2); if intX = 0 Then; btn1.Visible = False; ElseIf intX = 1 Then; btn1.Visible = True; Else MessageBox.Show('intX is: 'and intX); End If
a) the button may become invisible.
b) the MessageBox will display 0.
c) the MessageBox will display 1.
d) the program will terminate.
Which condition is correct?
a) Case 2, 5
b) Case 2 And 5
c) Case 2 - 5
d) Case 2 Or 5
If there are 6 sides on a die, which statement generates a random whole number to represent one of the sides, given the following code? Dim gen As New System.Random()
a) gen.Next(1, 7)
b) gen.Next(1, 6)
c) gen.Next(0,7)
d) gen.Next(6)
Which statement generates random whole numbers greater than or equal to 10 and less than 51, given the following code? Dim gen As New System.Random()
a) gen.Next(10, 51)
b) gen.Next(10, 50)
c) gen.Next(9, 50)
d) gen.Next(9, 51)
Given the following statements: If intGuess=intSelected Then lblMessage.Text=Correct Else lblMessage.Text=Incorrect End If What is displayed when intGuess is 11 and intSelected is 15?
a) Incorrect
b) Correct
c) Correct on one line and Incorrect on the next line
d) Nothing would be displayed
If the 12 months are numbered 1 through 12, which statement generates a random whole number to represent one of the months, given the following code? Dim gen As New System.Random()
a) gen.Next(1, 13)
b) gen.Next(1,12)
c) gen.Next(1,11)
d) gen.Next(12)
If the 7 weekdays are numbered 1 through 7, which statement generates a random whole number to represent one of the days, given the following code? Dim gen As New System.Random()
a) gen.Next(1,8)
b) gen.Next(1,7)
c) gen.Next(7)
d) gen.Next(1, 6)
Given the following statements: Dim intExperience As Integer = 10; If intExperience 5 Then lblMessage.Text=Sufficient Experience Else lblMessage.Text='Inexperienced' End If What is displayed when the statements execute?
a) Sufficient experience
b) Nothing would be displayed
c) Inexperienced
d) Sufficient experience on one line and inexperience on the other
A meat packer grades meat “P” for Prime, “C” for Choice, “S” for Standard, and “G” for Good. Which case expression will represent ChoiceMeat?
a) Case C
b) Case CGSP
c) Case P, S
d) Case Else
Case 0 MsgBox.Show(Spades); Case 1 MsgBox.Show(Hearts); Case 2 MsgBox.Show(Clubs); Case 3 MsgBox.Show(Diamonds);Case 4 MsgBox.Show(other); Case 1,2 MsgBox.Show('a 1 or 2'); Case 0 To 4 MsgBox.Show('Only 0 and 3)
a) Spades
b) Clubs
c) Hearts
d) Diamonds
If Button1 is repeatedly clicked, how often will MagBox.Show display the string a 1 or 2? Case 0 MsgBox.Show(Spades); Case 1 MsgBx.Show(Hearts); Case 2 MsgBx.Show(Clubs); Case 3 MsgBx.Show(Diamonds);Case 4 MsgBx; Case 1,2 MsgBx.Show(1or2)
a) Never
b) About half the time
c) Impossible to predict
d) About 1 time in 7
Which case condition is correct?
a) Case 10
b) Case To 10
c) Case = 10
d) Case Is 10
If the Btn1 is repeatedly clicked, how often will MsgBx.Show display the string Only 0 and 3?Case 0 MsgBox.Show(Spades); Case 1 MsgBx.Show(Hearts); Case 2 MsgBx(Clubs); Case 3 MsgBx(Diamonds);Case 4 MsgBx; Case 0 To 4 MsgBx (Only 0 and 3)
a) 0% of the time
b) 25% of the time
c) 50% of the time
d) 75% of the time
Play Games with the Questions above at ReviewGameZone.com
To play games using the questions from above, visit ReviewGameZone.com and enter game ID number: 43990 in the upper right hand corner or click here.
To play games using the questions from above, visit ReviewGameZone.com and enter game ID number: 43990 in the upper right hand corner or click here.
TEACHERS / EDUCATORS
Log In | Sign Up / Register
Log In | Sign Up / Register