Labour Day Sale - Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: mxmas70

Home > CIW > Master CIW Enterprise Developer > 1D0-437

1D0-437 CIW PERL FUNDAMENTALS Question and Answers

Question # 4

Consider the following program code:

$var = 10;

package Alpha;

$var = 20;

{

package Beta;

$var = 30;

}

package Gamma;

$var = 40;

{

print $var;

}

What is the output of this code?

A.

10

B.

20

C.

30

D.

40

Full Access
Question # 5

In the context of Perl user-defined subroutines, which statement is the most accurate?

A.

Variables declared using the my keyword are global in scope.

B.

Variables declared using the local keyword are only available to the subroutine from which they are declared.

C.

Variables declared using the my keyword are available to the calling subroutine.

D.

Variable declared using the local keyword are available to subsequently called subroutines.

Full Access
Question # 6

Consider the following program code:

@array = ("one", "two");

push(@array, "three");

shift(@array);

unshift(@array, "four");

pop(@array);

print($array[0]);

What is the output of this code?

A.

one

B.

two

C.

three

D.

four

Full Access
Question # 7

Assume $sth is a valid statement handle. Which of the following correctly outputs the data from the first three columns of a result set?

A.

while(@rcrds = $sth->fetch_array)

{

print($rcrds[0]\n);

print($rcrds[1]\n);

print($rcrds[2]\n); }

B.

while(@rcrds = $sth->fetch_array)

{

print($rcrds[1]\n);

print($rcrds[2]\n);

print($rcrds[3]\n);

}

C.

while(@rcrds = $sth->fetchrow_array)

{

print($rcrds[1]\n);

print($rcrds[2]\n);

print($rcrds[3]\n);

}

D.

while(@rcrds = $sth->fetchrow_array)

{

print($rcrds[0]\n);

print($rcrds[1]\n);

print($rcrds[2]\n);

}

Full Access
Question # 8

Consider the program code in the attached exhibit. What is the result of executing this program code?

A.

The code will output the following:

50

B.

The code will output the following:

0

C.

The code will output the following:

5

D.

The code will output the following:

multiply(5, 10)

Full Access
Question # 9

Consider the following lines of code:

@array1 = ("apples", "oranges", "pears", "plums");

foreach (@array1) {print "$_\n"};

What is the result of these lines of code?

A.

applesorangespearsplums

B.

apples oranges pears plums

C.

apples

D.

apples

oranges

pears

plums

Full Access
Question # 10

Consider the following program code:

1.$x = 100;

2.$y = 15;

3.$result = $x % $y;

4.

5.print $result;

What is the result of executing this program code?

A.

The code will fail at line 3 because % is a unary operator.

B.

The code will output the following:

10E+16

C.

The code will output the following:

10

D.

The code will fail at line 5 because $result is not enclosed by parentheses.

Full Access
Question # 11

Running your Perl scripts with a d switch will perform which task?

A.

Invoke the Perl debugger

B.

Send standard error to a file

C.

Disable breakpoints

D.

Display a stack trace

Full Access
Question # 12

Consider the following assignments:

$x = 9

$y = 7

$z = 5

Given these assignments, which one of the following expressions evaluates as true?

A.

($x - $y) != ($y - $z);

B.

($z * 2) <= $x;

C.

($y + $z + $x) = $y*3;

D.

($x 2) > $y;

Full Access
Question # 13

Which of the following choices demonstrates the correct syntax to pass a reference to a subroutine?

A.

\@array4;

B.

@array4($ref);

C.

getpass(\@array4);

D.

getpass{@array4};

Full Access
Question # 14

Assuming $a = 2, which of the following evaluates as false?

A.

"False"

B.

$a

C.

$a < 0

D.

1

Full Access
Question # 15

Consider the following lines of code:

sub mySub {

($arg, @args) = @_;

foreach $val (@args) {

$returnVal .= "$arg, $val\n";

}

$returnVal . "" . @args;

}

print &mySub(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

Full Access
Question # 16

Consider the following lines of code:

$_ = "This is a test";

s/^([^ ]*)\s*([^ ]*)/$2 $1/;

print;

What is the output of these lines of code?

A.

h Tis a test

B.

is This a test

C.

i Thiss a test

D.

his T is a test

Full Access
Question # 17

Consider the following program code:

@array = ("Y", "W", "X");

@array = sort(@array);

unshift(@array, "Z");

print(@array[0]);

What is the output of this code?

A.

W

B.

X

C.

Y

D.

Z

Full Access
Question # 18

Which statement will open the /etc/passwd file for reading only?

A.

open(PASSFILE "+>/etc/passwd");

B.

open(PASSFILE, "/etc/passwd");

C.

open(PASSFILE "+

D.

open(PASSFILE, ">/etc/passwd");

Full Access
Question # 19

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.

Full Access
Question # 20

Consider the following program code:

@arrayA = (10, 20, 30);

@arrayB = @arrayA;

$arrayB[1] = 40;

print $arrayA[1];

What is the output of this code?

A.

10

B.

20

C.

30

D.

40

Full Access
Question # 21

Which of the following correctly creates a SQL statement that will insert the values of the $name and $age variables into a database? The statement is assigned to the $sqlStmt variable. Assume a CHAR data type for $name and an INT data type for $age.

A.

$sqlStmt = q{INSERT INTO aTable (NAME, AGE) VALUES ($name, $age)};

B.

$sqlStmt = q{INSERT INTO aTable (NAME, AGE) VALUES ($name\, $age)};

C.

$sqlStmt = qq{INSERT INTO aTable (NAME, AGE) VALUES ($name, $age)};

D.

$sqlStmt = qq{INSERT INTO aTable (NAME, AGE) VALUES (\$name\, $age)};

Full Access
Question # 22

Which one of the following choices is a unary operator that can apply to only a single variable?

A.

++

B.

**

C.

/

D.

?

Full Access