Hugh declares a variable in the event procedure code for a button. What scope is this variable |
A variable named blnIsTrue is of what data type |
What is boolean?
A variable named intGrade is of what data type
What is Integer?
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?
Give an example of Hungarian Notation
What is many different answers?
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? |
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?
What is an appropriate name for a constant according to Hungarian notation |
What is decRATE?
In the statement, lblMessage.Text = "This is a label." What does lblMessage refer to |
What is Label control? |
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))?
The Loop structure is also referred to as a: |
What is repetition/iteration?
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?
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?
Jamie keyed “Interger” instead of “Integer”. What type of error resulted |
What is syntax error?
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? |
Which type of error produces undesired or unexpected results |
What is Logic?
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?
John’s computer program stopped executing and displayed an error message. What type of error is this |
What is Run-time error? |
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?
In the code below, the for loop has how many iterations Dim gen As New Random() |
What is 4?
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)?
Given the following statements: Dim intNum As Integer What is the value of intNumafter the last loop iteration |
What is 6?
Examine the code below. What value is stored in intResult after the loop executes
Dim intCount As Integer |
What is 6?
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?
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?