Professional Documents
Culture Documents
Web Application Midterm Exam
Web Application Midterm Exam
1
Answer saved
Marked out of 1.00
Flag question
Question text
Array values are keyed by ______ values (called indexed arrays) or using ______ values (called
associative arrays). Of course, these key methods can be combined as well.
Select one:
a.
Integer, String
b.
Even Number, String
c.
Float, String
d.
Positive number, negative number
Clear my choice
Question 2
Answer saved
Marked out of 1.00
Flag question
Question text
The PHP If Statement will only execute the code within it's curly braces if the if condition is
FALSE?
Select one:
True
False
Question 3
Answer saved
Marked out of 1.00
Flag question
Question text
There are three different kind of arrays:
Select one:
a.
Numeric array, Associative array, Dimensional array
b.
Numeric array, Associative array, Multidimensional array
c.
Const array, Associative array, Multidimensional array
d.
Numeric array, String array, Multidimensional array
Clear my choice
Question 4
Answer saved
Marked out of 1.00
Flag question
Question text
What will the following script output?
Select one:
a.
98
b.
78
c.
88
d.
68
Clear my choice
Question 5
Answer saved
Marked out of 1.00
Flag question
Question text
The PHP If Else Statement can execute the code within the if and else segments at the same
time?
Select one:
True
False
Question 6
Answer saved
Marked out of 1.00
Flag question
Question text
If the variable $x = 10; , what will $x equal if it is incremented, that is, if I write $x++; what
value will $x contain after it has been incremented?
Select one:
a.
11
b.
12
c.
10
d.
9
Clear my choice
Question 7
Answer saved
Marked out of 1.00
Flag question
Question text
What will be displayed in a browser when the following PHP code is executed:
Select one:
a.
Hello World
b.
Hello World Hello YouTube
c.
Nothing Will Be Displayed
d.
Hello YouTube
Clear my choice
Question 8
Answer saved
Marked out of 1.00
Flag question
Question text
What is the output of the following? echo strcmp('first', 'second'), ", "; echo strcmp('44',
'054'), ", "; echo strcmp('0x80', 'a'), ", "; echo strcmp('a', 'A');
Select one:
a.
-1, -1, 1, -1
b.
1, 0, -1, 1
c.
1, 1, -1, 1
d.
1, -1, -1, -1
Clear my choice
Question 9
Answer saved
Marked out of 1.00
Flag question
Question text
What will be the output of the following PHP code?
Select one:
a.
0.5
b.
1
c.
-0.5
d.
0
Clear my choice
Question 10
Answer saved
Marked out of 1.00
Flag question
Question text
What is the output of the following code?
Select one:
a.
1
b.
10
c.
Infinitive
d.
5
Clear my choice
Question 11
Answer saved
Marked out of 1.00
Flag question
Question text
What will be displayed in a browser when the following PHP code is executed
Select one:
a.
Nothing Will Be Displayed
b.
Hello World
Clear my choice
Question 12
Answer saved
Marked out of 1.00
Flag question
Question text
What is the function of the ucfirst and lcfirst functions?
Select one:
a.
To make the string's first word uppercase or lowercase, respectively.
b.
To make the string's first character uppercase or lowercase, respectively
Clear my choice
Question 13
Answer saved
Marked out of 1.00
Flag question
Question text
Which is identified as a special variable, which can store multiple values in one single
variable?
Select one:
a.
Variable
b.
Operator
c.
Array
d.
Functions
Clear my choice
Question 14
Answer saved
Marked out of 1.00
Flag question
Question text
What is the output of the following code?
Select one:
a.
7
b.
5
c.
8
d.
6
Clear my choice
Question 15
Answer saved
Marked out of 1.00
Flag question
Question text
What functions count elements in an array?
Select one:
a.
count_array
b.
counts
c.
array_count
d.
count
Clear my choice
Question 16
Answer saved
Marked out of 1.00
Flag question
Question text
Assume you would like to sort an array in ascending order by value while preserving key
associations. Which of the following PHP sorting functions would you use?
Select one:
a.
sort()
b.
asort()
c.
ksort()
d.
krsort()
Clear my choice
Question 17
Answer saved
Marked out of 1.00
Flag question
Question text
The logical operator ! stands for?
Select one:
a.
NOT
b.
AND
c.
OR
d.
MAYBE
Clear my choice
Question 18
Answer saved
Marked out of 1.00
Flag question
Question text
What will be displayed in a browser when the following PHP code is executed:
Select one:
a.
Hello World
b.
Nothing Will Be Displayed
Clear my choice
Question 19
Answer saved
Marked out of 1.00
Flag question
Question text
The following are examples of >, <, <=, >=, ==________ Operators
Select one:
a.
Logical
b.
Comparison
c.
Arithmetic
d.
Assignment
Clear my choice
Question 20
Answer saved
Marked out of 1.00
Flag question
Question text
The following condition will return TRUE or FALSE:!(4 >= 4 || 8 < 1)
Select one:
True
False
Question 21
Answer saved
Marked out of 1.00
Flag question
Question text
What is the output of the following? echo substr("abcdef", -2), ', '; echo substr("abcdef", 4), ',
'; echo substr("abcdef", -3, -1), ', '; echo substr("abcdef", 4, -2), ', '; echo substr("abcdef", 2,
-1)
Select one:
a.
Ef, ef, de, , cdef
b.
Abcd, de, de, , cde
c.
Ef, ef, de, e, cde
d.
Ef, ef, de, , cde
Clear my choice
Question 22
Answer saved
Marked out of 1.00
Flag question
Question text
What will be the output of the following PHP code?
Select one:
a.
I like Volvo, BMW and Toyota.
b.
I like Volvo, BMW and Toyota
c.
I like Volvo BMW and Toyota)
d.
I like. Volvo.,. BMW. and) Toyota) .
Clear my choice
Question 23
Answer saved
Marked out of 1.00
Flag question
Question text
Which one of the following is the right way of defining a function in PHP?
Select one:
a.
data type functionName(parameters) { function body }
b.
function { function body }
c.
functionName(parameters) { function body }
d.
functionfumctionName(parameters) { function body }
Clear my choice
Question 24
Answer saved
Marked out of 1.00
Flag question
Question text
The logical operator || stands for?
Select one:
a.
AND
b.
OR
c.
NOT
MAYBE
Clear my choice
Question 25
Answer saved
Marked out of 1.00
Flag question
Question text
Which statement will evaluate and include a file into the location where it is called.
Select one:
a.
include statement
b.
inc statement
c.
require_one statement
Clear my choice
Question 26
Answer saved
Marked out of 1.00
Flag question
Question text
Select one:
True
False
Question 27
Answer saved
Marked out of 1.00
Flag question
Question text
PHP's numerically indexed array begin with position __.
Select one:
a.
2
b.
1
c.
0
d.
-1
Clear my choice
Question 28
Answer saved
Marked out of 1.00
Flag question
Question text
What will be displayed in a browser when the following PHP code is executed:
Select one:
a.
Hello World
b.
Nothing Will Be Displayed
Clear my choice
Question 29
Answer saved
Marked out of 1.00
Flag question
Question text
What is the output of the following code?
Select one:
a.
1: 3, 2:21, 3:16
b.
1: 2, 2: 20, 3: 16
c.
1: 2, 2:21, 3:15
d.
1: 3, 2: 20, 3: 15
Clear my choice
Question 30
Answer saved
Marked out of 1.00
Flag question
Question text
The following are examples of =, +=, *=, /=, .= _______ Operators
Select one:
a.
Logical
b.
Comparison
c.
Assignment
d.
Arithmetic
Clear my choice
Question 31
Answer saved
Marked out of 1.00
Flag question
Question text
The following example $a -= $b; is the same as?
Select one:
a.
$a = $b – $a;
b.
$b = $b – $a;
c.
$b = $a – $b;
d.
$a = $a – $b;
Clear my choice
Question 32
Answer saved
Marked out of 1.00
Flag question
Question text
In which positions PHP's indexed array begin?
Select one:
a.
1
b.
0
c.
None
d.
Start
Clear my choice
Question 33
Answer saved
Marked out of 1.00
Flag question
Question text
What is the output of the following code snippet? $str = 'asdfghyo off on off';
$replace_pairs = array('a' => 'q', 's' => 'w', 'd' => 'e', 'f' => 'r', 'y' => 'z', 'o' => 'i', 'off' =>
'on', 'on' => 'off'); echo strtr($str, $replace_pairs);
Select one:
a.
Qwerghzo on off on
b.
Qwerghzi on off on
c.
Qwerghzi on onon
d.
Qwerghzi off offoff
Clear my choice
Question 34
Answer saved
Marked out of 1.00
Flag question
Question text
What will be displayed in a browser when the following PHP code is executed.
Select one:
a.
Welcome to the USA
Hello World
b.
Tom is in love with Rose
c.
Hello World
Welcome to the USA
d.
Welcome to the USA
Clear my choice
Question 35
Answer saved
Marked out of 1.00
Flag question
Question text
What is the output of the following code?
$a=1;
++$a;
$a*=$a;
echo $a- -;
Select one:
a.
6
b.
3
c.
4
d.
5
Clear my choice
Question 36
Answer saved
Marked out of 1.00
Flag question
Question text
What will be the output of the following PHP code?
Select one:
a.
Error
b.
13
c.
0
d.
16
Clear my choice
Question 37
Answer saved
Marked out of 1.00
Flag question
Question text
The following condition will return TRUE or FALSE: (4 >= 4 && 8 < 1)
Select one:
True
False
Question 38
Answer saved
Marked out of 1.00
Flag question
Question text
What is the output of the following code?
Select one:
a.
Syntax Error
b.
2
c.
1
d.
5
Clear my choice
Question 39
Answer saved
Marked out of 1.00
Flag question
Question text
What is the output of the following code?
Select one:
a.
1
b.
2
c.
0
d.
3
Clear my choice
Question 40
Answer saved
Marked out of 1.00
Flag question
Question text
What will be the output of the following PHP code?
Select one:
a.
Error
b.
49
c.
Sum
d.
1
Clear my choice
Question 41
Answer saved
Marked out of 1.00
Flag question
Question text
What will be the output of the following PHP code?
Select one:
a.
B
b.
D
c.
C
d.
A
Clear my choice
Question 42
Answer saved
Marked out of 1.00
Flag question
Question text
What will be displayed in a browser when the following PHP code is executed:
Select one:
a.
Nothing Will Be Displayed
b.
Hello World
c.
Hello YouTube
d.
Hello World Hello YouTube
Clear my choice
Question 43
Answer saved
Marked out of 1.00
Flag question
Question text
What will happen in this function call?
Select one:
a.
Call By Reference
b.
Type Hinting
c.
Default Argument Value
d.
Call By Value
Clear my choice
Question 44
Answer saved
Marked out of 1.00
Flag question
Question text
The logical operator && stands for?
Select one:
a.
MAYBE
b.
NOT
c.
OR
d.
AND
Clear my choice
Question 45
Answer saved
Marked out of 1.00
Flag question
Question text
What will be the output of the following PHP code?
Select one:
a.
Error
b.
$msg
c.
0
d.
AMA University
Clear my choice
Question 46
Answer saved
Marked out of 1.00
Flag question
Question text
What will be the output of the following PHP code?
Select one:
a.
Array ( [3] => blue [4] => blue [5] => blue [6] => blue )
Array ()
b.
Array ( [3] => blue [4] => blue)
Array ( [0] => red )
c.
Array ( [3] => blue [4] => blue [5] => blue [6] => blue )
Array ( [0] => red )
d.
Array ( [4] => blue [5] => blue [6] => blue)
Array ( [0] => red )
Clear my choice
Question 47
Answer saved
Marked out of 1.00
Flag question
Question text
The following are examples of =, !=, === ______ Operators
Select one:
a.
Arithmetic
b.
Escape Sequence
c.
Equality
d.
Bitwise
Clear my choice
Question 48
Answer saved
Marked out of 1.00
Flag question
Question text
Select one:
True
False
Question 49
Answer saved
Marked out of 1.00
Flag question
Question text
What will be the output of the following PHP code?
Select one:
a.
Array ( [0] => blue [1] => yellow [2] => red [3] => green )
b.
Array ( [0] => blue [1] => yellow )
c.
Array ( [0] => red [1] => green [2] => blue [3] => yellow )
d.
Array ( [0] => red [1] => green)
Clear my choice
Question 50
Answer saved
Marked out of 1.00
Flag question
Question text
The following condition will return TRUE or FALSE ( (4 >= 4 && 8 < 1) || (44 == 33 || 5 > 3) )
Select one:
True
False