Given the following code stub:

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Given the following code stub:

Post 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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply