CP1
CP2
CP3
CP4
CP5
100

Hugh declares a variable in the event procedure code for a button. What scope is this variable

What is Local?
100

A variable named blnIsTrue is of what data type

What is boolean?

100

A variable named intGrade is of what data type

What is Integer?

100

Josie is writing a program and needs a variable that can be accessed from multiple event procedures. What scope of variable should she use

What is Global?

100

Give an example of Hungarian Notation

What is many different answers?

200

If a student needed to declare a variable to hold values representing a grade point average (GPA), which would be the best declaration given programming naming conventions

What is Dim dblGPA As Double?

200

The words “A Double data type should be always stored as a Double data type!” would be best stored in which data type

What is String?

200

What is an appropriate name for a constant according to Hungarian notation

What is decRATE?

200

In the statement, lblMessage.Text = "This is a label." What does lblMessage refer to

What is Label control?

200

What is the correct code to create a message box from the following code

lblcost.Text= "The cost of the product is: " & (deccost + dectax)

What is MessageBox.Show ("The cost of the product is: "& (deccost + dectax))?

300

The Loop structure is also referred to as a:

What is repetition/iteration?

300

In the code below, which suit will never be selected

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim gen As New Random
Dim intX As Integer

intX = gen.Next(4) + 1
Select Case intX
Case 0
MessageBox.Show("Spades")
Case 1
MessageBox.Show("Hearts")
Case 2
MessageBox.Show("Clubs")
Case 3
MessageBox.Show("Diamonds")
Case 4
MessageBox.Show("other")
Case 1, 2
MessageBox.Show("a 1 or 2")
Case 0 To 4
MessageBox.Show("Only 0 and 3")
End Select

End Sub

What is Spades?

300

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 3?

300

Jamie keyed “Interger” instead of “Integer”. What type of error resulted

What is syntax error?

300

What type of Do Loop is executed by 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 intTot As Integer
Dim intJ As Integer = 0

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

MessageBox.Show(intTot)
End Sub

What is Post Test Do Loop?

400

Which type of error produces undesired or unexpected results

What is Logic?

400

In the code below, how many iterations will this loop execute

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
intTot += gen.Next(0, 101)
intJ += 2
Loop while intJ < 10

MessageBox.Show(intTot)
End Sub

What is 5?

400

John’s computer program stopped executing and displayed an error message. What type of error is this

What is Run-time error?

400

In the code below, what is the value stored in intCount when the MessageBox is displayed

Dim gen As New Random
Dim intGrade, intSum, intCount As Integer
Dim dblAvg As Double

For intCount = 0 To 6
intGrade = gen.Next(60, 100)
intSum += intGrade
Next intCount
dblAvg = intSum / (intCount - 1)
MessageBox.Show(dblAvg.ToString("###.00"))

What is 7?

400

In the code below, the for loop has how many iterations

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 4?

500

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


What is gen.Next(1,8)?

500

Given the following statements:

Dim intNum As Integer
For intNum = 1 to 5
MessageBox.Show(intNum)
Next intNum

What is the value of intNumafter the last loop iteration


What is 6?

500

Examine the code below. What value is stored in intResult after the loop executes

Dim intCount As Integer
  Dim intResult As Integer

For intCount = 0 to 11 Step 2
  intResult= intResult + 1

Next

What is 6?

500

In the code below, when the MessageBox is displayed, 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
intTot += gen.Next(0, 101)
intJ += 2
Loop while intJ < 10

MessageBox.Show(intTot)
End Sub

What is 10?

500

In the code below, if the Button1 is repeatedly clicked, how often will MessageBox.Show display the string a 1 or 2

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim gen As New Random
Dim intX As Integer

intX = gen.Next(4) + 1
Select Case intX
Case 0
MessageBox.Show("Spades")
Case 1
MessageBox.Show("Hearts")
Case 2
MessageBox.Show("Clubs")
Case 3
MessageBox.Show("Diamonds")
Case 4
MessageBox.Show("other")
Case 1, 2
MessageBox.Show("a 1 or 2")
Case 0 To 4
MessageBox.Show("Only 0 and 3")
End Select

End Sub

What is Never?