Review Game Zone
Flash Cards
(current)
Games
Teachers
Search
CP1 - 5.04 - Decision-Making Structures
Test Description: CP1 - 5.04 - Decision-Making Structures
Instructions: Answer all questions to get your test result.
1) 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 MessageBox will display 0.
B
the program will terminate.
C
the button may become invisible.
D
the MessageBox will display 1.
2) Which condition is correct?
A
Case 2, 5
B
Case 2 Or 5
C
Case 2 And 5
D
Case 2 - 5
3) 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(6)
B
gen.Next(1, 6)
C
gen.Next(0,7)
D
gen.Next(1, 7)
4) 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(9, 51)
B
gen.Next(10, 51)
C
gen.Next(9, 50)
D
gen.Next(10, 50)
5) 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
Correct
B
Incorrect
C
Nothing would be displayed
D
Correct on one line and Incorrect on the next line
6) 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(12)
B
gen.Next(1,12)
C
gen.Next(1,11)
D
gen.Next(1, 13)
7) 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, 6)
B
gen.Next(1,8)
C
gen.Next(1,7)
D
gen.Next(7)
8) 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
Sufficient experience on one line and inexperience on the other
C
Inexperienced
D
Nothing would be displayed
9) 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
10) 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
Diamonds
C
Clubs
D
Hearts
11) 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
About 1 time in 7
B
Impossible to predict
C
Never
D
About half the time
12) Which case condition is correct?
A
Case Is 10
B
Case 10
C
Case = 10
D
Case To 10
13) 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
75% of the time
B
25% of the time
C
50% of the time
D
0% of the time
*select an answer for all questions
Check Results & Get Answers
Play Games with the Questions Above
Teachers: Create FREE classroom games with your questions
Click for more info!
©2007-2024
ReviewGameZone.com
|
About
|
Privacy
|
Contact
|
Terms
|
Site Map
WAIT! Find what you needed?
×
Still Looking for the Answers?
Have Another Question?
Play a Review Game with These Questions?
Want to Make Your Own Test Like This One?