Unit 4 and 5 Review Flashcards
Jamie keyed "Interger" instead of "Integer". What type of error resulted? A. run-time error B. dynamic error C. syntax error D. logic error
C. syntax error
Which is an example of a try…catch?
A. Try
intNum = Convert.ToInt32(txtNum. Text)
Catch ex As Exception
MessageBox.Show(“Enter a numeric value”)
End Try
B. Try
intNum = Convert.ToInt32(txtNum.Text)
Catch ex As Exception
MessageBox.Show(“Enter a numeric value”)
End
C. Try
intNum = Convert. ToInt32(txtNum.Text)
Catch Exception
MessageBox.Show(“Enter a numeric value”)
End Try
D. Try Exception
intNum = Convert.ToInt32(txtNum.Text)
Catch ex As Exception
MessageBox.Show(“Enter a numeric value”)
End
A. Try
intNum = Convert.ToInt32(txtNum. Text)
Catch ex As Exception
MessageBox.Show(“Enter a numeric value”)
End Try
A Boolean variable can contain:
A. True and false.
B. On and off.
C. Positive and negative.
D. Long and short.
A. True and false.
Susan declares a variable within an If statement. What is the scope of this variable? A. Local B. Procedural C. Global D. Non-Local
B. Procedural
Which data type is appropriate to store the number five (5)? A. Char B. Integer C. String D. Boolean
B. Integer
In what type of loop are the conditions evaluated before the instructions are processed? A. Pretest B. Infinite C. Finite D. Posttest
A. Pretest
Given the following code segment, what is the value of intNumber that displays in the Label? Dim intCount, intNumber As Integerint Count = 0 intNumber = 0 Do intNumber = intNumber + 2 intCount = intCount + 1 Loop Until intCount > 3 lblAnswer.Text = intNumber A. 6 B. 8 C. 4 D. 2 Response Feedback: 5.05
B. 8
Which button would be clicked before START in order to run an application using the menu bar? A. Build B. Project C. Debug D. View
C. Debug
Grades are based on the scale below. Using this scale, which condition(s) would be used to identify students who made a "D" or an "F"? A 93-100 B 85-92 C 78-84 D 70-77 F 0-69 A. dblScore >= 0 And dblScore = 80 C. dblScore 0 D. dblScore = 78
A. dblScore >= 0 And dblScore
Which data type is used to declare a variable that will store the value 0.113? A. String B. Double C. Char D. Boolean
B. Double
Variable names: A. Must begin with a letter B. Can contain spaces C. Must contain a digit D. Can be a keyword
A. Must begin with a letter
Which statement correctly assigns the value 5 to the variable intNum? A. intNum (5) B. 5 = intNum C. intNum = 5 D. intNum 5
C. intNum = 5
North Carolina allows a teenager to have a learner’s permit if they are 15 and have had driver’s education training. Consider the intAge and blnHasHadDrivEd variables. Which of the following If conditions would allow alearner’s permit?
A. intAge = 15 Or blnHasHadDrivEd = True
B. intAge > 14 Or blnHasHadDrivEd = True
C. intAge = 15 And blnHasHadDrivEd = True
D. intAge
C. intAge = 15 And blnHasHadDrivEd = True
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. run-time error D. syntax error
B. logic error
Alice wrote a program that executed but did not produce the expected output. What is the BEST method for Aliceto find the error?
A. Hover over the variables in the code to change the output.
B. Add try catch.
C. Debug the program.
D. Add break-points and step through the code while watching the variable output.
D. Add break-points and step through the code while watching the variable output.