Review Game Zone
Flash Cards
(current)
Games
Teachers
Search
CP1 ~ 5.01/5.02 - Programming Errors Debugging
Test Description: ~ 5.01/5.02 - Programming Errors Debugging
Instructions: Answer all questions to get your test result.
1) John’s computer program stopped executing and displayed an error message. What type of error is this?
A
Run-time error
B
Dynamic error
C
Logic error
D
Syntax error
2) Programming errors are classified into one of three categories. Which one is not a standard category?
A
Logic
B
Run-time
C
Infinite
D
Syntax
3) Sara thought her program would calculate grade point averages, but the program listed the highest grade instead. What type of error is this?
A
Syntax error
B
Runtime error
C
Logic error
D
Dynamic error
4) Jamie keyed “Interger” instead of “Integer”. What type of error resulted?
A
Logic error
B
Runtime error
C
Syntax error
D
Dynamic error
5) Which type of error produces undesired or unexpected results?
A
Dynamic error
B
Logic error
C
Run-time error
D
Syntax error
6) Misspelling a keyword is an example of a:
A
logic error.
B
run-time error.
C
syntax error.
D
dynamic error.
7) 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
MessageBox will not display due to a runtime error.
B
10
C
50
D
Program will not compile due to a syntax error.
8) Which type of error halts the program when a statement cannot be executed?
A
Syntax error
B
Logic error
C
Dynamic error
D
Runtime error
9) 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
50
B
10
C
MessageBox will not display due to a runtime error.
D
Program will not compile due to a syntax error.
10) 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 try catch
B
Hover over the variables in the code to change the output
C
Add break-points and step through the code while watching the variable output
D
Debug the program
11) If defaults are set to show the Watch window, which data would be shown in the Watch window?
A
variable values only
B
variable: code statements
C
variable names only
D
variable: values
12) 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
Both False and True
B
False
C
Unknown
D
True
13) The reason to use a breakpoint is to:
A
examine variables and check logic.
B
set the tab order for controls.
C
verify code syntax.
D
evaluate the user interface.
14) 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
37
C
38
D
No MessageBox will be displayed.
15) What is a purpose of the Watch window?
A
To display the application interface
B
To switch to the Code window
C
To display online help
D
To examine values during the execution of a program
16) What is a purpose of the Watch window?
A
To display online help
B
To switch to the Code window
C
To display the application interface
D
To examine values during the execution of a program
17) When the code is completely written but will not execute, what is the appropriate action?
A
Give the program to another programmer for review and correction.
B
Code another program to correct the program just completed.
C
Perform programmer debugging and/or program debugging.
D
Rewrite all the lines of code.
18) 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
Sorry, not allowed
B
10
C
50
D
0
19) 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
Sorry, not allowed!
C
10
D
50
*select an answer for all questions
Check Results & Get Answers
Play Games with the Questions Above
Teachers: Create FREE classroom games with your questions
Click for more info!
©2007-2024
ReviewGameZone.com
|
About
|
Privacy
|
Contact
|
Terms
|
Site Map
WAIT! Find what you needed?
×
Still Looking for the Answers?
Have Another Question?
Play a Review Game with These Questions?
Want to Make Your Own Test Like This One?