Consider the following program code:
$y = 1;
$x = 2;
$z = 3;
do
{
print ($y );
} while ($y eq 2);
do
{
print ($x );
}
until ($x eq 2);
print ($z );
What is the result of executing this program code?
A. The code will output the following: 1 2 3
B. The code will output the following: 3
C. The code will output the following: 2 3
D. The code will output the following: 3 2 1
Which of the following is a valid subroutine name?
A. _funct7
B. get-pass
C. #sub1
D. @passwd
Consider the program code in the attached exhibit. What is the result of executing this program code?
A. The code will output the following: 3 + 5 + 2 + 3 = 13
B. The code will output the following: = 3 + 5 + 2 + 3 13
C. The code will output the following: = 13 3 + 5 + 2 + 3
D. The code will fail at line 3 because add is a reserved word.
Which of the following accurately describes the roles of the Database Interface Module (DBI) and the Database Driver Module (DBD)?
A. DBI transmits instructions to a database; DBD directs method calls to DBI.
B. DBD transmits instructions to a database; DBI directs method calls to DBD.
C. DBI makes available database-specific code; DBD transmits method calls to DBI.
D. DBD makes available database-specific code; DBI translates method calls to DBD.
Consider the following lines of code:
sub mySub { (
$arg, @args) = @_;
foreach $val (@args) {
$returnVal .= "$arg, $val\n";
}
$returnVal . "" . @args;
}
print andmySub(1, "a value", "another value", "a parameter", "another parameter"); What is the output of
these lines of code?
A. 1, a value 1, another value 1, a parameter 1, another parameter 4
B. 1, a value 1, another value 1, a parameter 1, another parameter a valueanother valuea parameteranother parameter
C. 1, a value, another value, a parameter, another parameter a value another value a parameter another parameter
D. 1, a value, another value, a parameter, another parameter 4
In Perl, packages are used for which task?
A. To label a program
B. To encrypt a program
C. To create new keywords
D. To define a namespace
Consider the following code:
%chars = ("a", "100", "b", "90", "c", "80");
Which one of the following choices will reverse the key/value pairing of the code?
A. reverse(%chars);
B. %chars = reverse(%chars);
C. reverse(%chars) = %chars;
D. invert(%chars);
Consider the following program code:
$x = 150;
$y = "250";
if (($x + 100) == $y) { print("1 "); }
if ("250" == $y) { print("2 "); }
if ("250" eq $y) { print("3 "); }
if ($x lt $y) { print("4 "); }
if ($x ge $y) { print("5 "); }
What is the result of executing this program code?
A. The code will output the following: 1 2 3 4
B. The code will output the following: 1 3 4
C. The code will output the following: 1 3 5
D. The code will output the following: 1 2 3 4 5
Which of the following describes the functionality of the DBI tables method?
A. The tables method returns a list of all system tables in a database.
B. The tables method returns a list of all user-defined tables in a database.
C. The tables method returns a list of all tables in a database.
D. The tables method returns a list of all related tables in a database.
Which of the following methods of calling a subroutine is not valid?
A. $namex = getname();
B. getname() = @array1;
C. $yearstogo = $Retireage Currentage();
D. $yearstogo = $Retireage Currentage($name);