All pastes #2107716 Raw Edit

Anonymous

public text v1 · immutable
#2107716 ·published 2012-01-30 14:04 UTC
rendered paste body
 (CH 06) What is the value of strNewString after the following statement executes?

strNewString = LCase("LEttERs") 
 Selected Answer:    
LETTERS 
 


   Question 2  3 out of 3 points    
 (CH 06) What is the value of intStringPosition after the following statement executes?

intStringPosition = InStr(3, "string", "tri") 
 Selected Answer:    
0 
 


   Question 3  3 out of 3 points    
 (CH 06) Which statement correctly updates an accumulator? 
 Selected Answer:    
identifier = identifier + value 
 


   Question 4  3 out of 3 points    
 (CH 06) How many message boxes will be displayed as a result of the following code?

Dim intNum As Integer
For intNum = 10 To 1 Step -4
MsgBox intNum
Next intNum 
 Selected Answer:    
3 
 


   Question 5  3 out of 3 points    
 (CH 06) What is the value of strNewString after the following statement executes?

strNewString = StrConv("faLL", vbProperCase) 
 Selected Answer:    
Fall 
 


   Question 6  3 out of 3 points    
 (CH 06) What is the value of strNewString after the following statement executes?

strNewString = Left("string", 3) 
 Selected Answer:    
str 
 


   Question 7  3 out of 3 points    
 (CH 06) How many times is the loop executed in the following code?

intNumber = 0
Do
intNumber = intNumber + 1
Loop While intNumber <= 10 
 Selected Answer:    
11 
 


   Question 8  3 out of 3 points    
 (CH 06) What is the value of strNewString after the following statement executes?

strNewString = Mid("string", 2, 3) 
 Selected Answer:    
tri 
 


   Question 9  0 out of 3 points    
 (CH 06) What is the value of intNumChars after the following statement executes?

intNumChars = Len("string") 
 Selected Answer:    
0 
 


   Question 10  3 out of 3 points    
 (CH 06) What is the value of intNum after the following code has executed?

Dim intNum As Integer
intNum = 10
Do While intNum Mod 2 = 0 And intNum > 0
intNum = intNum - 2
Loop 
 Selected Answer:    
0 
 


   Question 11  0 out of 3 points    
 (CH 06) What is the value of strNewString after the following statement executes?

strNewString = String(5, "$") 
 Selected Answer:    
$ 
 


   Question 12  0 out of 3 points    
 (CH 06) What is the value of strNewString after the following statement executes?

strNewString = "Good" & Space(1) & "Bye" 
 Selected Answer:    
GoodBye 
 


   Question 13  0 out of 3 points    
 (CH 06) What is the value of strNewString after the following statements execute?

strNewString = "string"
Mid(strNewString, 3, 2) = "STRING" 
 Selected Answer:    
sSTRng 
 


   Question 14  0 out of 3 points    
 (CH 06) What does the lblTest label display after the following statement executes?

lblTest.Caption = Chr(Asc("A")) 
 Selected Answer:    
65 
 


   Question 15  3 out of 3 points    
 (CH 06) What is the value of intComp after the following statement executes?

intComp = StrComp("Fall", "fall", vbTextCompare) 
 Selected Answer:    
0 
 


   Question 16  3 out of 3 points    
 (CH 06) What is the value of strNewString after the following statement executes?

strNewString = Right("string", 3) 
 Selected Answer:    
ing 
 


   Question 17  3 out of 3 points    
 (CH 06) What does the lblCompare label display after the following statement executes?

lblCompare.Caption = "string" Like "?trin?" 
 Selected Answer:    
True 
 


   Question 18  3 out of 3 points    
 (CH 06) What is the value of strNewString after the following statement executes?

strNewString = UCase("LEttERs") 
 Selected Answer:    
LETTERS 
 


   Question 19  3 out of 3 points    
 (CH 06) What is the value of intCount after the following code has executed?

Dim intNum As Integer
Dim intCount As Integer
intCount = 0
For intNum = 2 To 6
If intNum > 4 Then
intCount = intNum + intCount
End If
Next intNum 
 Selected Answer:    
11 
 


   Question 20  3 out of 3 points    
 (CH 07) A procedure is 
 Selected Answer:    
a block of code that performs a specific task. 
 


   Question 21  3 out of 3 points    
 (CH 07) When an application contains more than one general procedure 
 Selected Answer:    
the procedures are executed in the order in which they are called. 
 


   Question 22  3 out of 3 points    
 (CH 07) Function procedures 
 Selected Answer:    
return a single value. 
 


   Question 23  3 out of 3 points    
 (CH 07) Postcondition is a statement of 
 Selected Answer:    
what must be true at the end of the execution of a procedure. 
 


   Question 24  3 out of 3 points    
 (CH 07) Sub Cat(ByVal intX As Integer, _
ByRef intY As Integer)
'Cat statements here
End Sub

Function Dog(ByVal strWord As String) As Integer
'Dog statements here
End Function

Which are reference parameters? 
 Selected Answer:    
intY only 
 


   Question 25  0 out of 3 points    
 (CH 07) Sub Cat(ByVal intX As Integer, _
ByRef intY As Integer)
'Cat statements here
End Sub

Function Dog(ByVal strWord As String) As Integer
'Dog statements here
End Function

Which statement is valid? 
 Selected Answer:    
intNumber = Cat(intX, intY) 
 


   Question 26  3 out of 3 points    
 (CH 07) Sub Cat(ByVal intX As Integer, _
ByRef intY As Integer)
'Cat statements here
End Sub

Function Dog(ByVal strWord As String) As Integer
'Dog statements here
End Function

Which are value parameters? 
 Selected Answer:    
intX and strWord only 
 


   Question 27  3 out of 3 points    
 (CH 07) Sub Cat(ByVal intX As Integer, _
ByRef intY As Integer)
'Cat statements here
End Sub

Function Dog(ByVal strWord As String) As Integer
'Dog statements here
End Function

Which statement is valid? 
 Selected Answer:    
Call Cat(5, intZ) 
 


   Question 28  3 out of 3 points    
 (CH 07) A static variable 
 Selected Answer:    
is available only to the procedure in which it is declared and has a lifetime the duration of the program. 
 


   Question 29  3 out of 3 points    
 (CH 07) The arguments in a Call statement must 
 Selected Answer:    
correspond in order to the parameters in the procedure being called. 
 


   Question 30  3 out of 3 points    
 (CH 07) Which statement correctly includes a label object parameter? 
 Selected Answer:    
Sub Show(ByRef lblLabel As Label) 
 


   Question 31  3 out of 3 points    
 (CH 07) Private Sub cmdButton_Click()
Dim intA As Integer, intB As Integer
intA = 3
intB = 4
Call Test(intA, intB)
lblAnswer1.Caption = intA & Space(1) & intB
End Sub

Sub Test(ByVal intA As Integer, _
ByRef intB As Integer)
intA = intB + 3
intB = 2 * intA
lblAnswer2.Caption = intA & Space(1) & intB
End Sub

What does the lblAnswer1 label display after cmdButton_Click executes? 
 Selected Answer:    
3 14 
 


   Question 32  3 out of 3 points    
 (CH 07) Private Sub cmdButton_Click()
Dim intA As Integer, intB As Integer
intA = 3
intB = 4
Call Test(intA, intB)
lblAnswer1.Caption = intA & Space(1) & intB
End Sub

Sub Test(ByVal intA As Integer, _
ByRef intB As Integer)
intA = intB + 3
intB = 2 * intA
lblAnswer2.Caption = intA & Space(1) & intB
End Sub

What does the lblAnswer2 label display after cmdButton_Click executes? 
 Selected Answer:    
7 14 
 


   Question 33  3 out of 3 points    
 (CH 07) The address of a variable 
 Selected Answer:    
is the location in memory where its value is stored. 
 


   Question 34  2 out of 2 points    
 (CH 07) Which statement is false? 
 Selected Answer:    
Static variables are declared using the keyword Private instead of Dim.