CP1 ~ 5.01/5.02 - Programming Errors Debugging Question Preview (ID: 43722)
~ 5.01/5.02 - Programming Errors Debugging.
TEACHERS: click here for quick copy question ID numbers.
John’s computer program stopped executing and displayed an error message. What type of error is this?
a) Dynamic error
b) Run-time error
c) Logic error
d) Syntax error
Programming errors are classified into one of three categories. Which one is not a standard category?
a) Infinite
b) Logic
c) Run-time
d) Syntax
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
Jamie keyed “Interger” instead of “Integer”. What type of error resulted?
a) Dynamic error
b) Logic error
c) Syntax error
d) Runtime error
Which type of error produces undesired or unexpected results?
a) Dynamic error
b) Logic error
c) Syntax error
d) Run-time error
Misspelling a keyword is an example of a:
a) syntax error.
b) dynamic error.
c) logic error.
d) run-time error.
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.
Which type of error halts the program when a statement cannot be executed?
a) Runtime error
b) Dynamic error
c) Logic error
d) Syntax error
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.
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) Hover over the variables in the code to change the output
d) Debug the program
If defaults are set to show the Watch window, which data would be shown in the Watch window?
a) variable values only
b) variable names only
c) variable: code statements
d) variable: values
Evaluate the code below. If intX is 1 and intY is 0, what is displayed in theMessageBox? 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 in
a) False
b) True
c) Unknown
d) Both False and True
The reason to use a breakpoint is to:
a) examine variables and check logic.
b) evaluate the user interface.
c) verify code syntax.
d) set the tab order for controls.
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.ToI
a) Sorry, that is not a valid number, try again!
b) No MessageBox will be displayed.
c) 38
d) 37
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 switch to the Code window
d) To display the application interface
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 switch to the Code window
d) To display the application interface
When the code is completely written but will not execute, what is the appropriate action?
a) Perform programmer debugging and/or program debugging.
b) Code another program to correct the program just completed.
c) Give the program to another programmer for review and correction.
d) Rewrite all the lines of code.
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
a) 0
b) 10
c) 50
d) Sorry, not allowed
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 in
a) 0
b) 10
c) 50
d) Sorry, not allowed!
Play Games with the Questions above at ReviewGameZone.com
To play games using the questions from above, visit ReviewGameZone.com and enter game ID number: 43722 in the upper right hand corner or click here.
To play games using the questions from above, visit ReviewGameZone.com and enter game ID number: 43722 in the upper right hand corner or click here.
TEACHERS / EDUCATORS
Log In | Sign Up / Register
Log In | Sign Up / Register