Page 1 of 1

Given the following code stub:

Posted: Thu Mar 17, 2022 12:16 pm
by answerhappygod
Given the following code stub:
<cfset obj = {key='Apple',basic=['one','two']} />
Which returns the string "two"?
A. obj.key.basic
B. obj.basic[2]
C. obj.basic[1]
D. obj.basic.2


Answer : B



Given the following snippet:
<cfset x=2>
<cfoutput>
#--x# - #x++#
</cfoutput>
What is the output?
A. 1 - 1
B. 1 - 3
C. 1 - 2
D. -1


Answer : A



What is the value of the variable b when the following code block executes?
<cfscript>
a = 0;
b = 1;
a = (a)?b:a;
if (a) {
b = "apple";
}{
b = "pear";
</cfscript>
A. 1
B. 0
C. apple
D. pear


Answer : D



What is the value of the variable output when the following code executes?
<cfset output = "There is no answer" />
<cfif 1 eq true>
<cfset output = "The answer is one" />
<cfelseif 0 eq true>
<cfset output = "The answer is two" />
<cfelse>
<cfset output = "The answer is three" />
</cfif>
A. "The answer is one"
B. "The answer is two"
C. "The answer is three"
D. "There is no answer"


Answer : A



Given the follow code snippet:
<cfset startTime = CreateDateTime(2009,1,1,0,0,0)>
<cfset endTime = CreateDateTime(2009,1,3,12,0,0)>
<cfset i = 2>
<cfloop from="#startTime#" to="#endTime#" index="i" step="#CreateTimeSpan(1,0,0,0)#">
Hello World! <br />
</cfloop>
How many times does the loop iterate?
A. 2
B. 3
C. 4
D. 12


Answer : B