5.01
5.01
5.02
5.02
5.03
100
Which type of error halts the program when a statement cannot be executed? A.Dynamic error B.Logic error C.Runtime error D.Syntax error
What is Runtime error
100
Which type of error produces undesired or unexpected results? A.Dynamic error B.Logic error C.Run-time error D.Syntax error
What is Logic error
100
The reason to use a breakpoint is to: A.evaluate the user interface. B.examine variables and check logic. C.set the tab order for controls. D.verify code syntax.
What is examine variables and check logic.
100
When the code is completely written but will not execute, what is the appropriate action? A.Code another program to correct the program just completed. B.Give the program to another programmer for review and correction. C.Perform programmer debugging and/or program debugging. D.Rewrite all the lines of code.
What is Perform programmer debugging and/or program debugging.
100
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? A.intAge = 15 And blnHasHadDrivEd = True B.intAge < 16 And blnHasHadDrivEd = True C.intAge > 14 Or blnHasHadDrivEd = True D.intAge = 15 Or blnHasHadDrivEd = True
What is intAge = 15 And blnHasHadDrivEd = True
200
10.In the code below, determine the value of intJ displayed in the MessageBox. Dim intJ As Integer = 0 Dim intK As Integer = 0 Do while intJ < 10 Do while intK < 5 intK -= 1 Loop intJ += 1 Loop MessageBox.Show(intJ.ToString()) A.50 B.10 C.MessageBox will not display due to a runtime error. D.Program will not compile due to a syntax error
What is MessageBox will not display due to a runtime error.
200
Sara thought her program would calculate grade point averages, but the program listed the highest grade instead. What type of error is this? A.Dynamic error B.Logic error C.Runtime error D.Syntax error
What is Logic error
200
In the code below, if the user enters 5 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 A.0. B.10. C.50. D.Sorry, not allowed!
What is 10.
200
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? A.Add break-points and step through the code while watching the variable output B.Add try catch C.Debug the program D.Hover over the variables in the code to change the output
What is Add break-points and step through the code while watching the variable output
200
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) A.dblScore < 85 And dblScore > = 93 B.dblScore = 85 Or dblScore > 93 C.dblScore > 85 And dblScore > = 90 D.dblScore > = 85
What is dblScore > = 85
300
Jamie keyed “Interger” instead of “Integer”. What type of error resulted? A.Dynamic error B.Logic error C.Runtime error D.Syntax error
What is Syntax error
300
John’s computer program stopped executing and displayed an error message. What type of error is this? A.Dynamic error B.Logic error C.Run-time error D.Syntax error
What is Run-time error
300
If defaults are set to show the Watch window, which data would be shown in the Watch window? A.variable names only B.variable values only C.variable: code statements D.variable: values
What is variable values only
300
In the code below, if the user enters zero (0) into the TextBox1, the MessageBoxwill 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 A.0. B.10. C.50. D.Sorry, not allowed.
What is Sorry, not allowed.
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) A.dblScore = 85 Or dblScore < 93 B.dblScore > 85 And dblScore < = 93 C.dblScore > = 85 And dblScore < 93 D.dblScore < 85 And dblScore > = 93
What is dblScore > = 85 And dblScore < 93
400
Using the code below, determine the value of intJ displayed in the MessageBox. Dim intJ As Integer = 0 Dim intK As Integer = 0 Do While intJ < 10 Do While intK < 5 intK -= 1 Loop intJ += 1 Loop MessageBox.Show = intJ.ToString() A.10 B.50 C.MessageBox will not display due to a runtime error. D.Program will not compile due to a syntax error.
What is Program will not compile due to a syntax error.
400
Misspelling a keyword is an example of a: A.dynamic error. B.logic error. C.syntax error. D.run-time error.
What is syntax error
400
Evaluate the code below. If intX is 1 and intY is 0, what is displayed in the MessageBox? Private Sub btn1_Click(ByVal sender as System.Object, ByVal e As System.EventArgs) Handles btn1.Click Dim gen as New Random Dim intX, intY As Integer intX = gen.Next(2) intY = gen.Next(2) if intX = 0 or intY = 0 Then MessageBox.Show("False") ElseIf intX = 1 or intY = 1 Then MessageBox.Show("True") Else MessageBox.Show("Unknown") End If End Sub A.False B.True C.Unknown D.Both False and True
What is False
400
What is a purpose of the Watch window? A.To examine values during the execution of a program B.To display online help C.To display the application interface D.To switch to the Code window
What is To examine values during the execution of a program
400
Which logical condition will determine if the AccountBalance is not less than CreditLimit? A.AccountBalance <= CreditLimit B.AccountBalance <> CreditLimit C.AccountBalance = CreditLimit D.AccountBalance >= CreditLimit
What is AccountBalance >= CreditLimit
500
Programming errors are classified into one of three categories. Which one is not a standard category? A.Infinite B.Run-time C.Logic D.Syntax
What is Infinite
500
What kind of error occurs when you divide a number by 0? A. Runtime error B. Syntax error C. Logic error D. Infinite error
What is Runtime error
500
In the code below, if the user enters thirty-seven 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 Try intX = Convert.ToInt32(TextBox1.Text) Messagebox.Show(intX) Catch ex As Exception Messagebox.Show("Sorry, that is not a valid number, try again!") End Try End Sub A.No MessageBox will be displayed. B.Sorry, that is not a valid number, try again! C.37. D.38.
What is Sorry, that is not a valid number, try again!
500
Which one of these is not a tool in the debugging controls? A. Green arrow B. Step Into C. Step Over D. Step Through
What is Step Through
500
If 5 and 2 are entered in txtNumber1 and txtNumber2, respectively, what will the following code display? Dim intNumber1 As Integer= Convert.ToInt32(txtNumber1.Text) Dim intNumber2 As Integer= Convert.ToIn32(txtNumber2.Text) Dim intResult As Integer intResult= intNumber1 Mod intNumber2 lblAnswer.Text= intResult.ToString() A.1 B.2 C.3 D.5
What is 1