ASP Object - Quiz Explanation
The correct answers are indicated below, along with the text that explains the correct answers.
1.
Which scripting engine(s) is/are included with ASP?
Please select the best answer.
A.
VBScript and JScript
B.
VBScript and Perl
C.
VBScript, Java
D.
VBScript and C++
The correct answer is A.
Although VBScript is the default scripting engine, JScript code can be inserted with the use of the
<SCRIPT RUNAT=SERVER LANGUAGE=JSCRIPT>
command. Perl can be used, but it requires additional software to work with the ASP interpreter.
2.
How can you determine the type of data currently in a variable or a result?
Please select the best answer.
A.
By looking at the style of the variable or result name.
B.
By multiplying by a known constant.
C.
By using a data-type testing function.
D.
By reinitializing the variable to its current value.
The correct answer is C.
A is incorrect because the variable name cannot control or restrict the type of the data within it. B is incorrect because the mathematical operation may change the data type but will not reveal the original type. D is incorrect because refreshing the variable will not tell you its type.
3.
What other operation can the
DateAdd
function perform in addition to adding two dates together?
Please select the best answer.
A.
It can convert a date for different time zones.
B.
It can return a date's day of the week.
C.
It can return a string of dates a specified number of days apart.
D.
It can increment or decrement a date in units of time.
The correct answer is D.
DateAdd
can increment or decrement a date by any of a number of units of time from a year to a second. A, B, and C could be accomplished with user-defined subprocedures and functions, but they are not a part of
DateAdd
.