CP1
CP2
CP3
CP4
CP5
100

If the user clicks on btn1 in the code below:

Private Sub btn1_Click(ByVal sender as System.Object, ByVal e As System.EventArgs) Handles btn1.Click

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: " & intX)
End If

End Sub

What is the button may become invisible.?

100

In the code below, what is the value stored in intX when the loop terminates

Dim gen As New Random()
Dim intGrade, intSum, intX As Integer

For intX = 0 To 6 Step 2
intGrade = gen.Next(60, 100)
intSum += intGrade
Next intX
MessageBox.Show(intSum)

What is 8?

100

In the code below, this Do Loop is a:

Private Sub btn1_click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn1.Click

Dim gen As New Random
Dim intTot As Integer
Dim intJ As Integer = 0

Do while intJ < 10
intTot += gen.Next(0, 101)
intJ += 2
Loop

MessageBox.Show(intTot)
End Sub

What is Pre Test Do Loop.?

100

Typically, accumulators and counters are initialized to which value

What is 0?

100

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?

What is Incorrect?

200

Which logical condition will determine if the AccountBalance is not less than CreditLimit

What is AccountBalance >= CreditLimit?

200

North Carolina allows a teenager to have a learner’s permit if he/she is 15 and has had driver’s education training. Consider the intAge and blnHasHadDrivEd variables. Which of the following If conditions would allow a learner’s permit

What is intAge = 15 And blnHasHadDrivEd = True?

200

Given the following code segment, what is the value of intNumberthat displays in the Label

Dim intCount, intNumber As Integer
intCount = 0
intNumber = 0
Do
intNumber = intNumber + 2
intCount = intCount + 1
Loop Until intCount > 3
lblAnswer.Text = intNumber

What is 8?

200

In the following code, how many times does the program count through the loop structure

For intCounter as integer = 1 To 9 Step -3

What is Infinite?

200

In the following code, how many times does the program count through the loop structure

For intCounter as integer = 1 To 5

What is 5?

300

Grades are based on the scale below. Using this scale, which condition(s) would be used to identify students who made a “B”?

A

93–100

B

85–92

C

78–84

D

70–77

F

0–69

What is dblScore > = 85 And dblScore < 93?

300

In the code below, if the line of code intJ += 2 were changed to intJ -= 2, what would be the result

What is The program would lock up in an infinite loop.?

300

Write a proper case condition?

What is Case 10?

300

In what type of loop are the conditions evaluated before the instructions are processed

What is pretest?

300

In the code below, if the user enters zero (0) into the TextBox1, the MessageBox will display:

Private Sub btn1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn1.Click

Dim intX As Integer
Dim dblD As Double = 50.0
Try
intX = Convert.ToInt32(TextBox1.Text)
dblD = dblD / intX
MessageBox.Show(dblD.ToString())
Catch ex As Exception
MessageBox.Show("Sorry, not allowed.")
End Try

End Sub

What is Sorry, not allowed?

400

The reason to use a breakpoint is to:

What is examine variables and check logic?

400

Grades are based on the scale below. Using this scale, which condition(s) would be used to identify students who made an “A” or a “B”

A

93–100

B

85–92

C

78–84

D

70–77

F

0–69

What is dblScore > = 85?

400

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()

What is gen.Next(1, 7)?

400

Which type of error halts the program when a statement cannot be executed

What is runtime?

400

Alice wrote a program that executed but did not produce the expected output. What is the best method for Alice to use to find the error

What is Add break-points and step through the code while watching the variable output?

500

Sara thought her program would calculate grade point averages, but the program listed the highest grade instead. What type of error is this

What is Logic?

500

When the MessageBox is displayed in the code below figure, the variable intJ will be:

Private Sub btn1_click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn1.Click

Dim gen As New Random
Dim intTot As Integer
Dim intJ As Integer = 0

Do while intJ < 10intTot += gen.Next(0, 101)
intJ += 2
Loop

MessageBox.Show(intTot)
End Sub

What is 10?

500

If defaults are set to show the Watch window, which data would be shown in the Watch window

What is variable values only?

500

Given the following statements:
Dim intNum As Integer = 0
Do
IntNum = intNum + 1
Loop While intNum < 5

 How many times will the body of the Do ... Loop execute

What is 5?

500

What is a purpose of the Watch window

What is To examine values during the execution of a program?

M
e
n
u