You are on page 1of 161

1. What does PHP stand for?

i) Personal Home Page


ii) Hypertext Preprocessor
iii) Pretext Hypertext Processor
iv) Preprocessor Home Page

a) Both i) and iii)


b) Both ii) and iv)
c) Only ii)
d) Both i) and ii)

Answer: d
Explanation: PHP previously stood for Personal Home Page now stands for Hypertext
Preprocessor.

2. PHP files have a default file extension of_______


a) .html
b) .xml
c) .php
d) .ph

Answer: c

3. Which of the following must be installed on your computer so as to run PHP script?

i) Adobe Dreamweaver
ii) XAMPP
iii) Apache and PHP
iv) IIS

a) i), ii), iii) and iv)


b) Only ii)
c) ii)and iii)
d) ii), iii) and iv)
Answer: d

4. How should we add a single line comment in our PHP code?

i) /?
ii) //
iii) #
iv) /* */
a) Only ii)
b) i), iii) and iv)
c) ii), iii) and iv)
d) Both ii) and iv)

Answer: c

5. Which of the following PHP statement/statements will store 111 in variable num?

i) int $num = 111;


ii) int mum = 111;
iii) $num = 111;
iv) 111 = $num;

a) Both i) and ii)


b) i), ii), iii) and iv)
c) Only iii)
d) Only i)

Answer: c

6. What will be the output of the following PHP code?

1. <?php
2. $num = 1;
3. $num1 = 2;
4. print $num . "+". $num1;
5. ?>
a) 3
b) 1+2
c) 1.+.2
d) Error

Answer: b

7. What will be the output of the following PHP code?

<?php
$num = "1";
$num1 = "2";
print $num+$num1;
?>
a) 3
b) 1+2
c) Error
d) 12

Answer: a
Explanation: The numbers inside the double quotes are considered as integers and not
string, therefore the value 3 is printed and not 1+2.

8. What will be the output of the following PHP code?

<?php
$total = "25 students";
$more = 10;
$total = $total + $more;
echo "$total";
?>
a) Error
b) 35 students
c) 35
d) 25 students

Answer: c
Explanation: The integer value at the beginning of the original $total string is used in the
calculation. However if it begins with anything but a numerical value, the value will be 0.

9. PHP is an example of ___________ scripting language.

A.Server-side
B.Client-side
C.Browser-side
D.In-side
Answer : Server-side [Option : A]

10. Which of the following is not true?


A.PHP can be used to develop web applications.
B.PHP makes a website dynamic

C.PHP applications can not be compile


D.PHP can not be embedded into html.

Answer : PHP can not be embedded into html. [Option : D]


11. Which of the following is correct about constants?
A - Unlike with variables, you do not need to have a constant with a $.
B - Only scalar data (boolean, integer, float and string) can be contained in constants.
C - Both of the above.
D - None of the above.

Answer : C

12. PHP configuration setting are maintain in

a. pws- php5cgi.reg

b.php.ini

c.httpd.conf

d. httpd-info.conf

Ans-b

13. in PHP programming literal is a

a. class

b. function

c.data value

d. none

Ans-c

14. PHP is _______ scripting language.


A. Server-side
B. Clint-side
C. Middle-side
D. Out-side

Ans- d

15. PHP scripts are executed on _________


A. ISP Computer
B. Client Computer
C. Server Computer
D. It depends on PHP scripts

Ans-C

16. Which of the following statements prints in PHP?


A. Out
B. Write
C. Echo
D. Display

Ans-C

17. In PHP, each statement must be end with ______


A. . (dot)
B. ; (semicolon)
C. / (slash)
D. : (colon)

Ans-B

18. In PHP Language variables name starts with _____


A. ! (Exclamation)
B. & (Ampersand)
C. * (Asterisk)
D. $ (Dollar)

Ans-D

19. In PHP Language variables are case sensitive


A. True
B. False
C. Depends on website
D. Depends on server

Ans-A

20. In PHP a variable needs to be declare before assign


A. True
B. False
C. Depends on website
D. Depends on server

Ans-B
21. Which of the following is not the scope of Variable in PHP?
A. Local
B. Global
C. Static
D. Extern

Ans-D

22. What does the hash (#) sign mean in PHP?


A. It indicates lines that are commented out.
B. It indicates variable declaration.
C. It indicates function declaration.
D. No uses in PHP.

Ans-A

23. How to define a variable in PHP?


A. $variable_name = value
B. $variable_name = value;
C. $variable_name == value;
D. $variable_name as value;

Ans-B

24. What will be the output of the following PHP code?

1. <?php
2. print "echo hello world";
3. ?>
a) echo hello world
b) hello world
c) nothing
d) error

Ans-a

25. What will be the output of the following PHP code?

1. <?php
2. $one = 1;
3. print($one);
4. print $one;
5. ?>
a) 01
b) 11
c) 10
d) Error

Ans-b

26. What will be the output of the following PHP code?

1. <?php
2. $one = "one";
3. $two = "two";
4. print($one$two);
5. ?>
a) onetwo
b) one
c) nothing
d) error

Ans-d

27. What will be the output of the following PHP code?

1. <?php
2. $one = "one";
3. $two = "two";
4. print($one,$two);
5. ?>
a) onetwo
b) one, two
c) one
d) error

Ans-d

28. What will be the output of the following PHP code?

1. <?php
2. $one = "one";
3. $two = "two";
4. print("$one$two");
5. ?>
a) onetwo
b) $one$two
c) one
d) error

Ans-a

29. What will be the output of the following PHP code?

1. <?php
2. print "Hello world!<br>";
3. print "I'm about to learn PHP!";
4. ?>
a) Hello world!
I’m about to learn PHP!
b) Hello world! I’m about to learn PHP!
c)Hello world!
I'm about to learn PHP!
d) Error

Ans-C
1. What does PHP stand for?
i) Personal Home Page
ii) Hypertext Preprocessor
iii) Pretext Hypertext Processor
iv) Preprocessor Home Page
a) Both i) and iii)
b) Both ii) and iv)
c) Only ii)
d) Both i) and ii)

Answer: d

2. PHP files have a default file extension of_______


a) .html
b) .xml
c) .php
d) .ph

Answer: c

3. What should be the correct syntax to write a PHP code?


a) < php >
b) < ? php ?>
c) <? ?>
d) <?php ?>

Answer: c

4. Which of the following is/are a PHP code editor?


i) Notepad
ii) Notepad++
iii) Adobe Dreamweaver
iv) PDT
a) Only iv)
b) i), ii), iii) and iv)
c) i), ii) and iii)
d) Only iii)

Answer: b

5. Which of the following must be installed on your computer so as to run PHP script?
i) Adobe Dreamweaver
ii) XAMPP
iii) Apache and PHP
iv) IIS
a) i), ii), iii) and iv)
b) Only ii)
c) ii) and iii)
d) ii), iii) and iv)

Answer: d
6. Which version of PHP introduced Try/catch Exception?
a) PHP 4
b) PHP 5
c) PHP 6
d) PHP 5 and later

Answer: d

7. How should we add a single line comment in our PHP code?


i) /?
ii) //
iii) #
iv) /* */
a) Only ii)
b) i), iii) and iv)
c) ii), iii) and iv)
d) Both ii) and iv)

Answer: c

8. Which of the following PHP statement/statements will store 111 in variable num?
i) int $num = 111;
ii) int mum = 111;
iii) $num = 111;
iv) 111 = $num;
a) Both i) and ii)
b) i), ii), iii) and iv)
c) Only iii)
d) Only i)

Answer: c

9. What will be the output of the following PHP code?


1. <?php
2. $num = 1;
3. $num1 = 2;
4. print $num . "+". $num1;
5. ?>
a) 3
b) 1+2
c) 1.+.2
d) Error

Answer: b

10. What will be the output of the following PHP code?


1. <?php
2. $num = "1";
3. $num1 = "2";
4. print $num+$num1;
5. ?>
a) 3
b) 1+2
c) Error
d) 12

Answer: a

1. Which is the right way of declaring a variable in PHP?


i) $3hello
ii) $_hello
iii) $this
iv) $This
a) Only ii)
b) Only iii)
c) ii), iii) and iv)
d) ii) and iv)

Answer: d

2. What will be the output of the following PHP code?


1. <?php
2. $foo = 'Bob';
3. $bar = &$foo;
4. $bar = "My name is $bar";
5. echo $bar;
6. echo $foo;
7. ?>
a) Error
b) My name is BobBob
c) My name is BobMy name is Bob
d) My name is Bob Bob

Answer: c

3. Which of the following PHP statements will output Hello World on the screen?
i) echo ("Hello World");
ii) print ("Hello World");
iii) printf ("Hello World");
iv) sprintf ("Hello World");
a) i) and ii)
b) i), ii) and iii)
c) i), ii), iii) and iv)
d) i), ii) and iv)

Answer: b

4. What will be the output of the following PHP code?


1. <?php
2. $color = "maroon";
3. $var = $color[2];
4. echo "$var";
5. ?>
a) a
b) Error
c) $var
d) r
Answer: d

5. What will be the output of the following PHP code?


1. <?php
2. $score = 1234;
3. $scoreboard = (array) $score;
4. echo $scoreboard[0];
5. ?>
a) 1
b) Error
c) 1234
d) 2

Answer: c

6. What will be the output of the following PHP code?


1. <?php
2. $total = "25 students";
3. $more = 10;
4. $total = $total + $more;
5. echo "$total";
6. ?>
a) Error
b) 35 students
c) 35
d) 25 students

Answer: c

7. Which of the below statements is equivalent to $add += $add?


a) $add = $add
b) $add = $add +$add
c) $add = $add + 1
d) $add = $add + $add + 1

Answer: b

8. Which statement will output $x on the screen?


a) echo “\$x”;
b) echo “$$x”;
c) echo “/$x”;
d) echo “$x;”;

Answer: a

9. What will be the output of the following PHP code?


1. <?php
2. function track() {
3. static $count = 0;
4. $count++;
5. echo $count;
6. }
7. track();
8. track();
9. track();
10. ?>
a) 123
b) 111
c) 000
d) 011

Answer: a

10. What will be the output of the following PHP code?


1. <?php
2. $a = "clue";
3. $a .= "get";
4. echo "$a";
5. ?>
a) get
b) true
c) false
d) clueget

Answer: d

1. What will be the output of the following PHP code?


1. <?php
2. $a = 5;
3. $b = 5;
4. echo ($a === $b);
5. ?>
a) 5 === 5
b) Error
c) 1
d) False

Answer: c

2. Which of the below symbols is a newline character?


a) \r
b) \n
c) /n
d) /r

Answer: b

3. What will be the output of the following PHP code?


1. <?php
2. $num = 10;
3. echo 'What is her age? \n She is $num years old';
4. ?>
a) What is her age? \n She is $num years old
b)What is her age?She is $num years old
c) What is her age? She is 10 years old
d)What is her age?She is 10 years old

Answer: a
4. Which of the conditional statements is/are supported by PHP?
i) if statements
ii) if-else statements
iii) if-elseif statements
iv) switch statements
a) Only i)
b) i), ii) and iv)
c) ii), iii) and iv)
d) i), ii), iii) and iv)

Answer: d

5. What will be the output of the following PHP code?


1. <?php
2. $team = "arsenal";
3. switch ($team) {
4. case "manu":
5. echo "I love man u";
6. case "arsenal":
7. echo "I love arsenal";
8. case "manc":
9. echo "I love manc"; }
10. ?>
a) I love arsenal
b) Error
c) I love arsenalI love manc
d) I love arsenalI love mancI love manu

Answer: c

6. Which of the looping statements is/are supported by PHP?


i) for loop
ii) while loop
iii) do-while loop
iv) foreach loop
a) i) and ii)
b) i), ii) and iii)
c) i), ii), iii) and iv)
d) Only iv)

Answer: c

7. What will be the output of the following PHP code?


1. <?php
2. $user = array("Ashley", "Bale", "Shrek", "Blank");
3. for ($x=0; $x < count($user); $x++) {
4. if ($user[$x] == "Shrek") continue;
5. printf ($user[$x]);
6. }
7. ?>
a) AshleyBale
b) AshleyBaleBlank
c) ShrekBlank
d) Shrek

Answer: b

8. If $a = 12 what will be returned when ($a == 12) ? 5 : 1 is executed?


a) 12
b) 1
c) Error
d) 5

Answer: d

9. What will be the value of $a and $b after the function call in the following PHP code?
1. <?php
2. function doSomething( &$arg ) {
3. $return = $arg;
4. $arg += 1;
5. return $return;
6. }
7. $a = 3;
8. $b = doSomething( $a );
9. ?>
a) a is 3 and b is 4
b) a is 4 and b is 3
c) Both are 3
d) Both are 4

Answer: b

10. Who is the father of PHP?


a) Rasmus Lerdorf
b) Willam Makepiece
c) Drek Kolkevi
d) List Barely

Answer: a

1. PHP’s numerically indexed array begin with position ___________


a) 1
b) 2
c) 0
d) -1

Answer: c

2. Which of the following are correct ways of creating an array?


i) state[0] = "karnataka";
ii) $state[] = array("karnataka");
iii) $state[0] = "karnataka";
iv) $state = array("karnataka");
a) iii) and iv)
b) ii) and iii)
c) Only i)
d) ii), iii) and iv)

Answer: a

3. What will be the output of the following PHP code?


1. <?php
2. $states = array("Karnataka" => array
3. ("population" => "11,35,000", "capital" => "Bangalore"),
4. "Tamil Nadu" => array( "population" => "17,90,000",
5. "capital" => "Chennai") );
6. echo $states["Karnataka"]["population"];
7. ?>
a) Karnataka 11,35,000
b) 11,35,000
c) population 11,35,000
d) Karnataka population

Answer: b

4. Which of the following PHP function will return true if a variable is an array or false if it
is not an array?
a) this_array()
b) is_array()
c) do_array()
d) in_array()

Answer: b

5. Which in-built function will add a value to the end of an array?


a) array_unshift()
b) into_array()
c) inend_array()
d) array_push()

Answer: d

6. What will be the output of the following PHP code?


1. <?php
2. $state = array ("Karnataka", "Goa", "Tamil Nadu",
3. "Andhra Pradesh");
4. echo (array_search ("Tamil Nadu", $state) );
5. ?>
a) True
b) 1
c) False
d) 2

Answer: d

7. What will be the output of the following PHP code?


1. <?php
2. $fruits = array ("apple", "orange", "banana");
3. echo (next($fruits));
4. echo (next($fruits));
5. ?>
a) orangebanana
b) appleorange
c) orangeorange
d) appleapple

Answer: a

8. Which of the following function is used to get the value of the previous element in an
array?
a) last()
b) before()
c) prev()
d) previous()

Answer: c

9. What will be the output of the following PHP code?


1. <?php
2. $fruits = array ("apple", "orange", array ("pear", "mango"),
3. "banana");
4. echo (count($fruits, 1));
5. ?>
a) 3
b) 4
c) 5
d) 6

Answer: d

10. Which function returns an array consisting of associative key/value pairs?


a) count()
b) array_count()
c) array_count_values()
d) count_values()

Answer: c

1. What will be the output of the following PHP code?


1. <?php
2. $cars = array("Volvo", "BMW", "Toyota");
3. echo "I like " . $cars[2] . ", " . $cars[1] . " and " . $cars[0] .
".";
4. ?>
a) I like Volvo, Toyota and BMW
b) I like Volvo, BMW and Toyota
c) I like BMW, Volvo and Toyota
d) I like Toyota, BMW and Volvo

Answer: d

2. What will be the output of the following PHP code?


1. <?php
2. $fname = array("Peter", "Ben", "Joe");
3. $age = array("35", "37", "43");
4. $c = array_combine($age, $fname);
5. print_r($c);
6. ?>
a) Array (Peter Ben Joe)
b) Array ([Peter] => 35 [Ben] => 37 [Joe] => 43)
c) Array (35 37 43)
d) Array ([35] => Peter [37] => Ben [43] => Joe)

Answer: d

3. What will be the output of the following PHP code?


1. <?php
2. $a=array("A","Cat","Dog","A","Dog");
3. $b=array("A","A","Cat","A","Tiger");
4. $c=array_combine($a,$b);
5. print_r(array_count_values($c));
6. ?>
a) Array ( [A] => 5 [Cat] => 2 [Dog] => 2 [Tiger] => 1 )
b) Array ( [A] => 2 [Cat] => 2 [Dog] => 1 [Tiger] => 1 )
c) Array ( [A] => 6 [Cat] => 1 [Dog] => 2 [Tiger] => 1 )
d) Array ( [A] => 2 [Tiger] => 1 )

Answer: d

4. What will be the output of the following PHP code?


1. <?php
2. $a1 = array("a" => "red", "b" => "green", "c" => "blue", "d" =>
"yellow");
3. $a2 = array("e" => "red", "f" => "green", "g" => "blue", "h" =>
"orange");
4. $a3 = array("i" => "orange");
5. $a4 = array_merge($a2, $a3);
6. $result = array_diff($a1, $a4);
7. print_r($result);
8. ?>
a) Array ( [d] => yellow )
b) Array ( [i] => orange )
c) Array ( [h] => orange )
d) Array ( [d] => yellow [h] => orange )

Answer: a

5. What will be the output of the following PHP code?


1. <?php
2. $a1 = array("red", "green");
3. $a2 = array("blue", "yellow");
4. $a3 = array_merge($a1, $a2);
5. $a4 = array("a", "b", "c", "d");
6. $a = array_combine($a4, $a3);
7. print_r($a);
8. ?>
a) Array ( [a] => blue [b] => yellow [c] => red [d] => green )
b) Array ( [0] => blue [1] => yellow [2] => red [3] => green )
c) Array ( [0] => red [1] => green [2] => blue [3] => yellow )
d) Array ( [a] => red [b] => green [c] => blue [d] => yellow )
Answer: d

6. What will be the output of the following PHP code?


1. <?php
2. $a = array("a" => "india", "b" => "brazil", "c" => "china");
3. echo array_shift($a);
4. echo "<br>";
5. array_pop($a);
6. print_r($a);
7. ?>
a)
india
Array ( [b] => Brazil )
b)
india
Array ( [a] => brazil )
c)
china
Array ( [a] => india )
d)
china
Array ( [a] => brazil )

Answer: a

7. What will be the output of the following PHP code?


1. <?php
2. $a1 = array_fill(1, 4, "hello");
3. $b1 = array_fill(5, 1, "php");
4. $a2 = array_merge($a1, $a2);
5. print_r($a2);
6. echo "<br>";
7. print_r($b1);
8. ?>
a)
Array ( [1] => hello [4] => hello [5] => php )
Array ( [5] => php )
b)
Array ( [1] => hello [2] => hello [3] => hello [4] => hello )
Array ( [5] => php )
c)
Array ( [1] => hello [2] => hello [3] => hello [4] => hello [5] => php )
Array ( [5] => php )
d)
Array ( [1] => hello [2] => hello [3] => hello [4] => hello )
Array ( [1] => php )

Answer: c

8. What will be the output of the following PHP code?


1. <?php
2. $names = array("Sam", "Bob", "Jack");
3. echo $names[0] . "is the brother of " . $names[1] . " and " .
$names[1] . ".";
4. ?>
a) Sam is the brother of Bob and Jack
b) Samis the brother of Bob and Bob
c) Sam is the brother of Jack and Bob
d) Error

Answer: b

9. What will be the output of the following PHP code?


1. <?php
2. $names = array("Sam", "Bob", "Jack");
3. echo $names[0]."is the brother of ".$names[1]." and
".$names[1].".".$brother;
4. ?>
a) Sam is the brother of Bob and Bob) $brother
b) Sam is the brother of Bob and Bob)
c) $brother
d) Error

Answer: d

10. What will be the output of the following PHP code?


1. <?php
2. $place = array("NYC", "LA", "Paris");
3. array_pop($place);
4. $place1 = array("Paris");
5. $place = array_merge($place, $place1);
6. print_r($place);
7. ?>
a) Array ( [0] => LA [1] => Paris [2] => Paris )
b) Array ( [0] => NYC [1] => LA [2] => Paris)
c) Array ( [0] => NYC [1] => LA [2] => Paris [3] => Paris )
d) Array ( [0] => LA [1] => Paris )

Answer: b

1. What will be the output of the following PHP code?


1. <?php
2. $age = array("Harry" => "21", "Ron" => "23","Malfoy" => "21");
3. array_pop($age);
4. print_r(array_change_key_case($age, CASE_UPPER));
5. ?>
a) Array ( [Harry] => 21 [Ron] => 23 [Malfoy] => 21 )
b) Array ( [HARRY] => 21 [RON] => 23 [MALFOY] => 21 )
c) Array ( [HARRY] => 21 [RON] => 23 )
d) Array ( [Harry] => 21 [Ron] => 23 )

Answer: c
2. What will be the output of the following PHP code?
1. <?php
2. $a1 = array("a" => "red", "b" => "green", "c" => "blue", "d" =>
"yellow");
3. $result = array_flip($a1);
4. print_r($result);
5. ?>
a) Array ( [red] => red [green] => green [blue] => blue [yellow] => yellow )
b) Array ( [a] => a [b] => b [c] => c [d] => d )
c) Array ( [red] => a [green] => b [blue] => c [yellow] => d )
d) Array ( [a] => red [b] => green [c] => blue [d] => yellow )

Answer: c

3. What will be the output of the following PHP code?


1. <?php
2. $a1 = array("a" => "red", "b" => "green", "c" => "blue", "d" =>
"yellow");
3. $a2 = array("e" => "red","f" => "green", "g" => "blue");
4. $result = array_intersect($a1, $a2);
5. print_r($result);
6. ?>
a) Array ( [a] => red [b] => green [c] => blue )
b) Array ( [a] => red [b] => green [c] => blue [d] => yellow )
c) Array ( [e] => red [f] => green [g] => blue )
d) Array ( [a] => red [b] => green [c] => blue [d] => yellow [e] => red [f] => green [g] =>
blue )

Answer: a

4. What will be the output of the following PHP code?


1. <?php
2. $a = array(12, 5, 2);
3. echo(array_product($a));
4. ?>
a) 024
b) 120
c) 010
d) 060

Answer: b

5. What will be the output of the following PHP code?


1. <?php
2. $a = array("a" => "Jaguar", "b" => "Land Rover",
3. "c" => "Audi", "d" => "Maseratti");
4. echo array_search("Audi", $a);
5. ?>
a) a
b) b
c) c
d) d

Answer: c
6. What will be the output of the following PHP code?
1. <?php
2. $city_west = array("NYC", "London");
3. $city_east = array("Mumbai", "Beijing");
4. print_r(array_replace($city_west, $city_east));
5. ?>
a) Array ( [1] => Mumbai [0] => Beijing )
b) Array ( [0] => NYC [1] => London )
c) Array ( [1] => NYC [0] => London )
d) Array ( [0] => Mumbai [1] => Beijing )

Answer: d

7. What will be the output of the following PHP code?


1. <?php
2. $people = array("Peter", "Susan", "Edmund", "Lucy");
3. echo pos($people);
4. ?>
a) Lucy
b) Peter
c) Susan
d) Edmund

Answer: b

8. What will be the output of the following PHP code?


1. <?php
2. $number = range(0, 5);
3. print_r ($number);
4. ?>
a) Array ( [0] => 0 [1] => 1 [2] => 2 [3] => 3 [4] => 4 [5] => 5 )
b) Array ( [0] => 0 [1] => 0 [2] => 0 [3] => 0 [4] => 0 [5] => 0 )
c) Array ( [0] => 5 [1] => 5 [2] => 5 [3] => 5 [4] => 5 [5] => 5 )
d) Array ( [0] => 0 [5] => 5 )

Answer: a

9. What will be the output of the following PHP code?


1. <?php
2. $array = array("red", "green");
3. array_push($array, "blue", "yellow");
4. print_r($array);
5. ?>
a) Array ( [0] => red [1] => green [2] => blue [3] => yellow )
b) Array ( [0] => blue [1] => yellow [2] => red [3] => green )
c) Array ( [0] => red [1] => green )
d) Array ( [0] => blue [1] => yellow )

Answer: a

10. What will be the output of the following PHP code?


1. <?php
2. $age = array("Harry" => "21", "Ron" => "19", "Malfoy" => "23");
3. ksort($age);
4. foreach($age as $x => $x_value)
5. {
6. echo "Key=" . $x . ", Value=" . $x_value;
7. echo "<br>";
8. }
9. ?>
a)
Key = Harry, Value = 21
Key = Ron, Value = 21
Key = Malfoy, Value = 23
b)
Key = Harry, Value = 21
Key = Ron, Value = 19
Key = Malfoy, Value = 23
c)
Key = Harry, Value = 21
Key = Malfoy, Value = 23
Key = Ron, Value = 19
d)
Key = Ron, Value = 19
Key = Harry, Value = 21
Key = Malfoy, Value = 23

Answer: c

1. What will be the output of the following PHP code?


1. <?php
2. $cars = array("Volvo", "BMW", "Toyota");
3. echo "I like " . $cars[0] . ", " . $cars[1] . " and " . $cars[2] .
".";
4. ?>
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)

Answer: b

2. What will be the output of the following PHP code?


1. <?php
2. $age = array("Peter"=>"35", "Ben"=>"37", "Joe"=>"43");
3. print_r(array_change_key_case($age, CASE_UPPER));
4. ?>
a) Array ( [Peter] => 35 [Ben] => 37 [Joe] => 43 )
b) Array ( [peter] => 35 [ben] => 37 [joe] => 43 )
c) Array ( [PETER] => 35 [BEN] => 37 [JOE] => 43 )
d) Array ( [PeTeR] => 35 [BeN] => 37 [Joe] => 43 )

Answer: c

3. What will be the output of the following PHP code?


1. <?php
2. $cars = array("Volvo", "BMW", "Toyota", "Honda", "Mercedes",
"Opel");
3. print_r(array_chunk($cars, 2));
4. ?>
a) Array ( [0] => Array ( [1] => Volvo [2] => BMW ) [1] => Array ( [1] => Toyota [2] =>
Honda ) [2] => Array ( [1] => Mercedes [2] => Opel ) )
b) Array ( [1] => Array ( [1] => Volvo [2] => BMW ) [2] => Array ( [1] => Toyota [2] =>
Honda ) [3] => Array ( [1] => Mercedes [2] => Opel ) )
c) Array ( [0] => Array ( [0] => Volvo [1] => Volvo ) [1] => Array ( [0] => BMW [1] =>
BMW ) [2] => Array ( [0] => Toyota [1] => Toyota ) )
d) Array ( [0] => Array ( [0] => Volvo [1] => BMW ) [1] => Array ( [0] => Toyota [1] =>
Honda ) [2] => Array ( [0] => Mercedes [1] => Opel ) )

Answer: d

4. What will be the output of the following PHP code?


1. <?php
2. $fname = array("Peter", "Ben", "Joe");
3. $age = array("35", "37", "43");
4. $c = array_combine($fname, $age);
5. print_r($c);
6. ?>
a) Array ( Peter Ben Joe )
b) Array ( [Peter] => 35 [Ben] => 37 [Joe] => 43 )
c) Array ( 35 37 43 )
d) Array ( “[Peter] => 35” “[Ben] => 37” “[Joe] => 43” )

Answer: b

5. What will be the output of the following PHP code?


1. <?php
2. $a = array("A", "Cat", "Dog", "A", "Dog");
3. print_r(array_count_values($a));
4. ?>
a) Array ( [A] => 2 [Cat] => 1 [Dog] => 2 )
b) Array ( [A] => 2 [Cat] => 2 [Dog] => 1 )
c) Array ( [A] => 1 [Cat] => 1 [Dog] => 2 )
d) Array ( [A] => 2 [Cat] => 1 [Dog] => 1)

Answer: a

6. What will be the output of the following PHP code?


1. <?php
2. $a1 = array("a"=>"red", "b"=>"green", "c"=>"blue", "d"=>"yellow");
3. $a2 = array("e"=>"red", "f"=>"green", "g"=>"blue");
4. $result = array_diff($a1, $a2);
5. print_r($result);
6. ?>
a) Array ( [d] => yellow )
b) Array ( [c] => blue )
c) Array ( [a] => red )
d) Array ( [e] => yellow )

Answer: a

7. What will be the output of the following PHP code?


1. <?php
2. $a1 = array_fill(3, 4, "blue");
3. $b1 = array_fill(0, 1, "red");
4. print_r($a1);
5. echo "<br>";
6. print_r($b1);
7. ?>
a)
Array ( [3] => blue [4] => blue)
Array ( [0] => red )
b)
Array ( [4] => blue [5] => blue [6] => blue)
Array ( [0] => red )
c)
Array ( [3] => blue [4] => blue [5] => blue [6] => blue )
Array ()
d)
Array ( [3] => blue [4] => blue [5] => blue [6] => blue )
Array ( [0] => red )

Answer: d

8. What will be the output of the following PHP code?


1. <?php
2. $a1 = array("red", "green");
3. $a2 = array("blue", "yellow");
4. print_r(array_merge($a1, $a2));
5. ?>
a) Array ( [0] => red [1] => green)
b) Array ( [0] => blue [1] => yellow [2] => red [3] => green )
c) Array ( [0] => red [1] => green [2] => blue [3] => yellow )
d) Array ( [0] => blue [1] => yellow )

Answer: c

9. What will be the output of the following PHP code?


1. <?php
2. $a = array("a"=>"red", "b"=>"green", "c"=>"blue");
3. echo array_shift($a);
4. print_r ($a);
5. ?>
a) green
b) red
c) redArray( [c] => green [c] => blue )
d) redArray( [b] => green [c] => blue )

Answer: d

10. What will be the output of the following PHP code?


1. <?php
2. $a = array("red", "green", "blue");
3. array_pop($a);
4. print_r($a);
5. ?>
a) Array ( [0] => red [1] => green )
b) Array ( [0] => green [1] => blue )
c) Array ( [0] => red [1] => blue )
d) Array ( [0] => blue [1] => blue )

Answer: a

1. What will be the output of the following PHP code?


1. <?php
2. $fruits = array ("mango", "apple", "pear", "peach");
3. $fruits = array_flip($fruits);
4. echo ($fruits[0]);
5. ?>
a) mango
b) error
c) peach
d) 0

Answer: b

2. Which of the functions is used to sort an array in descending order?


a) sort()
b) asort()
c) rsort()
d) dsort()

Answer: c

3. What will be the output of the following PHP code?


1. <?php
2. $fruits = array ("mango", "apple", "peach", "pear");
3. $fruits = asort ($fruits);
4. printr ($fruits);
5. ?>
a) Array ( [1] => apple [0] => mango [2] => peach [3] => pear )
b) Array ( [0] => apple [1] => mango [2] => peach [3] => pear )
c) Error
d) Array ( [1] => apple [0] => mango [3] => peach [2] => pear )

Answer: c

4. What will be the output of the following PHP code?


1. <?php
2. $arr = array ("picture1.JPG", "picture2.jpg",
3. "Picture10.jpg", "picture20.jpg");
4. sort($arr);
5. print_r($arr);
6. ?>
a) Array ( [0] => picture1.JPG [1] => Picture10.jpg [2] => picture2.jpg [3] => picture20.jpg
)
b) Array ( [0] => picture1.JPG [1] => picture2.jpg [2] => Picture10.jpg [3] => picture20.jpg
)
c) Array ( [0] => Picture10.jpg [1] => picture1.JPG [2] => picture2.jpg [3] => picture20.jpg
)
d) Array ( [0] => Picture10.jpg [1] => picture1.JPG [2] => picture20.jpg [3] => picture2.jpg
)
Answer: c

5. Which function should we use to sort the array in natural order?


a) dsort()
b) casesort()
c) natcasesort()
d) naturalsort()

Answer: c

6. What will be the output of the following PHP code?


1. <?php
2. $face = array ("A", "J", "Q", "K");
3. $number = array ("2","3","4", "5", "6", "7", "8", "9", "10");
4. $cards = array_merge ($face, $number);
5. print_r ($cards);
6. ?>
a) Array ( [0] => A [1] => J [2] => Q [3] => K [4] => 2 [5] => 3 [6] => 4 [7] => 5 [8] => 6 [9]
=> 7 [10] => 8 [11] => 9 [12] => 10 )
b) Array ( [0] => A [1] => 2 [2] => J [3] => 3 [4] => Q [5] => 4 [6] => K [7] => 5 [8] => 6 [9]
=> 7 [10] => 8 [11] => 9 [12] => 10 )
c) Error
d) Array ( [0] => 2 [1] => 3 [2] => 4 [3] => 5 [4] => 6 [5] => 7 [6] => 8 [7] => 9 [8] => 10 [9]
=> A [10] => J [11] => Q [12] => K )

Answer: a

7. What will be the output of the following PHP code?


1. <?php
2. $fruits = array ("apple", "mango", "peach", "pear",
3. "orange");
4. $subset = array_slice ($fruits, 2);
5. print_r ($subset);
6. ?>
a) Array ( [0] => peach )
b) Array ( [0] => apple [1] => mango [2] => peach )
c) Array ( [0] => apple [1] => mango )
d) Array ( [0] => peach [1] => pear [2] => orange )

Answer: d

8. What will be the output of the following PHP code?


1. <?php
2. $fruits = array ("apple", "mango", "peach", "pear",
3. "orange");
4. $subset = array_splice ($fruits, 2);
5. print_r ($fruits);
6. ?>
a) Error
b) Array ( [0] => apple [1] => mango [2] => peach )
c) Array ( [0] => apple [1] => mango )
d) Array ( [0] => pear [1] => orange )

Answer: c
9. What will be the output of the following PHP code?
1. <?php
2. $number = array ("4", "hello", 2);
3. echo (array_sum ($number));
4. ?>
a) 4hello2
b) 4
c) 2
d) 6

Answer: d

10. What will be the output of the following PHP code?


1. <?php
2. $array1 = array ("KA", "LA", "CA", "MA", "TA");
3. $array2 = array ("KA", "IA", "CA", "GA", "TA");
4. $inter = array_intersect ($array1, $array2);
5. print_r ($inter);
6. ?>
a) Array ( [0] => KA [1] => LA [2] => CA [3] => MA [4] => TA [5] => IA [6] => GA )
b) Array ( [0] => KA [2] => CA [4] => TA )
c) Array ( [1] => IA [3] => GA )
d) Array ( [1] => LA [3] => MA )

Answer: b

1. How to define a function in PHP?


a) function {function body}
b) data type functionName(parameters) {function body}
c) functionName(parameters) {function body}
d) function functionName(parameters) {function body}

Answer: d

2. Type Hinting was introduced in which version of PHP?


a) PHP 4
b) PHP 5
c) PHP 5.3
d) PHP 6

Answer: b

3. Which type of function call is used in line 8 in the following PHP code?
1. <?php
2. function calc($price, $tax)
3. {
4. $total = $price + $tax;
5. }
6. $pricetag = 15;
7. $taxtag = 3;
8. calc($pricetag, $taxtag);
9. ?>
a) Call By Value
b) Call By Reference
c) Default Argument Value
d) Type Hinting

Answer: a

4. What will be the output of the following PHP code?


1. <?php
2. function calc($price, $tax="")
3. {
4. $total = $price + ($price * $tax);
5. echo "$total";
6. }
7. calc(42);
8. ?>
a) Error
b) 0
c) 42
d) 84

Answer: c

5. Which of the following are valid function names?


i) function()
ii) €()
iii) .function()
iv) $function()
a) Only i)
b) Only ii)
c) i) and ii)
d) iii) and iv)

Answer: b

6. What will be the output of the following PHP code?


1. <?php
2. function a()
3. {
4. function b()
5. {
6. echo 'I am b';
7. }
8. echo 'I am a';
9. }
10. a();
11. a();
12. ?>
a) I am a
b) I am bI am a
c) Error
d) I am a Error

Answer: a

7. What will be the output of the following PHP code?


1. <?php
2. function a()
3. {
4. function b()
5. {
6. echo 'I am b';
7. }
8. echo 'I am a';
9. }
10. b();
11. a();
12. ?>
a) I am b
b) I am bI am a
c) Error
d) I am a Error

Answer: c

8. What will be the output of the following PHP code?


1. <?php
2. $op2 = "blabla";
3. function foo($op1)
4. {
5. echo $op1;
6. echo $op2;
7. }
8. foo("hello");
9. ?>
a) helloblabla
b) Error
c) hello
d) helloblablablabla

Answer: c

9. A function in PHP which starts with __ (double underscore) is known as __________


a) Magic Function
b) Inbuilt Function
c) Default Function
d) User Defined Function

Answer: a

10. What will be the output of the following PHP code?


1. <?php
2. function foo($msg)
3. {
4. echo "$msg";
5. }
6. $var1 = "foo";
7. $var1("will this work");
8. ?>
a) Error
b) $msg
c) 0
d) Will this work

Answer: d
1. Which of the following PHP functions accepts any number of parameters?
a) func_get_argv()
b) func_get_args()
c) get_argv()
d) get_argc()

Answer: b

2. Which one of the following PHP functions can be used to find files?
a) glob()
b) file()
c) fold()
d) get_file()

Answer: a

3. Which of the following PHP functions can be used to get the current memory usage?
a) get_usage()
b) get_peak_usage()
c) memory_get_usage()
d) memory_get_peak_usage()

Answer: c

4. Which of the following PHP functions can be used for generating unique ids?
a) uniqueid()
b) id()
c) md5()
d) mdid()

Answer: a

5. Which one of the following functions can be used to compress a string?


a) zip_compress()
b) zip()
c) compress()
d) gzcompress()

Answer: d

6. What will be the output of the following PHP code?


1. <?php
2. echo chr(52);
3. ?>
a) 1
b) 2
c) 3
d) 4

Answer: d

7. What will be the output of the following PHP code?


1. <?php
2. echo ord ("hi");
3. ?>
a) 106
b) 103
c) 104
d) 209

Answer: c

8. What will be the output of the following PHP code?


1. <?php
2. $str = "Hello World";
3. echo wordwrap($str,5,"<br>\n");
4. ?>
a) Hello World
b)
Hello
World
c)
Hell
o wo
rld
d) World

Answer: b

9. What will be the output of the following PHP code?


1. <?php
2. echo ucwords("i love my country");
3. ?>
a) I love my country
b) i love my Country
c) I love my Country
d) I Love My Country

Answer: d

10. What will be the output of the following PHP code?


1. <?php
2. echo lcfirst("welcome to India");
3. ?>
a) welcome to India
b) welcome to india
c) Welcome to India
d) Welcome to india

Answer: a

1. PHP has long supported two regular expression implementations known as _______
and _______
i) Perl
ii) PEAR
iii) Pearl
iv) POSIX
a) i) and ii)
b) ii) and iv)
c) i) and iv)
d) ii) and iii)

Answer: c

2. Which one of the following regular expression matches any string containing zero or
one p?
a) p+
b) p*
c) P?
d) p#

Answer: c

3. [:alpha:] can also be specified as ________


a) [A-Za-z0-9]
b) [A-za-z]
c) [A-z]
d) [a-z]

Answer: b

4. How many functions does PHP offer for searching strings using POSIX style regular
expression?
a) 7
b) 8
c) 9
d) 10

Answer: a

5. What will be the output of the following PHP code?


1. <?php
2. $username = "jasoN";
3. if (ereg("([^a-z])",$username))
4. echo "Username must be all lowercase!";
5. else
6. echo "Username is all lowercase!";
7. ?>
a) Error
b) Username must be all lowercase!
c) Username is all lowercase!
d) No Output is returned

Answer: b

6. POSIX implementation was deprecated in which version of PHP?


a) PHP 4
b) PHP 5
c) PHP 5.2
d) PHP 5.3

Answer: d

7. POSIX stands for ____________


a) Portable Operating System Interface for Unix
b) Portable Operating System Interface for Linux
c) Portative Operating System Interface for Unix
d) Portative Operating System Interface for Linux

Answer: a

8. What will be the output of the following PHP code?


1. <?php
2. $text = "this is\tsome text that\nwe might like to parse.";
3. print_r(split("[\n\t]",$text));
4. ?>
a) this is some text that we might like to parse.
b) Array ( [0] => some text that [1] => we might like to parse. )
c) Array ( [0] => this is [1] => some text that [2] => we might like to parse. )
d) [0] => this is [1] => some text that [2] => we might like to parse.

Answer: d

9. Which of the following would be a potential match for the Perl-based regular
expression /fo{2,4}/?
i) fol
ii) fool
iii) fooool
iv) fooooool
a) Only i)
b) ii) and iii)
c) i), iii) and iv)
d) i) and iv)

Answer: b

10. Which among the following is/are not a metacharacter?


i) \a
ii) \A
iii) \b
iv) \B
a) Only i)
b) i) and iii)
c) ii), iii) and iv)
d) ii) and iv)

Answer: a

1. How many functions does PHP offer for searching and modifying strings using Perl-
compatible regular expressions.
a) 7
b) 8
c) 9
d) 10

Answer: b

2. What will be the output of the following PHP code?


1. <?php
2. $foods = array("pasta", "steak", "fish", "potatoes");
3. $food = preg_grep("/^s/", $foods);
4. print_r($food);
5. ?>
a) Array ( [0] => pasta [1] => steak [2] => fish [3] => potatoes )
b) Array ( [3] => potatoes )
c) Array ( [1] => steak )
d) Array ( [0] => potatoes )

Answer: c

3. Say we have two compare two strings which of the following function/functions can
you use?
i) strcmp()
ii) strcasecmp()
iii) strspn()
iv) strcspn()
a) i) and ii)
b) iii) and iv)
c) only i)
d) i), ii), iii) and iv)

Answer: d

4. Which one of the following functions will convert a string to all uppercase?
a) strtoupper()
b) uppercase()
c) str_uppercase()
d) struppercase()

Answer: a

5. What will be the output of the following PHP code?


1. <?php
2. $title = "O'malley wins the heavyweight championship!";
3. echo ucwords($title);
4. ?>
a) O’Malley Wins The Heavyweight Championship!
b) O’malley Wins The Heavyweight Championship!
c) O’Malley wins the heavyweight championship!
d) o’malley wins the heavyweight championship!

Answer: a
]
6. What will be the output of the following PHP code?
1. <?php
2. echo str_pad("Salad", 5)." is good.";
3. ?>
a) SaladSaladSaladSaladSalad is good
b) is good SaladSaladSaladSaladSalad
c) is good Salad
d) Salad is good

Answer: d

7. Which one of the following functions can be used to concatenate array elements to
form a single delimited string?
a) explode()
b) implode()
c) concat()
d) concatenate()

Answer: b

8. Which one of the following functions finds the last occurrence of a string, returning its
numerical position?
a) strlastpos()
b) strpos()
c) strlast()
d) strrpos()

Answer: d

9. What will be the output of the following PHP code?


1. <?php
2. $author = "nachiketh@example.com";
3. $author = str_replace("a","@",$author);
4. echo "Contact the author of this article at $author.";
5. ?>
a) Contact the author of this article at nachiketh@ex@mple.com
b) Cont@ct the @uthor of this @rticle @t n@chiketh@ex@mple.com
c) Contact the author of this article at n@chiketh@ex@mple.com
d) Error

Answer: c

10. What will be the output of the following PHP code?


1. <?php
2. $url = "nachiketh@example.com";
3. echo ltrim(strstr($url, "@"),"@");
4. ?>
a) nachiketh@example.com
b) nachiketh
c) nachiketh@
d) example.com

Answer: d

1. The practice of separating the user from the true inner workings of an application
through well-known interfaces is known as _________
a) Polymorphism
b) Inheritance
c) Encapsulation
d) Abstraction

Answer: c

2. Which of the following term originates from the Greek language that means “having
multiple forms,” defines OOP’s ability to redefine, a class’s characteristics?
a) Abstraction
b) Polymorphism
c) Inheritance
d) Differential

Answer: b

3. The practice of creating objects based on predefined classes is often referred to as


______________
a) class creation
b) object creation
c) object instantiation
d) class instantiation

Answer: d

4. Which one of the following property scopes is not supported by PHP?


a) friendly
b) final
c) public
d) static

Answer: a

5. Which one of the following can be used to instantiate an object in PHP assuming
class name to be Foo?
a) $obj = new $foo;
b) $obj = new foo;
c) $obj = new foo ();
d) obj = new foo ();

Answer: c

6. Which one of the following is the right way to define a constant?


a) constant PI = “3.1415”;
b) const $PI = “3.1415”;
c) constant PI = ‘3.1415’;
d) const PI = ‘3.1415’;

Answer: d

7. Which one of the following is the right way to call a class constant, given that the class
is mathFunction?
a) echo PI;
b) echo mathFunction->PI;
c) echo mathFunction::PI;
d) echo mathFunction=PI;

Answer: c

8. Which one of the following is the right way to invoke a method?


a) $object->methodName();
b) object->methodName();
c) object::methodName();
d) $object::methodName();

Answer: a

9. Which of the following is/are the right way to declare a method?


i) function functionName() { function body }
ii) scope function functionName() { function body }
iii) method methodName() { method body }
iv) scope method methodName() { method body }
a) Only ii)
b) Only iv)
c) i) and ii)
d) iii) and iv)

Answer: c

10. Which of the following method scopes is/are not supported by PHP?
i) private
ii) friendly
iii) static
iv) abstract
a) Only ii)
b) Only iv)
c) ii) and iv)
d) Only i)

Answer: a

1. Which method scope prevents a method from being overridden by a subclass?


a) Abstract
b) Protected
c) Final
d) Static

Answer: c

2. Which of the following statements is/are true about Constructors in PHP?


i) PHP 4 introduced class constructors.
ii) Constructors can accept parameters.
iii) Constructors can call class methods or other functions.
iv) Class constructors can call on other constructors.
a) ii)
b) ii) and iii)
c) i), ii), iii) and iv)
d) ii), iii) and iv)

Answer: c

3. PHP recognizes constructors by the name _________


a) classname()
b) _construct()
c) function _construct()
d) function __construct()

Answer: d

4. Which version of PHP introduced the instanceof keyword?


a) PHP 4
b) PHP 5
c) PHP 5.3
d) PHP 6

Answer: b

5. Which one of the following functions is used to determine whether a class exists?
a) exist()
b) exist_class()
c) class_exist()
d) __exist()

Answer: c

6. Which one of the following functions is used to determine object type?


a) obj_type()
b) type()
c) is_a()
d) is_obj()

Answer: c

7. Which one of the following keyword is used to inherit our subclass into a superclass?
a) extends
b) implements
c) inherit
d) include

Answer: a

8. In the following PHP code, what is/are the properties?


1. <?php
2. class Example
3. {
4. public $name;
5. function Sample()
6. {
7. echo "This is an example";
8. }
9. }
10. ?>
a) echo “This is an example”;
b) public $name;
c) class Example
d) function sample()

Answer: b

9. Which keyword is used to refer to properties or methods within the class itself?
a) private
b) public
c) protected
d) $this

Answer: d

10. Which keyword allows class members (methods and properties) to be used without
needing to instantiate a new instance of the class?
a) protected
b) final
c) static
d) private

Answer: c

1. Which of the following advanced OOP features is/are not supported by PHP?
i) Method overloading
ii) Multiple Inheritance
iii) Namespaces
iv) Object Cloning
a) i)
b) ii)
c) i) and ii)
d) iii) and iv)

Answer: c

2. Which version of PHP introduced the advanced concepts of OOP?


a) PHP 4
b) PHP 5
c) PHP 5.3
d) PHP 6

Answer: b

3. Which one of the following is the right way to clone an object?


a) _clone(targetObject);
b) destinationObject = clone targetObject;
c) destinationObject = _clone(targetObject);
d) destinationObject = clone(targetObject);

Answer: b

4. The class from which the child class inherits is called ________
i) Child class
ii) Parent class
iii) Super class
iv) Base class
a) Only i)
b) ii), iii) and iv)
c) Only iii)
d) ii) and iv)

Answer: d

5. Which of the following is/are true for an abstract class?


i) Abstract classes in PHP are declared with the help of abstract keyword.
ii) A class is declare abstract by using the keyword implements.
iii) It is a class that really isn’t supposed to ever be instantiated but instead serves as a
base class.
iv) Attempting to instantiate an abstract class results in an error.
a) Only i)
b) Only iii)
c) ii) and iv)
d) ii), iii) and iv)

Answer: a

6. If one intends to create a model that will be assumed by a number of closely related
objects, which class must be used?
a) Normal class
b) Static class
c) Abstract class
d) Interface

Answer: c

7. If your object must inherit behavior from a number of sources you must use a/an
a) Interface
b) Object
c) Abstract class
d) Static class

Answer: a

8. Which method is used to tweak an object’s cloning behavior?


a) clone()
b) __clone()
c) _clone
d) object_clone()
Answer: b

9. Which feature allows us to call more than one method or function of the class in single
instruction?
a) Typecasting
b) Method Including
c) Method adding
d) Method chaining

Answer: d

10. Which magic method is used to implement overloading in PHP?


a) __call
b) __invoke
c) __wakeup
d) __unset

Answer: a

1. Which one of the following statements should be used to disable just the fopen(), and
file() functions?
a) disable_functions = fopen(), file()
b) disable_functions = fopen, file
c) functions_disable = fopen(), file()
d) functions_disable = fopen, file

Answer: b

2. Which one of the following statements should be used to disable the use of two
classes administrator and janitor?
a) disable_classes = “administrator, janitor”
b) disable_classes = class administrator, class janitor
c) disable_classes = class “administrator”, class “janitor”
d) disable_class = class “administrator”, class “janitor”

Answer: a

3. What is the default value of max_execution_time directive? This directive specifies


how many seconds a script can execute before being terminated.
a) 10
b) 20
c) 30
d) 40

Answer: c

4. The memory_limit is only applicable if ________ is enabled when you configure PHP.
a) –enable-limit
b) -enable-memory-limit
c) –enable-memory-limit
d) -memory-limit
Answer: c

5. Suppose all web material is located within the directory /home/www. To prevent users
from viewing and manipulating files such as /etc/password, which one of the following
statements should you use?
a) open_dir = “/home/www/”
b) open_dir = /home/www/
c) open_basedir = /home/www/
d) open_basedir = “/home/www/”

Answer: d

6. Which Apache directive outputs Apache’s server version, server name, port and
compile-in modules?
a) ServerSignature
b) ServerName
c) ServerDetails
d) ServerInfo

Answer: a

7. Which directive determines which degree of server details is provided if the


ServerSignature directive is enabled?
a) ServerAddons
b) ServerExtra
c) ServerTokens
d) ServerDetails

Answer: c

8. Which directive should we disable to obscure the fact that PHP is being used on our
server?
a) show_php
b) expose_php
c) print_php
d) info_php

Answer: b

9. Say I want to change the extension of a PHP file, which of the following statements
should I edit to change from .php to .html in the httpd.conf file?
a) AddType application/x-httpd-php .php
b) AddType application/x-httpd-php .asp
c) AddType application/x-httpd-asp .php
d) AddType application/x-httpd-asp .asp

Answer: a

10. The developers of PHP deprecated the safe mode feature as of which PHP version.
a) PHP 5.1.0
b) PHP 5.2.0
c) PHP 5.3.0
d) PHP 5.3.1

Answer: c

1. What will be the output of the following PHP code?


1. <?php
2. function calc($price, $tax="")
3. {
4. $total = $price + ($price * $tax);
5. echo "$total";
6. }
7. calc(42);
8. ?>
a) Error
b) 0
c) 42
d) 84

Answer: c

2. What will be the output of the following PHP code?


1. <?php
2. function a()
3. {
4. function b()
5. {
6. echo 'I am b';
7. }
8. echo 'I am a';
9. }
10. a();
11. a();
12. ?>
a) I am b
b) I am bI am a
c) Error
d) I am a Error

Answer: d

3. What will be the output of the following PHP code?


1. <?php
2. function a()
3. {
4. function b()
5. {
6. echo 'I am b';
7. }
8. echo 'I am a';
9. }
10. b();
11. a();
12. ?>
a) I am b
b) I am bI am a
c) Error
d) I am a Error

Answer: c

4. What will be the output of the following PHP code?


1. <?php
2. $op2 = "blabla";
3. function foo($op1)
4. {
5. echo $op1;
6. echo $op2;
7. }
8. foo("hello");
9. ?>
a) helloblabla
b) error
c) hello
d) helloblablablabla

Answer: c

5.What will be the output of the following PHP code?


1. <?php
2. function foo($msg)
3. {
4. echo "$msg";
5. }
6. $var1 = "foo";
7. $var1("will this work");
8. ?>
a) error
b) $msg
c) 0
d) will this work

Answer: d

6. What will be the output of the following PHP code?


1. <?php
2. echo "chr(52)";
3. ?>
a) 1
b) 2
c) 3
d) 4

Answer: d

7. What will be the output of the following PHP code?


1. <?php
2. echo ord ("hi");
3. ?>
a) 106
b) 103
c) 104
d) 209

Answer: c

8. What will be the output of the following PHP code?


1. <?php
2. echo(atan(0.50));
3. ?>
a) 0.11845976421345
b) 0.23568451142521
c) 0.46364760900081
d) 1

Answer: c

9. What will be the output of the following PHP code?


1. <?php
2. define("GREETING","Hello you! How are you today?");
3. echo constant("GREETING");
4. ?>
a) Hello you! How are you today?
b) GREETING
c) GREETING, Hello you! How are you today?
d) “GREETING”,”Hello you! How are you today?”

Answer: a

10. What will be the output of the following PHP code?


1. <?php
2. define("GREETING1","Hello you! How are you today?");
3. define("GREETING2","Hello you! How are you today?");
4. define("GREETING3","Hello you! How are you today?");
5. echo defined("GREETING");
6. ?>
a) 1
b) 0
c) 3
d) 4

Answer: b

1. What will be the output of the following PHP code?


1. <?php
2. function sum($num1, $num2)
3. {
4. $total = $num1 + $num2;
5. echo "chr($total)";
6. }
7. $var1 = "sum";
8. $var1(5, 44);
9. ?>
a) Error
b) 49
c) 1
d) Sum

Answer: c

2. What will be the output of the following PHP code?


1. <?php
2. function sum($num1, $num2)
3. {
4. $total = $num1 + $num2;
5. echo "cos($total)";
6. }
7. sum(5,-5);
8. ?>
a) 0
b) 1
c) 0.5
d) -0.5

Answer: b

3. What will be the output of the following PHP code?


1. <?php
2. function b()
3. {
4. echo "b is executed";
5. }
6. function a()
7. {
8. b();
9. echo "a is executed";
10. b();
11. }
12. a();
13. ?>
a) b is executedb is executedb is executed
b) b is executeda is executed
c) a is executed
d) b is executeda is executedb is executed

Answer: d

4. What will be the output of the following PHP code?


1. <?php
2. function sum($x, $y)
3. {
4. $z = $x + $y;
5. return $z;
6. }
7. echo "5 + 10 = " . sum(7,13) . "<br>";
8. echo "7 + 13 = " . sum(2,4) . "<br>";
9. echo "2 + 4 = " . sum(5,10);
10. ?>
a)
5 + 10 = 15
2+4=6
7 + 13 = 20
b)
7 + 13 = 20
5 + 10 = 15
2+4=6
c)
5 + 10 = 15
7 + 13 = 20
2+4=6
d)
5 + 10 = 20
7 + 13 = 6
2 + 4 = 15

Answer: d

5. What will be the output of the following PHP code?


1. <?php
2. function addFive($num)
3. {
4. $num += 5;
5. }
6. function addSix(&$num)
7. {
8. $num += 6;
9. }
10. $orignum = 10;
11. addFive( &$orignum );
12. echo "Original Value is $orignum<br />";
13. addSix( $orignum );
14. echo "Original Value is $orignum<br />";
15. ?>
a)
Original Value is 15
Original Value is 21
b)
Original Value is 15
Original Value is 21
c)
Original Value is 15
Original Value is 15
d) None Of The mentioned

Answer: b

6. What will be the output of the following PHP code?


1. <?php
2. function addFunction($num1, $num2)
3. {
4. $sum = $num1 + $num2;
5. return $sum;
6. }
7. $return_value = addFunction(10, 20);
8. echo "Returned value from the function : $return_value"
9. ?>
a) Returned value from the function : $return_value
b) Error
c) Returned value from the function : 30
d) Returned value from the function :

Answer: c

7. What will be the output of the following PHP code?


1. <?php
2. function sayHello()
3. {
4. echo "HelloWorld<br />";
5. }
6. $function_holder = "sayHello";
7. $function_holder();
8. ?>
a) No Output
b) Error
c) sayHello
d) HelloWorld

Answer: d

8. What will be the output of the following PHP code?


1. <?php
2. function one()
3. {
4. echo " this works";
5. function two()
6. {
7. echo "this too works";
8. }
9. }
10. one();
11. two();
12. ?>
a) error
b) this works
c) this worksthis too works
d) this works this too works

Answer: c

9. What will be the output of the following PHP code?


1. <?php
2. function do($myString)
3. {
4. echo strpos($myString, "donkey",0);
5. }
6. do("The donkey looks like a horse.");
7. ?>
a) 4
b) 5
c) 2
d) None of the mentioned
Answer: a

10. What will be the output of the following PHP code?


1. <?php
2. function one()
3. {
4. define("const","I am awesome!");
5. echo constant("const");
6. }
7. one();
8. ?>
a) I am awesome!!
b) const
c) const, I am awesome!!
d) “const”,”I am awesome!”

Answer: a

1. What will be the output of the following PHP code?


1. <?php
2. $title = "O'malley wins the heavyweight championship!";
3. echo ucwords($title);
4. ?>
a) O’Malley Wins The Heavyweight Championship!
b) O’malley Wins The Heavyweight Championship!
c) O’Malley wins the heavyweight championship!
d) o’malley wins the heavyweight championship!

Answer: d

2. What will be the output of the following PHP code?


1. <?php
2. echo str_pad("Salad", 5)." is good.";
3. ?>
a) SaladSaladSaladSaladSalad is good
b) is good SaladSaladSaladSaladSalad
c) is good Salad
d) Salad is good

Answer: d

3. What will be the output of the following PHP code?


1. <?php
2. $str = "Hello World"
3. echo wordwrap($str,5,"<br>\n");
4. ?>
a) Hello World
b)
Hello
World
c)
Hell
o wo
rld
d) World

Answer: b

4. What will be the output of the following PHP code?


1. <?php
2. echo ucwords("i love my country");
3. ?>
a) I love my country
b) i love my Country
c) I love my Country
d) I Love My Country

Answer: d

5. What will be the output of the following PHP code?


1. <?php
2. echo lcfirst("welcome to India");
3. ?>
a) welcome to India
b) welcome to india
c) Welcome to India
d) Welcome to india

Answer: a

6. What will be the output of the following PHP code?


1. <?php
2. echo hex2bin("48656c6c6f20576f726c6421");
3. ?>
a) Hello World!
b) welcome to india
c) This is PHP!
d) MCQ questons

Answer: a

7. What will be the output of the following PHP code?


1. <?php
2. $str = addslashes('What does "yolo" mean?');
3. echo($str);
4. ?>
a) What does /”yolo/” mean?
b) What does \\”yolo\\” mean?
c) What does \”yolo\” mean?
d) \What does \”yolo\” mean?\

Answer: c

8. What will be the output of the following PHP code?


1. <?php
2. $str = "Hello world. It's a beautiful day.";
3. print_r (explode(" ",$str));
4. ?>
a) Array ( [0] => Hello [0] => world. [0] => It’s [0] => a [0] => beautiful [0] => day. )
b) Array ( [0] => Hello [1] => world. [2] => It’s [3] => a [4] => beautiful [5] => day. )
c) Hello world. It’s a beautiful day
d) Array ( [1] => Hello [2] => world. [3] => It’s [4] => a [5] => beautiful [6] => day. )

Answer: b

9. What will be the output of the following PHP code?


1. <?php
2. echo strtr("Hilla Warld","ia","eo");
3. ?>
a) Hilla Warld
b) Hello World
c) ia
d) eo

Answer: b

10. What will be the output of the following PHP code?


1. <?php
2. echo stripos("I love php, I love php too!","PHP");
3. ?>
a) 3
b) 7
c) 8
d) 10

Answer: b

1. What will be the output of the following PHP code?


1. <?php
2. function A1($x)
3. {
4. switch($x)
5. {
6. case 1:
7. //this statement is the same as if($x == 1)
8. echo 'Case 1 was executed.';
9. break;
10. case 2:
11. //this statement is the same as if($x == 2)
12. echo 'Case 2 was executed.';
13. break;
14. case 3:
15. //this statement is the same as if($x == 3)
16. echo 'Case 3 was executed.';
17. break;
18. case 4:
19. //this statement is the same as if($x == 4)
20. echo 'Case 4 was executed.';
21. break;
22. default:
23. //this statement is the same as if $x does not
equal the other conditions
24. echo 'Default was executed.';
25. break;
26.
27. }
28. }
29. A1(9);
30. ?>
a) Case 1 was executed
b) Case 2 was executed
c) Default was executed
d) Case 4 was executed

Answer: d

2. What will be the output of the following PHP code?


1. <?php
2. function uppercase($string)
3. {
4. echo ucwords($string);
5. }
6. $wow = "uppercase";
7. $wow("Time to live king size");
8. ?>
a) TIME TO LIVE KING SIZE
b) Time to live king size
c) Uppercase
d) Time To Live King Size

Answer: d

3. What will be the output of the following PHP code?


1. <?php
2. function TV($string)
3. {
4. echo "my favourite TV show is ".$string;
5. function b()
6. {
7. echo " I am here to spoil this code";
8. }
9. }
10. b();
11. ?>
a) I am here to spoil this code
b) Error
c) My favourite TV show isI am here to spoil this code
d) None of the mentioned

Answer: b

4. What will be the output of the following PHP code?


1. <?php
2. function TV($string)
3. {
4. echo "my favourite TV show is ".$string;
5. function b()
6. {
7. echo " I am here to spoil this code";
8. }
9. }
10. function b()
11. {
12. echo " I am here to spoil this code";
13. }
14. b();
15. ?>
a) I am here to spoil this code
b) Error
c) my favourite TV show isI am here to spoil this code
d) None of the mentioned

Answer: a

5. What will be the output of the following PHP code?


1. <?php
2. function TV($string)
3. {
4. echo "my favourite TV show is ".$string;
5. function b()
6. {
7. echo " I am here to spoil this code";
8. }
9. }
10. function b()
11. {
12. echo " I am here to spoil this code";
13. }
14. b();
15. TV("Sherlock");
16. ?>
a) I am here to spoil this code
b) Error
c) My favourite TV show isI am here to spoil this code
d) None of the mentioned

Answer: b

6. What will be the output of the following PHP code?


1. <?php
2. function TV($string)
3. {
4. echo "my favourite TV show is ".$string;
5. function b()
6. {
7. echo " I am here to spoil this code";
8. }
9. }
10. a("Sherlock");
11. b();
12. ?>
a) I am here to spoil this code
b) Error
c) my favourite TV show is SherlockI am here to spoil this code
d) None of the mentioned

Answer: c

7. What will be the output of the following PHP code?


1. <?php
2. function calc($num1, $num2)
3. {
4. $total = $num1 * $num2;
5. }
6. $result = calc(42, 0);
7. echo $result;
8. ?>
a) Error
b) 0
c) 42
d) 84

Answer: a

8. What will be the output of the following PHP code?


1. <?php
2. function calc($num1, $num2)
3. {
4. $total = $num1 * $num2;
5. return $total;
6. }
7. $result = calc(42, 0);
8. echo $result;
9. ?>
a) Error
b) 0
c) 42
d) 84

Answer: b

9. What will be the output of the following PHP code?


1. <?php
2. $var = 10;
3. function one()
4. {
5. echo $var;
6. }
7. one();
8. ?>
a) Error
b) 10
c) No Output
d) None of the Mentioned

Answer: c

10. What will be the output of the following PHP code?


1. <?php
2. function mine($m)
3. {
4. if ($m < 0)
5. echo "less than 0";
6. if ($ >= 0)
7. echo "Not True";
8. }
9. mine(0);
10. ?>
a) Less Than 0
b) Not True
c) No Output
d) None of the Mentioned

Answer: b

1. What will be the output of the following PHP code?


1. <?php
2. $x = 75;
3. $y = 25;
4. function addition()
5. {
6. $GLOBALS['z'] = $GLOBALS['x'] + $GLOBALS['y'];
7. }
8. addition();
9. echo $z;
10. ?>
a) 100
b) error
c) 75
d) 25

Answer: a

2. What will be the output of the following PHP code?


1. <?php
2. function 2myfunc()
3. {
4. echo "Hello World";
5. }
6. 2myfunc();
7. ?>
a) Hello World
b) No Output
c) ERROR
d) None of the mentioned

Answer: c

3. What will be the output of the following PHP code?


1. <?php
2. function _func()
3. {
4. echo "Hello World";
5. }
6. _func();
7. ?>
a) Hello World
b) No Output
c) ERROR
d) None of the mentioned
Answer: a

4. What will be the output of the following PHP code?


1. <?php
2. function test($int)
3. {
4. if ($int == 1)
5. echo "This Works";
6. if ($int == 2)
7. echo "This Too Seems To Work";
8. }
9. test(1);
10. TEST(2);
11. ?>
a) This Works
b) This Too Seems To Work
c) This WorksThis Too Seems To Work
d) ERROR

Answer: c

5. What will be the output of the following PHP code?


1. <?php
2. function mine($num)
3. {
4. $num = 2 + $num;
5. echo $num;
6. }
7. mine(3);
8. ?>
a) 3
b) $num
c) 5
d) None of the mentioned

Answer: c

6. What will be the output of the following PHP code?


1. <?php
2. function mine($num)
3. {
4. $num = 2 + $num;
5. echo "$num";
6. }
7. mine(3);
8. ?>
a) 3
b) $num
c) 5
d) None of the mentioned

Answer: b

7. What will be the output of the following PHP code?


1. <?php
2. function one($string)
3. {
4. echo "I am ". $String;
5. }
6. one("Batman");
7. ?>
a)
I
am Batman
b) I am
c) Batman
d) ERROR

Answer: d

8. What will be the output of the following PHP code?


1. <?php
2. function string($title);
3. {
4. $title = ucwords($title);
5. echo lcfirst($title);
6. }
7. string("you went full retard");
8. ?>
a) You went full retard
b) You Went Full Retard
c) YOU WENT FULL RETARD
d) you Went Full Retard

Answer: d

9. What will be the output of the following PHP code?


1. <?php
2. function multi($num)
3. {
4. if ($num == 3)
5. echo "I Wonder";
6. if ($num == 7)
7. echo "Which One";
8. if ($num == 8)
9. echo "Is The";
10. if ($num == 19)
11. echo "Correct Answer";
12. }
13. $can = stripos("I love php, I love php too!","PHP");
14. multi($can);
15. ?>
a) I Wonder
b) Which One
c) Is The
d) Correct Answer

Answer: b

10. What will be the output of the following PHP code?


1. <?php
2. function movie($int)
3. {
4. $movies = array("Fight Club", "Kill Bill", "Pulp Fiction");
5. echo "You Do Not Talk About ". $movie[$integer];
6. }
7. movie(0);
8. ?>
a) You Do Not Talk About Fight Club
b) You Do Not Talk About Kill Bill
c) You Do Not Talk About Pulp Fiction
d) None of the mentioned

Answer: a
CA 6.2 PHP and MySql A
N
S
1) What does PHP stand for? D
i) Personal Home Page
ii) Hypertext Preprocessor
iii) Pretext Hypertext Processor
iv) Preprocessor Home Page

A)Both i) and iii)


B)Both ii) and iv)
C)Only ii)
D)Both i) and ii)
2) What is data in a MySQL database organized into? B
A)Objects
B)Tables
C)Networks
D)File systems
3) What should be the correct syntax to write a PHP code? C
A)< php >
B)< ? php ?>
C)<? ?>
D)<?php ?>
4) ___ function is used to get the value of the previous element in an array? C
A)last()
B)before()
C)prev()
D)previous()
5) How to define a function in PHP? D
A)function {function body}
B)data type functionName(parameters) {function body}
C)functionName(parameters) {function body}
D)function functionName(parameters) {function body}
6) A variable can have ________? C
A)long descriptive names
B)short names
C)Both A and B
D)None of the above
7) Which of the following PHP functions accepts any number of parameters? B
A)func_get_argv()
B)func_get_args()
C)get_argv()
D)get_argc()
8) A function name cannot start with a ____ C
A)alphabet
B)underscore
C)number
D)Both C and B
9) PHP’s numerically indexed array begin with position ___________ C
A)1
B)2
C)0
D)-1

1 P.T.O.
10) How many main parameter are used in for loop? B
A)2
B)3
C)4
D)1
11) PHP supports ____ types of looping techniques? C
A)2
B)3
C)4
D)5
12) How many value does Boolean data type hold? B
A)1
B)2
C)3
D)4
13) How many types of functions are available in php? D
A)5
B)4
C)3
D)2
14) In MySQL databases, the structure representing the organizational views of the entire databases is A
____________
A)Schema
B)View
C)Instance
D)Table
15) Why should we use functions? D
A)Reusability
B)Easier error detection
C)Easily maintained
D)All of the above
16) Which of the following operators is/are used in “Condition Evaluation”? D
A)AND
B)OR
C)NOT
D)All of the mentioned
17) What will be the output of the following PHP code? A

<?php
function a()
{
function b()
{
echo 'I am b';
}
echo 'I am a';
}
a();
a();
?>
A)I am a
B)I am bI am a
C)Error
D)I am a Error

2
18) Any variables declared in PHP must begin with a _____? D
A).
B)#
C)&
D)$
19) What represents an ‘attribute’ in a relational database? C
A)Table
B)Row
C)Column
D)Object
20) A variable name can only contain ____________? C
A)alphanumeric characters
B)underscores
C)Both A and B
D)None of the above
21) What represents a ‘tuple’ in a relational database? B
A)Table
B)Row
C)Column
D)Object
22) foreach loop is used to iterate over ____? D
A)number
B)object
C)function
D)array
23) Which is the MySQL instance responsible for data processing? B
A)MySQL client
B)MySQL server
C)SQL
D)Server daemon program
24) Which type of database management system is MySQL? C
A)Object-oriented
B)Hierarchical
C)Relational
D)Network
25) Which variable is used to collect form data sent with both the GET and POST methods? D
A) $BOTH
B) $_BOTH
C) $REQUEST
D) $_REQUEST
26) do-while loop is an _____ control loop ? A
A)exit
B)exist
C)easy
D)entry
27) How many ways can a session data be stored? B
A)3
B)4
C)5
D)6

3 P.T.O.
28) Can “SELECT” clause be used without the clause “FROM”? B
A)YES
B)NO
C)DEPENDS
D)None of the mentioned
29) Which of the following function returns the number of characters in a string variable? D
A.count($variable)
B.len($variable)
C.strcount($variable)
D.strlen($variable)
30) How is communication established with MySQL? A
A)SQL
B)Network calls
C)A programming language like C++
D)APIs
31) Which of the following method sends input to a script via a URL? B
A.Get
B.Post
C.Both
D.None
32) while loop is an _____ control loop ? D
A)exit
B)exist
C)easy
D)entry
33) Which of the following clause is evaluated in the last by database server? A
A)SELECT
B)WHERE
C)FROM
D)None of the mentioned
34) Which one of the following is the very first task executed by a session enabled page? C
A)Delete the previous session
B)Start a new session
C)Check whether a valid session exists
D)Handle the session
35) What will be the output of the following PHP code? D

<?php
echo str_pad("Salad", 5)." is good.";
?>

A)SaladSaladSaladSaladSalad is good
B)is good SaladSaladSaladSaladSalad
C)is good Salad
D)Salad is good

4
36) What will be the output of the following PHP code? B

<?php
$fname = array("Peter", "Ben", "Joe");
$age = array("35", "37", "43");
$c = array_combine($fname, $age);
print_r($c);
?>

A)Array ( Peter Ben Joe )


B)Array ( [Peter] => 35 [Ben] => 37 [Joe] => 43 )
C)Array ( 35 37 43 )
D)Array ( “[Peter] => 35” “[Ben] => 37” “[Joe] => 43” )
37) What will be the output of the following PHP code? A

<?php
for ($x = 0; $x <= 10; print ++$x)
{
print ++$x;
}
?>

A) 123456789101112
B) 12345678910
C) 1234567891011
D) infinite loop
38) What will be the output of the following PHP code? C

<?php
for ($i++; $i == 1; $i = 2)
print "In for loop ";
print "After loop\n";

?>

A) In for loop
B) After for loop
C) In for loopAfter for loop
D) Infinite loop
39) What will be the output of the following PHP code? D

<?php
function constant()
{
define("GREETING", "Welcome to Narnia");
echo greeting;
}
?>
A)Welcome to Narnia
B)greeting
C)GREETING
D)ERROR

5 P.T.O.
40) What will be the output of the following PHP code? B

<?php
for (1; $i == 1; $i = 2)
print "In for loop ";
print "After loop\n";
?>

A) In for loop
B) After for loop
C) In for loopAfter for loop
D) Infinite loop
41) Which of the following variables is not a predefined variable? B
A)$get
B)$ask
C)$request
D)$post
42) Which function is used to remove all HTML tags from a string passed to a form? B
A)remove_tags()
B)strip_tags()
C)tags_strip()
D)tags_remove()
43) Which one of the following PHP functions can be used to find files? A
A) glob()
B) file()
C) fold()
D) get_file()
44) What will be the output of the following PHP code? D

<?php
for ($count = 0; $count<3;$count++);
{
print "hi";break;print "hello";
}
?>

A) hihihi
B) hihellohihellohihello
C) hellohellohello
D) hi
45) What will be the output of the following PHP code? B

<?php
for(;;)
{
print "10";
}
?>

A) 10
B) infinite loop
C) no output
D) error

6
46) What will be the output of the following PHP code? B

<?php
for ($i = 0; -5 ; $i++)
{
print"i";
if ($i == 3)
break;
}
?>

A) 0 1 2 3 4
B) 0 1 2 3
C) 0 1 2 3 4 5
D) error
47) What will be the output of the following PHP code? C

<?php
for ($i = 0;$i = -1;$i = 1)
{
print $i;
if ($i != 1)
break;
}
?>
A) 0
B) infinite loop
C) -1
D) 1
48) What will be the output of the following PHP code? C
<?php
function calc($price, $tax="")
{
$total = $price + ($price * $tax);
echo "$total";
}
calc(42);
?>
A)Error
B)0
C)42
D)84
49) What will be the output of the following PHP code? C

<?php
echo ord ("hi");
?>

A) 106
B) 103
C) 104
D) 209

7 P.T.O.
50) What will be the output of the following PHP code? A

<?php
echo lcfirst("welcome to India");
?>

A) welcome to India
B) welcome to india
C) Welcome to India
D) Welcome to india
51) How many validation filters like FILTER_VALIDATE_EMAIL are currently available? C
A)5
B)6
C)7
D)8
52) Which of the following PHP functions can be used for generating unique ids? A
A) uniqueid()
B) id()
C) md5()
D) mdid()
53) Which version of PHP introduced the instanceof keyword? B
A) PHP 4
B) PHP 5
C) PHP 5.3
D) PHP 6
54) Which one of the following keyword is used to inherit our subclass into a superclass? A
A) extends
B) implements
C) inherit
D) include
55) Which keyword is used to refer to properties or methods within the class itself? D
A) private
B) public
C) protected
D) $this
56) If your object must inherit behavior from a number of sources you must use a/an A
A) Interface
B) Object
C) Abstract class
D) Static class
57) Which of the following is/are an external data? D
i) Cookies
ii) Input data from a form
iii) Server Variables
iv) Web services data

A) Only ii)
B) ii) and iii)
C) Only iii)
D) i), ii), iii) and iv)

8
58) _________this regular expression matches any string containing zero or one p? C
A) p+
B) p*
C) P?
D) p#
59) What will be the output of the following PHP code? C

<?php
function addFunction($num1, $num2)
{
$sum = $num1 + $num2;
return $sum;
}
$return_value = addFunction(10, 20);
echo "Returned value from the function : $return_value"
?>

A) Returned value from the function : $return_value


B) Error
C) Returned value from the function : 30
D) Returned value from the function :
60) What will be the output of the following PHP code? D

<?php
function sayHello()
{
echo "HelloWorld<br />";
}
$function_holder = "sayHello";
$function_holder();
?>

A) No Output
B) Error
C) sayHello
D) HelloWorld
61) What will be the output of the following PHP code? A

<?php
function do($myString)
{
echo strpos($myString, "donkey",0);
}
do("The donkey looks like a horse.");
?>

A) 4
B) 5
C) 2
D) None of the mentioned
62) To validate an email address, which flag is to be passed to the function filter_var()? A
A)FILTER_VALIDATE_EMAIL
B)FILTER_VALIDATE_MAIL
C)VALIDATE_EMAIL
D)VALIDATE_MAIL
9 P.T.O.
63) What will be the output of the following PHP code? A

<?php
for ($count = 1; $count != 20;$count++)
{
print $count;
$count++;
}
?>

A) Infinite
B) 123…….20
C) 1357…19
D) 13579…21
64) What will be the output of the following PHP code? B

<?php
function sum($num1, $num2)
{
$total = $num1 + $num2;
echo "cos($total)";
}
sum(5,-5);
?>

A) 0
B) 1
C) 0.5
D) -0.5
65) What will be the output of the following PHP code? A

<?php
for ($x = 1; $x < 10; $x++)
for ($y = 1; $y < 5; $y++)
print "Hello";
?>

A) Hello….36 times
B) Hello….45 times
C) Hello….50 times
D) Hello….40 times
66) What will be the output of the following PHP code? A

<?php
echo hex2bin("48656c6c6f20576f726c6421");
?>

A) Hello World!
B) welcome to india
C) This is PHP!
D) MCQ questons

10
67) What will be the output of the following PHP code? B

<?php
$cars = array("Volvo", "BMW", "Toyota");
echo "I like " . $cars[0] . ", " . $cars[1] . " and " . $cars[2] . ".";
?>

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)
68) What will be the output of the following PHP code? A

<?php
echo lcfirst("welcome to India");
?>

A) welcome to India
B) welcome to india
C) Welcome to India
D) Welcome to india
69) If the directive session.cookie_lifetime is set to 3600, the cookie will live until ____________ A
A)3600 sec
B)3600 min
C)3600 hrs
D)the browser is restarted
70) What will be the output of the following PHP code? B

<?php
echo strtr("Hilla Warld","ia","eo");
?>

A) Hilla Warld
B) Hello World
C) ia
D) eo
71) Which of the following is not true? D
A.PHP can be used to develop web applications.
B.PHP makes a website dynamic
C.PHP applications can not be compile
D.PHP can not be embedded into html

11 P.T.O.
72) What will be the output of the following PHP code? C

<?php
function mine($num)
{
$num = 2 + $num;
echo $num;
}
mine(3);
?>

A) 3
B) $num
C) 5
D) None of the mentioned
73) If session.use_cookie is set to 0, this results in use of _____________ C
A)Session
B)Cookie
C)URL rewriting
D)Nothing happens
74) What will be the output of the following PHP code? B

<?php
$x = 10;
$y = 20;
if ($x > $y && 1||1)
print "hi" ;
else
print "how are u";
?>

A)how are u
B)hi
C)error
D)no output
75) What will be the output of the following PHP code? A

<?php
function _func()
{
echo "Hello World";
}
_func();
?>

A) Hello World
B) No Output
C) ERROR
D) None of the mentioned
76) When you use the $_GET variable to collect data, the data is visible to ___________ C
A) none
B) only you
C) everyone
D) selected few

12
77) What will be the output of the following PHP code? D

<?php
function constant()
{
define("GREETING", "Welcome to Narnia");
echo greeting;
}
?>
A) Welcome to Narnia
B) greeting
C) GREETING
D) ERROR
78) ___ function will return true if a variable is an array or false if it is not an array? B
A)this_array()
B)is_array()
C)do_array()
D)in_array()
79) _____ determines whether the old session file will also be deleted when the session ID is B
regenerated?
A) delete_old_file
B) delete_old_session
C) delete_old_session_file
D) delete_session_file
80) What will be the output of the following PHP code? D

<?php
function time($string)
{
echo strtr("Towe Pa55", "ow5", $string);
}
time("ims");
?>
A) Time Pa55
B) Towe Pa55
C) Towe Pass
D) Time Pass
81) What is the meaning of “SELECT” clause in Mysql? A
A)Show me all Columns and rows
B)Show me all columns
C)Show me all rows
D)None of the mentioned
82) Which one of the following statements should you use to set the session username to Nachi? B
A) $SESSION[‘username’] = “Nachi”;
B) $_SESSION[‘username’] = “Nachi”;
C) session_start(“nachi”);
D) $SESSION_START[“username”] = “Nachi”;
83) PHP files have a default file extension of_______ C
A).html
B).xml
C).php
D).ph

13 P.T.O.
84) Which function is used to erase all session variables stored in the current session? D
A) session_destroy()
B) session_change()
C) session_remove()
D) session_unset()
85) Which version of PHP introduced Try/catch Exception? D
A)PHP 4
B)PHP 5
C)PHP 6
D)PHP 5 and later
86) Which one of the following function is used to start a session? B
A) start_session()
B) session_start()
C) session_begin()
D) begin_session()
87) A function in PHP which starts with __ (double underscore) is known as __________ A
A)Magic Function
B)Inbuilt Function
C)Default Function
D)User Defined Function
88) What is the default time(in seconds) for which session data is considered valid? C
A) 1800
B) 3600
C) 1440
D) 1540
89) Which one is not a data type in PHP? D
A)Resources
B)Objects
C)Null
D)Void
90) Which one of the following is the default PHP session name? A
A) PHPSESSID
B) PHPSESID
C) PHPSESSIONID
D) PHPIDSESS
91) _____ returns an array consisting of associative key/value pairs? C
A)count()
B)array_count()
C)array_count_values()
D)count_values()
92) How many ways can a session data be stored? B
A) 3
B) 4
C) 5
D) 6
93) ______ is not a built-in function in php ? C
A)print_r()
B)echo()
C)fclosed()
D)gettype()

14
94) Which one of the following is the very first task executed by a session enabled page? C
A) Delete the previous session
B) Start a new session
C) Check whether a valid session exists
D) Handle the session
95) Objects are defined as instances of user defined classes that can hold ____________? C
A)values
B)functions
C)both values and functions
D)None of the above
96) _____function finds the last occurrence of a string, returning its numerical position? D
A) strlastpos()
B) strpos()
C) strlast()
D) strrpos()
97) Which loop evaluates the condition expression as Boolean, if it is true, it executes the statements B
and when it is false it will terminate?
A)For loop
B)while loop
C)do-while loop
D)All of the above
98) A function name is not case-sensitive? A
A)True
B)False
C)Only user-defined function is case-sensitive
D)None of the above
99) [:alpha:] can also be specified as ________ B
A) [A-Za-z0-9]
B) [A-za-z]
C) [A-z]
D) [a-z]
100) What will be the output of the following PHP code? C

<?php
function email()
{
$email = ’user@yahoo.com’;
$new = strstr($email, ‘@');
echo $new;
}
email();
?>

A)user
B)user@yahoo.com
C)@yahoo.com
D)yahoo.com

**********

15 P.T.O.
Subject Code CA 6.3

Subject Software Testing

Paper Code 254603

QUE.
QUESTION ANS
NO.
In Inter task testing once errors in individual tasks and in system behavior have
been isolated, testing shifts to time related errors.
1 B
A) System related error B) time related error C) Behavioral error D) None of these

Select the people who identify the document and verify the correctness of the
2 software… B
A) Project manager B) SQA team C) Project team D) All of the mentioned
The waterfall model of software development is
A) A reasonable approach when requirements are well defined.
B) A good approach when a working program is required quickly.
3 A
C) The best approach to use for projects with large development teams
D) An old fashioned model that is rarely used any more

Which are benefits of static testing?

A) Early feedback of a quality


4 B) Less rework cost D
C) Increased developmental productivity
D) All of the above

………………… can be used to define various classes and input and associated
interactions.
A) equivalence partitioning and graph based testing
5 B) equivalence partitioning and boundary value analysis B
C) condition testing and equivalence partitioning
D) graph based testing and boundary value analysis

Graph-Based testing is the first step in…………………… in order to understand the


objects that are modeled in software and the relationships that connect these
6 objects. B
A) White-Box testing B) Black Box testing C) Comparison testing D) loop testing
Which of the following is type of stress testing?
a. Distributed Stress
b. Application stress
7 c. Transactional Stress D
d. All of the above

Select the option which is not an appraisal in SQA?


8 A) inter-process inspection B) maintenance C) testing D) quality planning D

………………………. testing is appropriate for object-oriented systems in that


individual objects may be tested using their own test drivers they are then
integrated and the object collection is tested.
9 B
A) Top-down B) Bottom-up C) Thread D) Stress

Software mistakes during coding are known as


10 A) errors B) failures C) bugs D) defects C

The spiral model of software development

A) Ends with delivery of the software product.


11 B) Is more Chaotic than the incremental model C
C) Includes project risks evaluation during each iteration
D) All of the above

Control flow graphs are mostly used in


12 A)Static analysis B) Compiler applications C) Both a & b D)None of the above C

Black-box tests are designed to validate………………..without regard to the internal


working of program.
C
A) Structural requirement B) Behavioral requirement
13
C) functional requirement D) None of these

Use cases are useful for which type of testing?

14 A) performance testing B) Business scenarios B


C) Static testing D) Unit testing
Which of these activities is not one of the activities recommended to be
performed by an independent SQA group?
a. Prepare SQA plan for the project
b. Review software engineering activities to verify process compliance
15 D
c. Report any evidence of noncompliance to senior management
d. Serve as the sole test team for any software produced.

Which are the example of Security Testing

A) A password should be in encrypted format


16 B) Application or System should not allow invalid users D
C) Check cookies and session time for application
D) All of the above

Testing OO class operations is made more difficult by


17 A) Encapsulation B) Inheritance C) Polymorphism D) Both b and c D

During which activity, tester will decide if extra test cases are required or
not?
A) Test implementation and execution
18 B) Test planning and control C
C) test analysis and design
D) Evaluating exit criteria

The incremental model of software development is

A. A reasonable approach when requirements are well defined.


B. A good approach when a working core product is required quickly.
19 B
C. The best approach to use for projects with large development teams
D. A revolutionary model that is not used for commercial products.

Who generally uses the Static Analysis Tools?


20 B
A)Tester B) Developer C)Customer D)All of the above

White-box testing sometimes called ………………… is a test case design method that
uses the control structure of the procedural design to derive test cases.
21 A) Glass-box testing B) Control structure testing A
C) Black-box testing D) Gray-box testing

22 Statement and branch coverage metrics are part of___________________? B


A) Analysis Model B) Testing C) Design Model D)Source Code

Select which option is not true about SQA…?


A) Audits and reviews to be performed by the team
B) Amount of technical work to be performed
23 C
C) Evaluations to be performed
D) Documents that are produced by the SQA team.

What are the different test strategies?


A) Dynamic and heuristic approaches
24 B)Consultative approaches D
C)Methodical approaches
D) All of the above

Effective testing will reduce _______ cost.


25 A) maintenance B) design C) coding D) documentation A

How do you create agile process to manage unpredictability?


A) Requirements gathering must be conducted very carefully.
B) Software increments must be delivered in short time periods
26 D
C) Software process must adapt to changes incrementally.
D) Both B and C

The analysis of program code is called……..What is Static Analysis?


A) The analysis of batch programs. B) Dynamic analysis.
27 C
C) Static analysis. D) Decision table.

Which of the following is experience based techniques?

A) Error guessing B) Equivalent partitioning


28 D
C) Exploratory testing D) Both a and c

Unit testing is used to identifying the …..…


29 C
A) errors B) bugs C) defects D) All of these
Which items is / are Configuration Items?
30 A) Source Code B) Test Cases C)Design Specification D)All of the above D

Test planning activities include


A) Evaluating the test estimate. B) Documenting Test Strategy.
31 C
C) Both a & b D) None of the above

Software tester focuses more on complex part of the software. Which of the
following testing principle implies this?
32 D
A) Testing shows presence of defects B) Pesticide paradox
C) Testing is context dependent D) Defect Clustering

……….cost falls in Prevention phase.


33 B
A) Failure B) Training C)Build D) Maintenance

Market does not affect the…………………………….


A) Software Quality B) Organizational Performance
34 C
C)Both A & B D) None of these

As per specified requirements Which testing is concerned as the behavior of the


whole product?
35 D
A) Acceptance testing B) Component testing C) Integration testing D) System testing

The main disadvantage of ……………………….. is that test output may be difficult to


observe.
36 A
A) Top-down testing B) Bottom-up testing C) Thread testing D) Stress testing

Objectives of Load testing


37 A) Response time B )Throughput C) Resource utilization D)All of the above D
Which of the following is/are the main objective of software testing?
i) Finding defects ii) Gaining confidence about the level of quality
iii) Preventing defects iv) Making absence of defects
A) i, ii and iii only
38 A
B) ii, iii and iv only
C) i, iii and iv only
D) All i, ii, iii and iv

Selection of particular life cycle model is based on,

39 A) Requirements B) Technical knowledge of development team D


C) Project types and associated risks D) All of the above

Which is/are the characteristics of equivalence partitioning?

A) In equivalence-partitioning technique we need to test only one condition


from each partition.
B) If one condition in a partition works, we assume all of the conditions in that
40 D
partition will work.
C) Equivalence partitions and equivalence classes both terms mean exactly the
same thing.
D) All of the above

Which is not a task of a Configuration Management?


A) Version control B) Reporting
41 D
C)Change management D) Quality control

What is the order in which test levels are performed?

A) Unit,Integration, System,Acceptance
42 B) Unit ,System, Integration,Acceptance D
C) Unit, Integration, Acceptance, System
D) It depends on nature of a project.

……………. enables the software engineer to derive sets of input conditions that will
fully exercise all functional requirements for a program.
43 A) White-box testing B) Control structure testing C
C) Black-box testing D) Gray-box testing

Which of the following are typical exit criteria for testing?


i) costs
ii) Schedules such as those based on time to market
44 D
iii) Test environment availability and readiness
iv) Estimates of defect density or reliability measures.
A) i, ii and iii only
B) ii, iii and iv only
C) i, iii and iv only
D) i, ii and iv only

Which testing is concerned with behavior of whole product as per specified


requirements?
45 C
A) Acceptance testing B) Component testing
C) System testing D) Integration testing

……………… is black-box testing method that divides the input domain of a program
into classes of data from which test cases can be derived.
46 C
A) Condition testing B) Graph-based testing
C) Equivalence partitioning D) loop testing

After programming which testing can be started


A) Black-box testing B) Unit testing
47 C
C) White-box testing D) Acceptance testing

Component testing is a
48 B
A) Black box testing B) White box testing C) Grey box testing D) Both a and b

……………… is a test design technique that complements equivalence partitioning.


A) Condition testing B) Graph-based testing
49 C
C) Boundary value analysis D) loop testing

When should company stop the testing of particular software?


A)After system testing done
B) It depends on the risks for the system being tested
50 B
C) After smoke testing done
D) None of the above

Which are the performance testing techniques


51 A)Load Testing B)Performance Testing C)Unit Testing D)Strategic Testing A
Error guessing can be have more fruitful results when

A) System has been deployed


52 B) When testing with inexperience tester D
C) As a first approach of testing
D) As a additional technique after applying more formal techniques

7n test cases are generated in Roust worst case of …………………….?


53 A)Worst case B) Boundary value Analysis B
C) Critical fault assumption D) None of these

……………..is to test the system behavior under normal workload conditions,


and it is just testing or simulating with the actual workload.
A) Load testing
54 B) stress testing A
c) Performance testing
D) None of the above

Black Box Test Design Technique is……………..


A) Decision Table Testing B) Use case Testing
55 A
C) Dynamic Testing D) Experience based Testing

What are the common performance problems faced by users?

56 A)Longer loading time B) Poor response time D


C) Poor Scalability D) All of the above

In Path Coverage test case is executed in such a way that………. .


A) every path is executed at least once B)every Branch is executed
57 A
C) every Statement is executed D)None of the above

Quality also can be looked at in terms of user satisfaction which


includes__________
58 A) A compliant product B) Good quality output D
C) Delivery within budget and schedule D) All of the mentioned

………………, also called behavioral testing which focuses on the functional


requirements of the software.
59 A) White-box testing B) Control structure testing C
C) Black-box testing D) Gray-box testing
Data flow testing is a control structure testing technique where the criteria
used to design test cases is that they
A) rely on basis path testing
60 C
B) exercise the logical conditions in a program module
C) select test paths based on the locations and uses of variables
D) focus on testing the validity of loop constructs

A particular text field accepts only alpha characters. Which of the following is
61 invalid Equivalence Partition? D
A) APPLE B) apple C) aPPle D)a2pple

A Online Bus Reservation System asks number of seats to be reserved by user


where user can reserve seats till its capacity will be full. If a tester wants to
test that particular field using Boundary Value, what do you think will be a
correct set of input values?
62 A)1, 2, capacity -1, capacity, capacity + 1 B
B) 0, 1, capacity, capacity + 1
C) 0, 1, 2, capacity + 1, a very large number
D) 0, 1, 10, 100, capacity, capacity+1

Black-box testing also called………………. which focuses on the functional


requirements of the software.
63 A) Glass Box testing B) Control structure testing C
C) Behavioral testing D) Gray-box testing

While using black-box testing techniques, we drive a set of test cases that
satisfy which of the following criteria.
i) test cases that reduce, by a count that is greater than one.
ii) test cases that tell us something about the presence or absence of classes of
64 A
errors.
iii) execute all loops at their boundaries and within their operational bounds.
A) i and ii B) ii and iii C) i and iii D) All i, ii and iii

which level of testing is used to identifing the defects …


65 A)Acceptance testing B) Integration testing C) Unit testing D) System Testing C

Which phase is considered as software architecture phase..


66 A) Design B) Implementation C) Development D) Requirement gathering A

Which of the following is not a method of dynamic testing…


A) inspection B) System testing,UAT
67 C
C) Inspection ,Walk through,Technical review D) Unit Testing
As per specified requirements Which testing is concerned as the behavior of
the whole product ?
68 A) Acceptance testing B) Component testing B
C) Integration testing D) System testing

Test Readiness is conducted in which phase…


69 A) project manager B)test manager C)quality assurance D)user or customer B

Waterfall model is not suitable for:


A)Small projects B) Complex projects
70 C
C)Accommodating changes D) Maintenance Projects

Spiral model originally proposed by


71 A)Boehm B) Winston C) Royce D) Dexter A

What is an equivalence partition (also known as an equivalence class)?


A) A set of test cases for testing classes of objects.
B) An input or output range of values such that only one value in the range
becomes a test case.
72 C) An input or output range of values such that each value in the range B
becomes a test case.
D) An input or output range of values such that every tenth value in the range
becomes a test case.

End result of Software Requirement Analysis is ________.

73 A) Functional and Behavioral B) Architectural and Structural A


C) Usability and Reliability D) Algorithmic and Data Structure

Which Testing is performed first?


A) Black box testing B) White box testing
74 D
C) Dynamic testing D) Static testing

Which of the following white-box testing technique is to set up test cases


which covers all statements and branch conditions?
75 A) Data-flow testing B) Boundary testing C
C) Control-flow testing D) Pair-wise testing

Why independent testing team is required?


A) There will be no dispute about quality of product.
B) Developer will concentrate on development activity.
76 C
C) Tester can test product more thoroughly.
D) Tester can join the project once development is finished.
__________ refers to the set of tasks that ensures the software correctly
implements a specific function.
77 A
A) Verification B) Validation C) Modularity D) None of these

A document that contains description of any event that has happened which
requires further investigation is called as a
78 D
A) Test summary report B) Defect report
C) Bug report D) Incident report

_______ is a Software Configuration Management concept that helps us to


control change.
79 A
A) Baseline B) Procedure C) Audit D) None of the above

What is the main aim of Software Configuration Management (SCM)?


A) Identify change B) Control change
80 D
C) Ensure that change is being properly implemented D) All of the above

What types of errors are not done by Black-Box Testing and can be uncovered
81 by White-Box Testing? A
A)Logic errors B) Performance errors C) Behavioral errors D) None of these

When different combination of input requires different combination of


actions, Which of the following technique is used in such situation?
82 C
A)Boundary Value Analysis B) Equivalence Partition
C)Decision Table D) Decision Coverage

What is true regarding Static Analysis Tools?


A)It compares actual and expected result.
83 B)It can detect memory leaks. C
C)It gives quality information about code without executing it.
D)It tell about percentage of a code coverage.

Which are the benefits of Static Testing?


84 D
A) Early feedback of a quality. B) Less rework cost.
C) Increased developmental productivity. D) All of the above

Which is treated as Regular Expression?


85 A
A) [ ] B) | C) $ D) { }
Which is not a part of Decision Table?
86 B
A)Rule portion B) Driver portion
C)Condition portion D)Action portion
What is an Equivalence Partition?
A) A set of test cases for testing classes of objects.
B) An input or output range of values such as have only one value in the range
becomes a test case.
87 B
C) An input or output range of values such that each value in the range
becomes a test case
D) An input or output range of values such that every tenth value in the range
becomes a test case.
Which of the followings is/are characteristic/s of Stress Testing?
A) It is a type of Non Functional Testing
B)It involves testing beyond normal operational capacity, often to a breaking
88 D
point, in order to observe the results.
C) It is used to determine the stability of a given system.
D) All of the above.
Exit criteria is determined during ______.
A) Planning and Control B)Implementation and execution
89 A
C)Evaluating exit criteria and Reporting D)Analysis and Design

Which is not true in case of Unit Testing?

A) It decreases the software development speed.


90 A
B) It can’t be expected to catch every error in a program.
C) In this tester evaluates if individual units of source code are fit for use.
D) It is usually conducted by the development team.
Test plans are based on _______.
91 A
A) Project Plan B) Business Plan C) Support Plan D)All of these

Which is not a part of Decision Table?


92 B
A)Stub portion B) Driver portion C) Condition portion D) Action portion

Which is not true regarding Spiral Model?

A)Risk analysis is involved in every cycle of development.


93 B
B)Uses series of prototype for refining test execution plan.
C)For any change we need to iterate the whole cycle.
D)Only this model has the risk analysis phase.
When Acceptance Test Cases are prepared in V model?
94 A) After system testing is done. B) As soon as testing begins.
D
C) When user asks. D) When user requirements are gathered.

Bug is the same name of _______.


95 D
A)Error B) Incident C) Mistake D) Defect

Which testing is concerned with behaviour of whole product as per specified


requirements?
96 C
A)Acceptance testing B) Component testing
C)System testing D) Integration testing

Which of the following is the form of Alpha and Beta Testing?


97 A
A)Acceptance Testing B)System Testing C)Unit Testing D)Integration Testing

Which of the following statements is not true?


A)Acceptance Testing determines if system is ready for release
98 B)Acceptance Testing checks whether system meets needs and expectations C
C)Acceptance Testing helps to find defects in system
D)Acceptance Testing is responsibility of user

Who is responsible for Component Testing?


99 D
A)Software tester B) Designer C) User D) Developer

The expected results of the software is _________________.

A)Only important in system testing


100 A
B)Only used in component testing
C)Most useful when specified in advance
D)Derived from the code.
Subject Code CA 6.4

Subject Data Warehousing and Mining

Paper Code 254604

QUE.
QUESTION ANS
NO.
A data warehouse is which of the following?

A. Can be updated by end users.


B. Contains numerous naming conventions and formats.
1 C
C. Organized around important subject areas.
D. Contains only current data.

A star schema has what type of relationship between a dimension and


fact table?

A. Many-to-many
2 B. One-to-one C
C. One-to-many
D. All of the above.

Which of the following statement is true?

A. The data warehouse consists of data marts and operational data


B. The data warehouse is used as a source for the operational data
3 C
C. The operational data are used as a source for the data warehouse
D. All of the above

The following is true of three-tier data warehouses:

A. Once created, the data marts will keep on being updated from the data
warehouse at periodic times
4 A
B. Once created, the data marts will directly receive their new data from the
operational databases
C. The data marts are different groups of tables in the data warehouse
D.A data mart becomes a data warehouse when it reaches a critical size
The following technology is not well-suited for data mining:

A. Expert system technology


B. Data visualization
5 C
C. Technology limited to specific data types such as numeric data types
D. Parallel architecture

What is true of the multidimensional model?

A. It typically requires less disk storage


B. It typically requires more disk storage
6 B
C. Typical business queries requiring aggregate functions take more time
D. Increasing the size of a dimension is difficult

Which is the right approach of Data Mining?

A. Infrastructure, exploration, analysis, interpretation, exploitation


B. Infrastructure, exploration, analysis, exploitation, interpretation
7 A
C. Infrastructure, analysis, exploration, interpretation, exploitation
D. Infrastructure, analysis, exploration, exploitation, interpretation

Which of the following issue is considered before investing in Data


Mining?

A. Functionality
8 D
B. Vendor consideration
C. Compatibility
D. All of the above

Cluster is?

A. Group of similar objects that differ significantly from other objects


B. Operations on a database to transform or simplify data in order to prepare it
9 for a machine-learning algorithm A
C. Symbolic representation of facts or ideas from which information can
potentially be extracted
D. None of these
Black boxes are

A. This takes only two values. In general, these values will be 0 and 1
and they can be coded as one bit.
10 C
B. The natural environment of a certain species
C. Systems that can be used without knowledge of internal operations
D. None of these

A definition of a concept is if it recognizes all the instances of that concept

A. Complete
11 B. Consistent A
C. Constant
D. None of these

Data mining is

A. The actual discovery phase of a knowledge discovery process


B. The stage of selecting the right data for a KDD process
12 A
C. A subject-oriented integrated time variant non-volatile collection of data in
support of management
D. None of these

A definition or a concept is if it classifies any examples as coming within


the concept

A. Complete
13 B
B. Consistent
C. Constant
D. None of these

Data independence means

A. Data is defined separately and not included in programs


14 B. Programs are not dependent on the physical attributes of data. D
C. Programs are not dependent on the logical attributes of data
D. Both (B) and (C).

E-R model uses this symbol to represent weak entity set?

A. Dotted rectangle
15 B. Diamond C
C. Doubly outlined rectangle
D. None of these
OLAP stands for

a) Online analytical processing


16 A
b) Online analysis processing
c) Online transaction processing
d) Online aggregate processing
Data that can be modeled as dimension attributes and measure attributes
are called _______ data.

17 a) Multidimensional A
b) Single dimensional
c) Measured
d) Dimensional
What do data warehouses support?

a) OLAP
18 A
b) OLTP
c) OLAP and OLTP
d) Operational databases
The full form of OLAP is

A) Online Analytical Processing


19 A
B) Online Advanced Processing
C) Online Advanced Preparation
D) Online Analytical Performance
Data can be store , retrive and updated in …

a) SMTOP
20 b) OLTP B
c) FTP
d) OLAP

Which of the following is a good alternative to the star schema?

a) snow flake schema


21 b) star schema D
c) star snow flake schema
d) fact constellation

——- is not a data mining functionality?

A) Clustering and Analysis


22 B) Selection and interpretation B
C) Classification and regression
D) Characterization and Discrimination
Which of the following can also applied to other forms?

a) Data streams & Sequence data


23 b) Networked data D
c) Text & Spatial data
d) All of these

What is noise?

a) component of a network
24 b) context of KDD and data mining B
c) aspects of a data warehouse
d) None of these

Data mining is?

a) time variant non-volatile collection of data


25 b) The actual discovery phase of a knowledge B
c) The stage of selecting the right data
d) None of these

__________ is a subject-oriented, integrated, time-variant, nonvolatile


collection of data in support of management decisions.

26 A. Data Mining. B
B. Data Warehousing.
C. Web Mining.
D. Text Mining.
The data Warehouse is__________.

A. read only.
27 A
B. write only.
C. read write only.
D. none.
Expansion for DSS in DW is__________.

A. Decision Support system.


28 A
B. Decision Single System.
C. Data Storable System.
D. Data Support System.
The important aspect of the data warehouse environment is that data
found within the data
Warehouse is___________.
29 D
A. subject-oriented.
B. time-variant.
C. integrated.
D. All of the above.

The time horizon in Data warehouse is usually __________.

A. 1-2 years.
30 D
B. 3-4years.
C. 5-6 years.
D. 5-10 years.
The data is stored, retrieved & updated in ____________.

A. OLAP.
31 B. OLTP. B
C. SMTP.
D. FTP.

__________describes the data contained in the data warehouse.

A. Relational data.
32 B. Operational data. C
C. Metadata.
D. Informational data.

____________predicts future trends & behaviors, allowing business


managers to make proactive, knowledge-driven decisions.

A. Data warehouse.
33 B
B. Data mining.
C. Datamarts.
D. Metadata.

__________ is the heart of the warehouse.

A. Data mining database servers.


34 B. Data warehouse database servers. B
C. Data mart database servers.
D. Relational data base servers.

________________ is the specialized data warehouse database.

35 A. Oracle. D
B. DBZ.
C. Informix.
D. Redbrick.

_____________consists of information in the enterprise that is not in


classical form.

A. Mushy metadata.
36 A
B. Differential metadata.
C. Data warehouse.
D. Data mining.

______________databases are owned by particular departments or


business groups.

37 A. Informational. B
B. Operational.
C. Both informational and operational.
D. Flat.

The star schema is composed of __________ fact table.

A. one.
38 B. two. A
C. three.
D. four.

The time horizon in operational environment is ___________.

A. 30-60 days.
39 B. 60-90 days. B
C. 90-120 days.
D. 120-150 days.

The key used in operational environment may not have an element


of__________.

A. time.
40 A
B. cost.
C. frequency.
D. quality.
Data can be updated in _____environment.

A. data warehouse.
41 C
B. data mining.
C. operational.
D. informational.

Record cannot be updated in _____________.

A. OLTP
42 D
B. files
C. RDBMS
D. data warehouse

Data warehouse contains_____________data that is never found in the


operational environment.

43 A. normalized. C
B. informational.
C. summary.
D. denormalized.

Data redundancy between the environments results in less than


____________percent.

44 A. one. A
B. two.
C. three.
D. four.

Detail data in single fact table is otherwise known as__________.

A. monoatomic data.
45 C
B. diatomic data.
C. atomic data.
D. multiatomic data.
A data warehouse is _____________.

A. updated by end users.


46 B. contains numerous naming conventions and formats C
C. organized around important subject areas.
D. contains only current data.

The load and index is ______________.

A. a process to reject data from the data warehouse and to create the necessary
indexes.
B. a process to load the data in the data warehouse and to create the necessary
47 B
indexes.
C. a process to upgrade the quality of data after it is moved into a data
warehouse.
D. a process to upgrade the quality of data before it is moved into a data
warehouse.

The type of relationship in star schema is __________________.

A. many-to-many.
48 B. one-to-one. C
C. one-to-many.
D. many-to-one.

Fact tables are ___________.

A. completely demoralized.
49 C
B. partially demoralized.
C. completely normalized.
D. partially normalized.

MDDB stands for ___________.

A. multiple data doubling.


50 B. multidimensional databases. B
C. multiple double dimension.
D. multi-dimension doubling.
Which of the following statement is true?

A. The data warehouse consists of data marts and operational data


B. The data warehouse is used as a source for the operational data
51 C
C. The operational data are used as a source for the data warehouse
D. All of the above

The following is true of three-tier data warehouses:

A. Once created, the data marts will keep on being updated from the data
warehouse at periodic times
52 B. Once created, the data marts will directly receive their new data from the A
operational databases
C. The data marts are different groups of tables in the data warehouse
D. A data mart becomes a data warehouse when it reaches a critical size

What is true of the multidimensional model?

A. It typically requires less disk storage


B. It typically requires more disk storage
53 B
C. Typical business queries requiring aggregate functions take more time
D. Increasing the size of a dimension is difficult

Data warehouse architecture is based on ______________.

A. DBMS.
B. RDBMS.
54 C. Sybase. B
D. SQL Server.

.A goal of data mining includes which of the following?

A. To explain some observed event or condition


B. To confirm that data exists
55 A
C. To analyze data for expected relationships
D. To create a new data warehouse
Which of the following statements does not apply to relational databases?

A. Relational databases are simple to understand


B. Tables are one of the basic components of relational databases
56 C
C. Relational databases have a strong procedural orientation
D. Relational databases have a strong mathematical foundation

In the relational database terminology, a table is synonymous with:

A. A column
B. A row
57 D
C. An attribute
D. A relation

A null value indicates:

A. A numeric value with value 0


B. The absence of a value
58 B
C. A very small value
D. An erroneous value

Which of the following features usually applies to data in a data


warehouse?

A. Data are often deleted


59 B. Most applications consist of transactions C
C .Data are rarely deleted
D. Relatively few records are processed by applications

Data warehouse architecture is based on ______________.

A. DBMS.
B. RDBMS.
60 C. Sybase. B
D. SQL Server.
The time horizon in Data warehouse is usually __________.

A. 1-2 years.
61 D
B. 3-4years.
C. 5-6 years.
D. 5-10 years.
The data is stored, retrieved & updated in ____________.

A. OLAP.
62 B
B. OLTP.
C. SMTP.
D. FTP.
____________predicts future trends & behaviors, allowing business
managers to make proactive, Knowledge-driven decisions.

63 A. Data warehouse. B
B. Data mining.
C. Datamarts.
D. Metadata.
__________ is the heart of the warehouse.

A. Data mining database servers.


64 B
B. Data warehouse database servers.
C. Data mart database servers.
D. Relational data base servers.
________________ is the specialized data warehouse database.

A. Oracle.
65 D
B. DBZ.
C. Informix.
D. Redbrick.
________________defines the structure of the data held in operational
databases and used by operational applications.

66 A. User-level metadata. C
B. Data warehouse metadata.
C. Operational metadata.
D. Data mining metadata
_________maps the core warehouse metadata to business concepts,
familiar and useful to end users.

67 A. Application level metadata. A


B. User level metadata.
C. Enduser level metadata.
D. Core level metadata.
_____________consists of information in the enterprise that is not in
classical form.

68 A. Mushy metadata. A
B. Differential metadata.
C. Data warehouse.
D. Data mining
The star schema is composed of __________ fact table.

A. one.
69 A
B. two.
C. three.
D. four.
The time horizon in operational environment is ___________.

A. 30-60 days.
70 B
B. 60-90 days.
C. 90-120 days.
D. 120-150 days.
The key used in operational environment may not have an element
of__________.

71 A. time. A
B. cost.
C. frequency.
D. quality.
Data can be updated in _____environment.

A. data warehouse.
72 C
B. data mining.
C. operational.
D. informational.
Record cannot be updated in _____________.

A. OLTP
73 D
B. files
C. RDBMS
D. data warehouse
The source of all data warehouse data is the____________.

A. operational environment.
74 A
B. informal environment.
C. formal environment.
D. technology environment.
Data redundancy between the environments results in less than
____________percent.

75 A. one. A
B. two.
C. three.
D. four.
Fact tables are ___________.
A. completely demoralized.
76 B. partially demoralized. C
C. completely normalized.
D. partially normalized.
_______________ is the goal of data mining.

A. To explain some observed event or condition.


77 A
B. To confirm that data exists.
C. To analyze data for expected relationships.
D. To create a new data warehouse.
The data administration subsystem helps you perform all of the
following, except__________.

78 A. backups and recovery. D


B. query optimization.
C. security management.
D. create, change, and delete information.
The most common source of change data in refreshing a data warehouse
is _______.

79 A. queryable change data. A


B. cooperative change data.
C. logged change data.
D. snapshot change data.
Classification rules are extracted from _____________.

A. root node.
80 B
B. decision tree.
C. siblings.
D. branches.
The main organizational justification for implementing a data warehouse
is to provide ______.

81 A. cheaper ways of handling transportation. C


B. decision support.
C. storing large volume of data.
D. access to data.
Data warehouse architecture is based on ______________.

A. DBMS.
82 B
B. RDBMS.
C. Sybase.
D. SQL Server
Source data from the warehouse comes from _______________.

A. ODS.
83 A
B. TDS.
C. MDDB.
D. ORDBMS.
________________ is a data transformation process.

A. Comparison.
84 D
B. Projection.
C. Selection.
D. Filtering.
The technology area associated with CRM is _______________.

A. specialization.
85 C
B. generalization.
C. personalization.
D. summarization.
MDDB stands for ___________.

A. multiple data doubling.


86 B
B. multidimensional databases.
C. multiple double dimension.
D. multi-dimension doubling.
___________ is an important functional component of the metadata.

A. Digital directory.
87 C
B. Repository.
C. Information directory.
D. Data dictionary.
___________ is data collected from natural systems.

A. MRI scan.
88 A
B. ODS data.
C. Statistical data.
D. Historical data.
____________ are some popular OLAP tools.

A. Metacube, Informix.
89 A
B. Oracle Express, Essbase.
C. HOLAP.
D. MOLAP.
Capability of data mining is to build ___________ models.

A. retrospective.
90 C
B. interrogative.
C. predictive.
D. imperative.
Strategic value of data mining is ______________.

A. cost-sensitive.
91 C
B. work-sensitive.
C. time-sensitive.
D. technical-sensitive.
The terms equality and roll up are associated with ____________.

A. OLAP.
92 C
B. visualization.
C. data mart.
D. decision tree.
Exceptional reporting in data warehousing is otherwise called as
__________.

93 A. exception. B
B. alerts.
C. errors.
D. bugs.
____________ is a metadata repository.

A. Prism solution directory manager.


94 A
B. CORBA.
C. STUNT.
D. COBWEB.
________________ is an expensive process in building an expert system.

A. Analysis.
95 D
B. Study.
C. Design.
D. Information collection.
Removing duplicate records is a process called _____________.

A. recovery.
96 B
B. data cleaning.
C. data cleansing.
D. data pruning.
How many components are there in a data warehouse?

A. two.
97 D
B. three.
C. four.
D. five.
Metadata contains atleast _________.

A. the structure of the data.


98 D
B. the algorithms used for summarization.
C. the mapping from the operational environment to the data warehouse.
D. all of the above.
Which of the following is the other name of Data mining?

A. Exploratory data analysis.


99 D
B. Data driven discovery.
C. Deductive learning.
D. All of the above
Which of the following is a descriptive model?

A. Classification.
100 C
B. Regression.
C. Sequence discovery.
D. Association rules.
CA 6.5 Cyber Security (254605)

QUE.
QUESTION ANS
NO.

. ________ are often delivered to a PC through an email attachment and are


1 often designed to do harm. D
A). Spam B). Email C). Portals D). Virus

Which of the following is known as Malicious software?


2 C
A). Illegalware B). Badware C). Malware D). Maliciousware

Digital signature envelope is decrypted by using _________.


A). merchant private key. B). payment’s private key.
3 B
C). payment public key. D). merchant’s public key.

What is the updated version of the IT Act, 2000?


4 A) IT Act, 2007 B) Advanced IT Act, 2007 C
C) IT Act, 2008 D) Advanced IT Act, 2008

Key logger is a _______.


5 C
A). firmware B). Antivirus C). Spyware D). all of the above

6 In which year India’s IT Act came into existence? A


A) 2000 B) 2001 C) 2002 D) 2003

Which of the following is not done by cyber criminals?


7 A) Unauthorized account access B) Mass attack using Trojans as botnets D
C) Email spoofing and spamming D) Report vulnerability in any system

_______ are individuals or organizations who distribute unsolicited, falsified e-


mail attempting to spread spyware or malware, attack organizations or sell
8 D
products for monetary gain.
A). Spyware. B). Malware. C). Insiders. D). Spammers.
Cyber risk leads to
9 A). Risk of financial loss B). Disruption D
C). Damage to the reputation D). All of the above
VIRUS stands for ______________
A). Very Intelligent Result Until Source
10 B). Very Interchanged Resource Under Search C
C). Vital Information Resource Under Slege
D). Viral Important Record User Searched

A computer ________ is a malicious code which self-replicates by copying itself


11 to other programs. B
A) program B) virus C) application D) worm
SSL provides only ___________.
A). authentication. B). confidentiality.
12 A
C). integrity. D). durability.

______ is created specifically for the organization based on the information


13 gathered in the reconnaissance phase. D
A). Adware. B). Spyware. C). Spam. D). Malware.

Which of the following type is called as interoperability?


14 D
A). Semantic B). Technical C). Policy D). All of the above

DDOS attacks originate from ______________


15 A). Internet connected machines B). Intranet connected machines A
C). Trojans D). Spywares

Which attack stores data in more space than its buffer allocation?
16 A). DoS attack B). Salami attack C
C). Buffer overflow attack D). Virus attack

In the 1990s, the typical hacker's approach used to be _______.


17 A
A). Hit-and-run. B). Targeted attacks. C). Malware. D). Cyber-attacks.
Electronic Data Interchange Software consists of the following four layers:
A)Business application, Internal format conversion, Network translator, EDI
envelop
18 B)Business application, Internal format conversion, EDI translator, EDI envelop B
C)Application layer, Transport layer, EDI translator, EDI envelop
D)Application layer, Transport layer, IP layer, EDI envelop

WPA2 is used for security in


19 C
A). Ethernet B). Bluetooth C). Wi-fi D). none of the above

CFAA stands for ________________


20 A). Computer Fraud and Abuse Act B). Cyber Fraud and Abuse Act A
C). Cyber Fraud Activity Analysis D). Cyber Fraud Activity Act

______________ is the secure version of HTTP, the protocol over which data is
sent between the browser and the website that are connected to.
A). Hyper Text Transfer Protocol Secure
21 A
B). Hyper Text Transfer Protocol Security
C). File transfer protocol secure
D). File transfer protocol security
The term ‘Intellectual Property Rights’ covers
A)Copyrights B)Know-how
22 D
C)Trade dress D)All of the above

Which of the following is not a type of virus?


23 D
A) Boot sector B) Polymorphic C) Multipartite D) Trojans

mcafee is an example of _______.


24 D
A). photo editing software B). quick heal C). virus D). antivirus

EDI requires
A) representation of common business documents in computer readable forms
25 B) data entry operators by receivers A
C) special value added networks
D) special hardware at co-operating Business premises
Which of the following is not a cloud based storage solutions?
26 D
A). Dropbox B). Google Drive C). OneDrive D). McAfee

The usage of the Internet for hours by an unauthorized person which is actually
paid by another person is called __________.
27 B
A). denial of service. B). internet time theft.
C). virus attack. D). cyber defamation.
________ provides the quantum of information on a specific risk.
28 A) Risk Governance B). Risk Measurement B
C). Risk monitoring D). Risk Mitigation
Which system provides administrator with the ability to instantly view and
change access rights?
A). Identity and access management
29 A
B). Data Loss Prevention
C). Security information and event management
D). Intrusion detection system

What is the attack called evil twin?


30 A). MAC Spoofing B). ARP poisoning C
C). Rogue access point D). Session hijacking

Following the moves of an individual's activity over Internet is known as


__________.
31 C
A). internet time theft. B). unauthorized access.
C). cyber stalking. D). computer voyeur.

. ______ can be defeated by blocking executables in emails, better patching,


disabling auto run capabilities and strong password policies.
32 A
A). Network-travelling worms. B). Phishing attacks.
C). Spyware. D). Malware.

___________ monitor the user activity on internet and transmit the information
33 in the background someone else C
A). Malware B). Adware C). Spyware D). None of these
Information Technology act in India was amended in the year
34 C
A). 2000 B). 2004 C). 2008 D). 2010

Cyber-laws are incorporated for punishing all criminals only.


35 A) True B
B) False

The two most critical assets of any organization are its _______.
36 A). user and infrastructure B). user and data B
C). data and capital investment D). user and capital investment

________ is the act of sending multiple copies of unsolicited mails or mass


37 emails such as chain letters to many users at a time. A
A). Spamming B). Cyber theft. C). Phishing. D). Cyber laundering.

38 Cyber-crime can be categorized into ________ types. C


A) 4 B) 3 C) 2 D) 6

Network layer firewall works as a


39 A). frame filter B). packet filter B
C). both (A) and (B) D). none of the above

. Major areas covered in cyber security is/are ______.


40 A). application security. B). information security. D
C). disaster security. D). all the above.

DDOS is ______________
41 A). Distribution of service B). Duplication of work D
C). Cyber attack D). Distributed Denial of service

SSL is placed in between the ________ layers.


A). transport & data link. B). application & presentation.
42 C
C). application & transport. D). application & session.
Which of the following is not a type of cyber crime?
43 A) Data theft B) Forgery D
C) Damage to data and systems D) Installing antivirus for protection

. ___________ is the act of making something criminal, or making it against the


law.
44 D
A). Criminalization. B). Identity theft.
C). Organized crime. D). Cyber security.

Electronic transfer of illegally obtained money with the goal of hiding its source
and possibly its destination is called as ______.
45 A
A). cyber laundering. B). assault by a threat.
C). cyber contraband. D). cyber stalking.

Intellectual Property Rights (IPR) protect the use of information and ideas that
are of
46 A)Ethical value B)Moral value D
C)Social value D)Commercial value

________ is a function of the organizational policies and processes as well as


technologies.
47 C
A). Cyber crime. B). Cyber threat.
C). Cyber security. D). Threat intelligence.

In the basic TCP/IP protocol suite, the number of layers used are _________.
48 A). 4 B). 6 C). 5 D). 7 A

Exploring appropriate and ethical behaviors related to online environments and


digital media is known as ____________
49 A
A). Cyber ethics B). Cyber security
C). Cyber safety D). Cyber law

Firewalls are used to protect against _________.


50 A). data driven attacks B). fire attacks D
C). virus attacks D). unauthorized access
Spammers are classified into __________
A). hucksters and fraudsters
51 B). hucksters and warez A
C). hucksters and piracy
D). piracy and hucksters
________ an event dependent programme, as soon as the designated event
occurs, it crashes the computer, releases a virus or any other harmful
52 possibilities. A
A). Logic bomb B). Computer virus.
C). Email bombing. D). Salami attack.
The principal electronic payment systems for electronic commerce is
A)Credit Card B)Digital Wallet
53 D
C)Electronic Cheque D)All of the above

When a logic bomb is activated by a time related event, it is known as _____.


54 A). virus B). Trojan horse D
C). time related bomb sequence D). time bomb

_______ refers to the criminal use of Internet.


55 D
A). Cyber space. B). Cyber investigation. C). Cyber law. D). Net-crime

______ is created specifically for the organization based on the information


56 gathered in the reconnaissance phase. D
A). Adware. B). Spyware. C). Spam. D). Malware.

. ______________ is the secure version of HTTP, the protocol over which data is
sent between the browser and the website that are connected to.
A). Hyper Text Transfer Protocol Secure
57 A
B). Hyper Text Transfer Protocol Security
C). File transfer protocol secure
D). File transfer protocol security

Which of them is not an ideal way of spreading the virus?


58 A) Infected website B) Emails C
C) Official Antivirus CDs D) USBs
EDI standards are
A) not universally available
59 B) essential for B2B commerce B
C) not required for B2B commerce
D) still being evolved

Which of the following has highest value towards security?


60 A). Architecture B). Passive defense D
C). Active defense D). Offense

Compromising confidential information comes under _________


a) Bug
61 b) Threat B
c) Vulnerability
d) Attack
According to the CIA Triad, which of the below-mentioned element is not
considered in the triad?
a) Confidentiality
62 C
b) Integrity
c) Authenticity
d) Availability
CIA triad is also known as ________
a) NIC (Non-repudiation, Integrity, Confidentiality)
63 b) AIC (Availability, Integrity, Confidentiality) B
c) AIN (Availability, Integrity, Non-repudiation)
d) AIC (Authenticity, Integrity, Confidentiality)
When you use the word _____ it means you are protecting your data from
getting disclosed.
a) Confidentiality
64 A
b) Integrity
c) Authentication
d) Availability
______ means the protection of data from modification by unknown users.
a) Confidentiality
65 b) Integrity B
c) Authentication
d) Non-repudiation
Data ___________ is used to ensure confidentiality.
a) Encryption
66 b) Locking A
c) Deleting
d) Backup
Which of these is not a proper method of maintaining confidentiality?
a) Biometric verification
67 b) ID and password based verification D
c) 2-factor authentication
d) switching off the phone
One common way to maintain data availability is __________
a) Data clustering
68 b) Data backup B
c) Data recovery
d) Data Altering
VPN means
a) Virtual Private Network
69 b) Virtual Public Network A
c) Vide Private Network
d) Virtual Protected Network
Which are types of Virtual Private Network
a) Remote Access VPN
70 b) Intranet VPN D
c) Extranet VPN
d) All above
Which of the following is/are threats for electronic payment systems?
a) Computer worms
71 b) Computer virus D
c) Trojan horse
d) All of the above
To protect yourself from computer hacker, you should turn on
a) Script
72 b) Firewall B
c) VLC
d) Antivirus
Firewalls are used to protect against --------
a) data driven attacks
73 b) fire attacks D
c) virus attacks
d) unauthorized access
Code red is a(n) ----------
a) Word Processing Software
74 b) Antivirus C
c) Virus
d) Photo Editing Software
------- software are programs that are installed onto your computer and can scan
and remove known viruses which you may have contracted
a) Firmware
75 D
b) Adware
c) Key logger
d) Antivirus
------- are attempts by individuals to obtain confidential information from you to
falsifying their identity.
a) Computer viruses
76 B
b) Phishing scams
c) Phishing trips
d) Spyware scams
What is ISP?
a) Internet Service Provider
77 b) Internet Service Pack A
c) Initial service packet
d) Internet set packet
Viruses are
a) man made
78 b) naturally occur A
c) machine made
d) all above
Firewall is types of
a) Virus
79 b) Security Threats D
c) Worm
d) None of above
Which of the following is used for access control
a) Biometrics Systems
80 b) CCTV A
c) both above
d) None of above
Advantages of Virtual Private Network(VPN)
a) Security
81 b) Cost saving D
c) Scalability
d) All above
Types of Network attack
a) Active attack
82 b) Passive attack C
c) Both
d) None of above
What is IDS?
a) Intrusion Detection System
83 b) Immediate Detection System A
c) illusion Detection System
d) Internet Detection System
What is DOS attack?
a) Denial-of-Service attack
84 b) Danger of System attack A
c) Denial-of-System attack
d) none of above
VPN is
a) Type of public network that uses private network
85 b) Type of private network that uses public network B
c) Type of private network that uses private network
d) Type of public network that uses private network
Which of the following Malicious program do not replicate automatically.
a) Trojan horse
86 b) Virus A
c) Worm
d) Zombie
Which of the following is known as Malicious software.
a) illegal ware
87 b) bad ware C
c) malware
d) malicious ware
To protect a computer from virus, you should install -------- in your computer.
a) backup wizard
88 b) disk cleanup C
c) anti-virus
d) disk defragmenter
VIRUS stands for
a) Very Intelligent Result Until Source
89 b) Very Interchanged Resource Under Search C
c) Vital Information Resource Under Sledge
d) Viral Important Record User Searched
What is short for malicious software (is software designed to disrupt computer
operation, gather sensitive information, or gain unauthorized access to computer
systems)?
90 a) Malware A
b) Moleculewar
c) Malisoft
d) Malairasoft
Which of the followings are components of Information System?
a) Hardware
91 b) Software D
c) Data
d) all above
Information Technology Amendment Act came in year
a) 2000
92 b) 2008 B
c) 2007
d) 2010
Information Technology Act 2000 is mainly for
a) Cyber crime
93 b) General crime A
c) money theft
d) murder
Cyber-crime is a crime that happens from
a) Computer
94 b) Internet D
c) Mobile
d) all above
Use of credit card
a) withdraw money
95 b) for shopping D
c) emergency
d) all
Which of following is a cyber-crime?
a) Website hacking
96 b) DOS attack D
c)Email spoofing
d) all
Which of followings are components of Cryptographic system convert cipher
text into plain text?
a) sender
97 D
b) Encryption
c) Cipher text
d) Decryption
Which component is useful for document security?
a) Digital Signature
98 b) Cryptographic System D
c) Finger print
d) all above
Which of the following is used to alert administrator when somebody tries to
access our network.
a) Intrusion Detection System (IDS)
99 A
b) Router
c) Switch
d) Wi-Fi
Which of the following is used to provide regular information of daily activities
of a business to manager.
a) Management Information System (MIS)
100 A
b) Transaction Processing System(TPS)
c) Expert System (ES)
d) Decision Support System.
Subject Code CA 6.1

Subject ERP & SAP

Paper Code 254601

QUE.
QUESTION ANS
NO.
Which of the following describes an ERP system?
A) ERP systems provide a foundation for collaboration between departments
B) ERP systems enable people in different business areas to communicate
1. C) ERP systems have been widely adopted in large organizations to store critical
D
knowledge used to make the decisions that drive the organization’s performance
D) All of the above
What is at the heart of any ERP system?
A) Information
2. B) Employees D
C) Customers
D) Database
What are the primary business benefits of an ERP system?
A) Sales forecasts, sales strategies, and marketing campaigns
B) Market demand, resource and capacity constraints, and real-time scheduling
3. C) Forecasting, planning, purchasing, material management, warehousing, inventory, C
and distribution
D) All of the above
Answer:
Which one of the following is not a myth about ERP?
A) ERP means more work and procedures
4. B) ERP makes many employees redundant. C
C) ERP integrate and automate organization process
D) ERP is the sole responsibility of management
Which one of the following is the part of organization?
A) People
5. B) Common goal
C) Resources
D) All of the above
In SAP system, an administrator can also lock or unlock a user as per the requirement
either manually or automatically?
6. A) True
B) False
In SAP system architecture, which of the following layer communicates with the
application server to perform all the processing and which is known as brains of an SAP
7. system?
A) Application Server Layer
B) Presentation Layer
C) Database Layer
D) None of these
In the _________, ERP packages were targeted at the manufacturing industry.
A) 1970’s
8. B) 1990's
C) 1980’s
D) 1960’s
What must a system do to qualify as a true ERP solution?
A) Be flexible
9. B) Be modular and closed A
C) Extend within the company
D) All of the above

SAP was founded in which year?


A)1972
10. B)1974 A
C)1980
D)1982

Application server of the sap system is run by?


A) ABAP and JAVA
11. B) ABAP A
C) JAVA
D) C++
What does SAP stand for?
A)Systems Applications and Products for Data Processing
12. B)Systems Applications and Products for Data Warehousing A
C)Systems Applications and Products for Data Maintaining
D)Systems Applications and Products for Data collecting
What is a Valid Configuration for a R3 System?
A )Many App servers and one database server
13. B )No app server and one database server A
C )One app server and many database servers
D )None of the above
Which of the following is a reason for ERPs explosive growth?
A) ERP is a logical solution to the mess of incompatible applications
14. B) ERP addresses the need for global information sharing and reporting D
C) ERP is used to avoid the pain and expense of fixing legacy systems
D) All of the above

Who are the primary users of SCM systems?


A) Sales, marketing, customer service
15. B) Accounting, finance, logistics, and production C
C) Customers, resellers, partners, suppliers, and distributors
D) All of the above
Who are the primary users of ERP systems?
A) Sales, marketing, customer service
16.
B) Accounting, finance, logistics, and production B
C) Customers, resellers, partners, suppliers, and distributors
D) All of the above

Which one of the following doesn’t belong to ERP Technologies?


A) Data Warehousing
17.
B) Business Process reengineering D
C) Data Mining
D) Manufacturing resource planning
_________ handling and sharing has become a vital process for efficient and effective
working of any organization.
18. A) Material
C
B) Resource
C) Information
D) Database
________ became the fundamental concept of production management and control.
A) BOM
19.
B) MRP B
C) ERP
D) MRP II

The _________ should plan well and execute perfectly the implementation of ERP.
A) Organisation
20. B
B) System developers
C) Vendors
D) Top Management

Which is one of the most critical steps in the ERP implementation?


A) Creation of Organizational Model
21.
B) Creation of Integrated Data Model B
C) Creation of Business Model
D) Creation of Data Model
What is one of the key resources of every organisation, in today’s competitive business
environment?
22. A) Employee
B) Information
B
C) ERP
D) Database
In an integrated data model, what gives a snapshot of the organisation at any given
time?
A) ERP
23. B) Database B
C) Management
D) MIS
EIS stands for:
A) Executive Interaction System
24. B) Executive Interconnecting Systems C
C) Executive Information Systems
D) Executive Instrumental Systems

DSS is quite _______________ and is available on request.


A) Structured
25. B) Non-structured D
C) Semi-structured
D) Unstructured
When a customer needs to check the performance of the company before he places an
order, which department has to be in a position to provide the necessary information?
26. A) Production
C
B) Quality
C) Marketing
D) Finance
OLAP stands for:
A) On-Line Analytical Processing
27.
B) On-Line Account Processing A
C) On-Line Arithmetic Processing
D) On-Line Application Processing
Data mining is the process of identifying valid, new, potentially useful, and ultimately
clear ______________ from databases.
28. A) Decision
B) Strategies
C
C) Information
D) Account
Which one of the following is not a part of ERP implementation?
A) Vendor representatives
29.
B) Employees teams D
C) Consultants
D) Customers
MIS is a computer-based system that optimizes the _______ of information throughout
an organisation.
1. Collation 2. Collection 3. Transfer 4. Presentation
30.
A) 1, 2, & 3 B
B) 1, 3, & 4
C) 1, 2, & 4
D) 1, 2, 3, & 4
ERP package will handle ________ business functionalities.
A) one.
31.
B) two. D
C) three.
D) all.
The most important step of ERP implementation is _________ phase.
A) installing.
32.
B) training. C
C) gap analysis.
D) testing.

An enterprise is a group of people with ________.


A) common goal.
33.
B) separate goal for each department. A
C) multiple goals.
D) two or more goals.
In _________, entire organization is considered as a system and the departments are its
subsystem.
34. A) business way.
C
B) general.
C) enterprise way.
D) planning.
An information system produces information using the ________ cycle.
A) data analysis.
35.
B) input-process-output. B
C) input-output.
D) process-input-output.

Which of the following method is used to produce reports about data.


A) Decision Support Systems.
36.
B) Executive Information Systems. D
C) Query/Report Writing Tool.
D) All the above.

Which of the following is an example for commercial ERP


A) ERP5
37. B) Microsoft Dynamics AX
C) Compiere
D) Fisterra

_________ approaches reduces data redundancy and provide update information.


A) Legacy system.
38.
B) Information system. C
C) Integrated data model.
D) Data base.

The primary concept of _________ is that storing huge amount of data.


A) data mining.
39.
B) OLAP. D
C) supply chain management.
D) data warehousing.
Data mining is a powerful new technology to __________ from large databases.
A) extraction of hidden predictive information.
40.
B) generating reports. A
C) retrieving data.
D) show result.

ERP system is built on a ____________ utilising a common computing platform


A) Centralised database
41. B) Individual databases A
C) Modular databases
D) Centralised layout
A data warehouse is a collection of _________ that is critical to the successful execution
of enterprise initiatives.
42. A) raw data.
C
B) tables.
C) computer based information.
D) reports.
_________ is one of the benefits of supply chain management.
A) Easy process.
43.
B) Manufacturing make-to-stock products. D
C) Minimum time.
D) Faster response-to-market changes.

_________ is a track-proven technology applicable to every company.


A) OLAP.
44.
B) Supply chain management. B
C) Data mining.
D) Data warehousing.

________ is group of people with common goal.


A) Department
45.
B) System. D
C) Resource.
D) Enterprise.
ERP vendors usually design their systems around standard business processes, based
upon ____________________
A) Business standards
46. B) Global standards C
C) Best business practices.
D) Best profitable standards
What is the key to MRP?
A) Quantity of requirements for components are based upon the structure of the Bill of
Material.
B) Production of requirements for components are based upon the structure of the Bill
47. of Material. C
C) Time-phasing of requirements for components are based upon the structure of the
Bill of Material.
D) Capacity of requirements for components are based upon the structure of the Bill of
Material.

The companies can use supply chain management for ________.


A) critical business process.
48.
B) effective planning. A
C) inventory control.
D) material management.
ASAP road-map is a detailed project plan by _______ that describes all activities in an
implementation.
49. A) SAP.
A
B) ORACLE.
C) PeopleSoft.
D) Baan.
Baan company is strong in ________.
A) manufacturing.
50.
B) HR. A
C) plant and maintenance.
D) finance.

_________ module supports the entire sales and purchase processes from start to finish.
A) Order management
51. B) Sales management A
C) Purchase management
D) Master Data Management

In which phase, data conversion is done?


A) Going live.
52.
B) Testing. A
C) Training.
D) Configuration.
In which phase the actual users of the system will be given training on how to use the
system?
53. A) Gap analysis.
D
B) Reengineering.
C) Implementation team training.
D) End user training.
____________ maintains reports of warehouse supplies.
A) ERP financial module
54. B) ERP Inventory software module B
C) ERP Resource module
D) ERP verification module
_______ is the last phase in ERP implementation life cycle.
A) Testing.
55.
B) End user training. C
C) Post implementation.
D) Going live.

_________ are the people who have developed the ERP packages.
A) Consultants.
56.
B) End users. D
C) Administrative team.
D) Vendors.

Which is the most critical phase in ERP implementation?


A) Understanding the problem.
57.
B) Defining solutions. B
C) Getting down to work.
D) Going live.

Which SAP release is based on a mainframe ?


A) R1
58. B) R2 B
C) R3
D) All of the above

Which phase is most difficult phase in ERP implementation?


A) Getting down to work.
59.
B) Going live. A
C) Post implementation.
D) Configuration.
Which term relates to the technical capabilities that allow systems to connect with one
another through standardized interfaces called Web services?
A) Enterprise Resource Planning
60. B) Supply Chain Management D
C) Architectured
D) Service-Oriented Architecturee
Select the correct Business Suite system.
A) CRM
61. B) EP A
C) MDM
D) XI

The end-user and managers are trained ______.


A) during implementation.
62.
B) after implementation. D
C) before implementation.
D) during and after implementation.
______ is one of the objectives when selecting a ERP package.
A) Accuracy.
63.
B) Flexibility. B
C) Project planning.
D) Gap analysis.

Vendors have to be upgrading their products by using ________.


A) latest advancement in technology.
64.
B) new software. A
C) new modules.
D) new concepts.

The training is a ___________________ process.


A) ongoing. A
65.
B) new.
C) difficult.
D) time oriented.

A storage device that is connected directly to a network is an example of ……..


A. network attached storage
66.
B. storage area network A
C. direct attached storage
D. RAID

To easily modify the existing system it is necessary to


A. use good software tools
67.
B. use the best hardware available C
C. design the system which can be changed at low cost
D. keep the programming team happy

In MIS ……. plays economically sound and logically in development process.


A. information
68.
B. data D
C. statements
D. data flow

The final element of feedback is essential for system operation and for ……….
69. A. self-regulation
B. correct errors A
C. testing
D. debugging

The expert system uses a(n) …….. to select the most appropriate response.
A. inference
70.
B. decision support system A
C. knowledge base
D. data source
Which category of computer based information systems are concerned with
improving efficiency by applying information technology to common administrative
tasks, such as creating business documents?
71.
A. Office automation systems A
B. Strategic information systems
C. Expert systems
D. Business information systems
The data Warehouse is__________.
A. read only.
72.
B. write only. A
C. read write only.
D. none

The data is stored, retrieved & updated in ____________.


A. OLAP
73.
B. OLTP B
C. SMTP
D. FTP

__________describes the data contained in the data warehouse


74. A. Relational data
B. Operational data C
C. Metadata
D. Informational data

__________ is the heart of the warehouse.


A. Data mining database servers.
75.
B. Data warehouse database servers. B
C. Data mart database servers.
D. Relational data base servers.

A bill of materials lists the


76. A. times needed to perform all phases of production
B. production schedules for all products C
C. components, ingredients, and materials required to produce an item
D. operations required to produce an item

What is the use of data cleaning?


77. A. to remove the noisy data
B. correct the inconsistencies in data D
C. transformations to correct the wrong data.
D. All of the above

Data Mining System Classification consists of?


A. Database Technology
78.
B. Machine Learning D
C. Information Science
D. All of the above
Which one of the following is a SAP product?
A) SAP R/5
B) SAP R/2
79. C) SAP R/1 B
D) SAP R/4

The minimum record accuracy required for successful MRP is approximately


A) lower than 90%
B) 90%
80. C) 95% D
D) 99%

What are the different layers in R/3 system?


A) Presentation layer
B) Application layer
81. C) Database layer D
D) All of the above
E) None of the above

What are the advantages of a three-tier client/server configuration as compared to a


single-tier or two-tier configuration?
A) Simpler scalability
82. B) Simpler administration D
C) Assign users to specific application servers.
D) Both A and C
What are the direct benefits of ERP systems?
A) Business Integration
B) Flexibility
83. C) Better analysis and planning capability E
D) Use of latest technology
E) All of the above

Enterprise Resource Planning (ERP) has been criticized on a number of grounds.


Which of thefollowing is not a common criticism of ERP?
A) It can have a disruptive effect on the organization’s operations
84. B) It does not allow decisions and databases from all parts of the organization to be B
integrated
C) Implementation is expensive
D) The effect it has on businesses is disappointing
Closed Loop MRP means:
A) Actual sales are netted off the forecasts in the MPS
B) Actual inventory is counted regularly and adjustment made to the inventory
85. records C
C) Capacity and resource planning is included in the MRP logic
D) Unused materials are returned to stores and recorded back into the system
MRP stands for:
A) Manufacturing Resource Planning
86. B) Master Resources Production D
C) Management Reaction Planning
D) Materials Requirements Planning

Which of the following is an output of materials requirements planning?


A) Bills of materials
87. B) Master production schedule D
C) Work orders
D) All of the above

Which of the following has the least integration of information systems?


A) Materials requirements planning
88. B) Enterprise resource planning A
C) Manufacturing resource planning
D) Web-integrated enterprise resource planning

Which of the following has the highest impact on the whole supply network?
A) Collaborative commerce
89. B) Manufacturing resource planning A
C) Materials requirements planning
D) Enterprise resource planning
Which of the following allows individual ERP systems to communicate with each
other?
A) Web-integrated ERP
90. B) Web-integrated MRP A
C) EMRP
D) Global ERP
What system helps make calculations regarding the volume and timing of materials
needed?
A) Materials resource planning
91. B) Material scheduling A
C) Product plan
D) Materials requirements planning
Manufacturing resource planning expanded out of materials requirements planning
during which decade?
A) 1970s
92. B) 1990s D
C) 1960s
D) 1980s
Which of the following occurs when everyone involved in sourcing, producing, and
delivering the company's product works with the same information? ERP MCQ with
solutions
93. A) Eliminates redundancies D
B) Cuts down wasted time
C) Removes misinformation
D) All of the above
Application server of the sap system is run by?
A) ABAP and JAVA
94. B) ABAP A
C) JAVA
D) C++

What is SAP Instance?


A )Group of Database that make a system run
95. B )Group of SAP instances that make a system run C
C )Group of Services that make a system run
D )Group of O/S level Files that make a system run

Which layer in a SAP client server architecture processes ABAP programs?


A)Database layer
96. B)Presentation layer C
C)Application layer
D)none of the above

SAP GUI is not part of application server.


97. A)True A
B)False

Which statement is correct?


A) The ICM is implemented as a thread and is available for a large number of
operating systems.
B) You can use an instance profile parameter to configure how many ICMs are started
98. for each dispatcher. D
C) SAP recommends that you operate a separate ICM for each client in an SAP
system.
D) The ICM is a process which internally consists of multiple threads that is available
for all operating systems supported by SAP

It makes sense, in an SAP system, to configure several enqueue work processes on


different SAP Web Application Servers.
99. A)True B
B) False

What are the names of the significant components that make up the SAP J2EE
Engine?
A) Clusters and Work Process
100.B) Dispatchers and Work Processes B
C) Servers and ICM
D) None of the above
Subject Name & Paper Code A
N
UG-CS-323-Internet Programming using PHP S
1) PHP Stands for B
(A) Php Hypertext Processor

(B) Php Hypertext Preprocessor

(C) Php Hypermarkup Preprocessor

(D) Php Hypermarkup Processor

2) PHP scripts are executed on _________ C


(A) ISP Computer

(B) Client Computer

(C) Server Computer

(D) It depends on PHP scripts

3) Which of the following statements prints in PHP? C


(A) Out

(B) Write

(C) Echo

(D) Display

4) Which one of the following should not be used while sending passwords or other D
sensitive information?

(A) $BOTH

(B) $_BOTH

(C) $REQUEST

(D) $_REQUEST

5) Which one of the following is the default PHP session name? A


(A) PHPSESSID
(B) PHPSESID
(C) PHPSESSIONID
(D) PHPIDSESS

1 P.T.O.
6) The following function will convert a string to all uppercase? B
(A) uppercase()
(B) strtoupper()

(C) str_uppercase()
(D) struppercase()

7) How do you write "Hello World" in PHP A


(A) echo “Hello World”;

(B) “Hello World”;

(C) Document.Write(“Hello World”);

(D) None of these

8) PHP Scripts starts with ____ B


(A) <php> … </php>

(B) <?php …. ?>

(C) ?php … ?php

(D) <p> … </p>

9) In PHP a variable needs to be declare before assign B


(A) True

(B) False

(C) Depends on website

(D) Depends on server

10) In PHP, numerically indexed array begin with position C


(A) 1

(B) 2

(C) 0

(D) -1

2
11) Which of the following method use to upload the file to the current script? A
(A) $_GET

(B) $_POST

(C) $_REQUEST

(D) $_FILE

12) Which of the following can add a row to a table? B


(A) Add

(B) Insert

(C) Update

(D) Alter

13) What does the DESC keyword do in the following query? C


SELECT *
FROM EMP
WHERE EMPID > 1000
ORDER BY EMPID, NAME DESC

(A) It causes the dataset returned by the query to be sorted in descending order
(B) It causes the result set to include a description of the NAME field

(C) It causes rows with the same EMPID to be sorted by NAME in descending
order
(D) It causes rows to be sorted by NAME first and then by ID

14) The following function is used to start a session? B


(A) start_session()
(B) session_start()
(C) session_begin()
(D) begin_session()

15) Which directive determines how the session information will be stored? D
(A) save_data

(B) session.save
(C) session.save_data

(D) session.save_handler

3 P.T.O.
16) Which of the following is an exception? B
(A) OutBoundException

(B) OutOfRangeException

(C) OutOverflowException

(D) OutUnderflowException

17) Which one of the following keyword is used to implement an interface? D


(A) interface
(B) get
(C) inherit
(D) Implements

18) PHP makes it possible to automatically execute code when a new instance of a B
class is created using a special class method called as

(A) destructor
(B) constructor
(C) friend
(D) Initial

19) Given an employee table as follows B


emp_id emp_name

1 Ram

2 Sita

4 Tanu

what value will be return by below query ?

Select count(*) from employees

(A) 4

(B) 3

(C) 1

(D) none of the above

4
20) Which of the following method of Exception class returns source line? D
(A) getMessage()

(B) getCode()

(C) getFile()

(D) getLine()

21) Which of the following is used to get cookies? B


(A) getcookie() function

(B) $_COOKIE variable

(C) isset() function

(D) None of the above.

22) EGPCS means A


(A) Environment, GET, POST, Cookies, and Server
(B) Environment, GET, POST, Cookies, and Session
(C) NONE of these above
(D) Entity, GET, POST, Cookies, and Server

23) Which of the following function returns selected parts of an array? D


(A) array_reverse()

(B) array_search()

(C) array_shift()

(D) array_slice()

24) Which of the following magic constant of PHP returns full path and filename of B
the file?

(A) _LINE_

(B) _FILE_

(C) _FUNCTION_

(D) _CLASS_

5 P.T.O.
25) The data is visible to ____ when you use the $_GET variable to collect data C
(A) none

(B) only you

(C) everyone

(D) selected few

26) Which of the following is correct about PHP? D


(A) PHP is a recursive acronym for "PHP: Hypertext Pre-processor".

(B) PHP is a server side scripting language that is embedded in HTML.

(C) It is used to manage dynamic content, databases, session tracking, even


build entire e-commerce sites.

(D) All of the above.

27) When you want to store user data in a session use the ____array. A
(A) $_SESSION

(B) SYS_SESSION
(C) $SESSION

(D) $_SESSIONS

28) If $a = 12 what will be returned when ($a == 12) ? 5 : 1 is executed? D


(A) 12

(B) 1

(C) Error

(D) 5

29) Sticky forms are forms in which the results of a query are accompanied by a A
search from whose default values are those previous query.

(A) True

(B) False

6
30) Which of the functions is used to sort an array in descending order? C
(A) asort()

(B) sort()

(C) rsort()

(D) dsort()

31) Which of the following type of variables are instances of programmer defined C
classes?

(A) Strings

(B) Arrays

(C) objects

(D) Resources

32) How to define a function in PHP? D


(A) function {function body}

(B) data type functionName(parameters) {function body}

(C) functionName(parameters) {function body}

(D) function functionName(parameters) {function body}

33) Which statement is used to delete a table A


(A) DROP TABLE
(B) DELETE TABLE
(C) DEL TABLE
(D) REMOVE TABLE

7 P.T.O.
34) <?php A
$name = array("TANU", "CHUNNU", "MANU");

sort($name);

for($x = 0; $x < 3; $x++) {

echo $name[$x], " "; }

?>

(A) CHUNNU MANU TANU

(B) MANU TANU CHUNNU

(C) CHUNNU MANU TANU

(D) No output

35) How many items are available in the $_FILES array? D


(A) 2

(B) 3
(C) 4

(D) 5

36) Which of the following function creates an array? A


(A) array()

(B) array_change_key_case()

(C) array_chunk()

(D) array_count_values()

37) Which function is used to determine whether a file was uploaded? B


(A) is_file_uploaded()

(B) is_uploaded_file()
(C) file_uploaded(“filename”)

(D) uploaded_file(“filename”)

38) Which of the function is used to sort an array in ascending order? A


(A) sort()
(B) asort()
(C) arsort()
(D) dsort()

8
39) In PHP, each statement must be end with ______ B
(A) . (dot)

(B) ; (semicolon)

(C) / (slash)

(D) : (colon)

40) Which of the following provides access to the uploaded file in the temporary A
directory on the web server?

(A) $_FILES['file']['tmp_name']

(B) $_FILES['file']['name']

(C) $_FILES['file']['size']

(D) $_FILES['file']['type']

41) PHP files have a default file extension of C


(A) .html

(B) .xml

(C) .php

(D) .ph

42) Cookies were originally designed for B


(A) Client-side programming
(B) Server-side programming
(C) both 1 and 2
(D) socket programming

43) Which of the following magic constant of PHP returns class name? D
(A) _LINE_

(B) _FILE_

(C) _FUNCTION_

(D) _CLASS_

9 P.T.O.
44) Which variable is used to collect form data sent with both the GET and POST D
methods?

(A) BOTH

(B) $_BOTH

(C) $REQUEST

(D) $_REQUEST

45) PHP is _______ scripting language. A


(A) Server-side

(B) Client-side

(C) Middle-side

(D) Out-side

46) In PHP in order to access MySQL database you will use: C


(A) mysqlconnect() function
(B) mysql-connect() function
(C) mysql_connect() function
(D) sql_connect() function

47) Can joins be nested? A


(A) True
(B) False

48) In PHP Language variables name starts with _____ D


(A) ! (Exclamation)

(B) & (Ampersand)

(C) * (Asterisk)

(D) $ (Dollar)

49) Which of the following method connect a MySql database using PHP? A
(A) mysql_connect()

(B) mysql_query()

(C) mysql_close()

(D) None of the above

10
50) PHP is a case sensitive A
(A) True

(B) False

51) Which of the below symbols is a newline character? B


(A) \r

(B) \n

(C) /n

(D) /r

52) Child classes are defined using the keyword C


(A) extends
(B) extents
(C) child_class
(D) extend_class

53) In a SELECT with a GROUP BY clause, a WHERE clause, and a HAVING A


clause, the WHERE conditions are applied before the HAVING conditions.

(A) True

(B) Fasle

(C) Either True or False

(D) None of the above

54) Which of the following is not the scope of Variable in PHP? D


(A) Local

(B) Global

(C) Static

(D) Extern

55) Which of the following is not an SQL aggregate function? C


(A) AVG
(B) SUM
(C) MUL

(D) MIN

11 P.T.O.
56) Which of the following statements invoke the exception class? B
(A) throws new Exception();
(B) throw new Exception();
(C) new Exception();
(D) new throws Exception();

57) Which of the variable scope is not supported by PHP C


(A) Local variables

(B) Function parameters


(C) Hidden variables

(D) Global variables

58) In PHP Language variables are case sensitive A


(A) True

(B) False

(C) Depends on website

(D) Depends on server

59) The father of PHP is C


(A) Drek Kolkevi
(B) List Barely
(C) Rasmus Lerdorf
(D) Denis Ritche

60) Which functions in PHP is used to get the length of string variable? C
(A) Count()

(B) strcount

(C) strlens

(D) len

61) The practice of separating the user from the true inner workings of an application C
through well-known interfaces is known as _________
(A) Polymorphism
(B) Inheritance
(C) Encapsulation
(D) Abstraction

12
62) The practice of creating objects based on predefined classes is often referred to D
as
(A) class creation
(B) object creation
(C) object instantiation
(D) class instantiation

63) Which one of the following property scopes is not supported by PHP? A
(A) friendly
(B) final
(C) public
(D) static

64) Which one of the following is the right way to invoke a method?
(A) $object->methodName();
(B) object->methodName();
(C) object::methodName();
(D) $object::methodName();

65) Which of the following advanced OOP features is/are not supported by PHP? C
i) Method overloading

ii) Multiple Inheritance

iii) Namespaces

iv) Object Cloning

(A) i)

(B) ii)

(C) i) and ii)

(D) iii) and iv)

66) If your object must inherit behaviour from a number of sources you must use a/an A
(A) Interface
(B) Object
(C) Abstract class
(D) Static class

67) You can the exception base class, but you cannot override any of the preceding B
methods because the are declared as
(A) protected
(B) final
(C) static
(D) private

13 P.T.O.
68) Which one of the following databases has PHP supported almost since the D
beginning?

(A)Oracle Database

(B)SQL

(C)SQL+

(D)MySQL

69) Which one of the following statements is used to create a table? A


(A)CREATE TABLE table_name (column_name column_type);

(B)CREATE table_name (column_type column_name);

(C)REATE table_name (column_name column_type);

(D)CREATE TABLE table_name (column_type column_name);

70) Which one of the following methods can be used to diagnose and display C
information about a MySQL connection error?

(A) connect_errno()

(B) connect_error()

(C) mysqli_connect_errno()

(D) mysqli_connect_error()

71) Which one of the following methods is responsible for sending the query to the A
database?

(A) query()

(B) send_query()

(C) sendquery()

(D) query_send()

72) Which of the methods are used to manage result sets using both associative and C
indexed arrays?

(A) get_array() and get_row()

(B) get_array() and get_column()

(C) fetch_array() and fetch_row()

(D) fetch_array() and fetch_column()

14
73) Which one of the following method is used to retrieve the number of rows affected B
by an INSERT, UPDATE, or DELETE query?

(A) num_rows()

(B) affected_rows()

(C) changed_rows()

(D) new_rows()

74) Which of the following is not true? D


(A) PHP can be used to develop web applications.

(B) PHP makes a website dynamic

(C) PHP applications cannot be compile

(D) PHP cannot be embedded into html.

75) Which of the following statements is/are true about Constructors in PHP? C
i) PHP 4 introduced class constructors.

ii) Constructors can accept parameters.

iii) Constructors can call class methods or other functions iv) Class constructors
can call on other constructors.

(A) (ii) and (iii)

(B) (ii), (iii) and (iv)

(C) All of the mentioned

(D) None of the mentioned

76) PHP is a ____ typed language A


(A) Loosely

(B) Tightly

(C) client

(D) server

15 P.T.O.
77) PHP recognizes constructors by the name. D
(A) classname()

(B) _construct()

(C) function _construct()

(D) function _construct()

78) ___ is concatination operator in PHP. B


(A) +

(B) .

(C) ^

(D) _

79) In PHP compare two string which of the following function can you use? D
(A) strcmp()

(B) strcasecmp()

(C) none of these

(D) both 1 and 2

80) Arrays are D


(A) Numeric

(B) Associative

(C) Multidimensional

(D) Both 1 ,2 and 3

81) Which array function checks if the specified key exists in the array B
(A) array_key_exist()

(B) array_key_exists()

(C) array_keys_exists()

(D) arrays_key_exists()

16
82) Which of the following is/are a PHP code editor? B
1. Notepad

2. Notepad++

3. Adobe Dreamweaver

4. PDT

(A) Only 4

(B) All of the mentioned

(C) 1, 2 and 3

(D) Only 3

83) Which of the following PHP functions can be used for generating unique ids? A
A)uniqueid()

B)id()

C)md5()

D)mdid()

84) What will be the output of the following PHP code ? C


<?php

"Hello World"

?>

(A) Error

(B) Hello World

(C) Nothing

(D) Missing semicolon error

17 P.T.O.
85) What will the following script output? A

<?php

$array = array (1, 2, 3, 5, 8, 13, 21, 34, 55);

$sum = 0;

for ($i = 0; $i < 5; $i++) {

$sum += $array[$array[$i]];

echo $sum;

?>

(A) 78

(B) 19

(C) NULL

(D) 5

86) <?php A
# echo "Hello world";

echo "# Hello world";

?>

(A) # Hello world

(B) Hello world# Hello world

(C) Hello world

(D) Error

87) In PHP a variable needs to be declare before assign B


(A) True

(B) False

(C) Depends on website

(D) Depends on server

18
88) Which of the following type of variables are whole numbers, without a decimal A
point, like 4195?

(A) Integers

(B) Doubles

(C) Booleans

(D) Strings

89) ____ is used to unset a variable in PHP? B


(A) delete()

(B) unset()

(C) unlink()

(D) delete();

90) All php classes come with a default constructor that takes ____ arguments. D
(A) one

(B) two

(C) three

(D) no

91) DML stands for B


(A) Data Method Language

(B) Data Manipulation Language

(C) none

(D) Data Methods Language

92) Which one of the following function finds the last occurrence of a string returning D
its numerical position?

(A) strlastpos()

(B) strpos()

(C) strlast()

(D) strrpos()

19 P.T.O.
93) String values must be enclosed in.............. C
(A) single quotes

(B) double quotes

(C) both 1 and 2

(D) none

94) Which of the following variables is not a predefined variable? B


(A) $get

(B) $ask

(C) $request

(D) $post

95) What will be the output of the following PHP code? B


<?php

$num = 1;

$num1 = 2;

print $num . "+". $num1;

?>

(A) 3
(B) 1+2
(C) 1.+.2
(D) Erro

96) Class member variables are also called? D


(A) Properties

(B) Fields

(C) Attributes

(D) All of the above

20
97) Which of the following is invalid PHP code? C
(A) $_20

(B) &$myVar

(C) $20_var

(D) ${"var"}

98) In terms of keywords and language syntax, PHP is similar to? A


(A) C

(B) COBOL

(C) FORTRAN

(D) .Net

99) Which of the following is the output of the below code? C


<?php

var_dump(strpos("Hello letsfindcourse!", "course"));

?>

(A) int(13)

(B) char(14)

(C) int(14)

(D) int(15)

100) Which of the following is not an exception? A


(A) OutOfBoundryException

(B) OutOfRangeException

(C) OverflowException

(D) UnderflowException

**********

21 P.T.O.
Subject Name- Internet Programming using PHP A
& N
Paper Code- UG-CS-323 S
1 What does PHP stand for? d
i) Personal Home Page
ii) Hypertext Preprocessor
iii) Pretext Hypertext Processor
iv) Preprocessor Home Page
a) Both i) and iii)
b) Both ii) and iv)
c) Only ii)
d) Both i) and ii)
2 PHP files have a default file extension of_______ c
a) .html
b) .xml
c) .php
d) .ph
3 What should be the correct syntax to write a PHP code? c
a) < php >
b) < ? php ?>
c) <? ?>
d) <?php ?>
4 Which version of PHP introduced Try/catch Exception? d
a) PHP 4
b) PHP 5
c) PHP 6
d) PHP 5 and later
5 How should we add a single line comment in our PHP code? c
i) /?
ii) //
iii) #
iv) /* */
a) Only ii)
b) i), iii) and iv)
c) ii), iii) and iv)
d) Both ii) and iv)
6 Which of the following PHP statement/statements will store 111 in variable num? c
i) int $num = 111;
ii) int mum = 111;
iii) $num = 111;
iv) 111 = $num;
a) Both i) and ii)
b) i), ii), iii) and iv)
c) Only iii)
d) Only i)
7 What will be the output of the following PHP code? b
<?php
$num = 1;
$num1 = 2;
print $num . "+". $num1;
?>
a) 3
b) 1+2
c) 1.+.2
d) Error
8 Which is the right way of declaring a variable in PHP? d
i) $3hello
ii) $_hello
iii) $this
iv) $This
a) Only ii)
b) Only iii)
c) ii), iii) and iv)
d) ii) and iv)
9 What will be the output of the following PHP code? c
<?php
$foo = 'Bob';
$bar = &$foo;
$bar = "My name is $bar";
echo $bar;
echo $foo;
?>
a) Error
b) My name is BobBob
c) My name is BobMy name is Bob
d) My name is Bob Bob
10 What will be the output of the following PHP code? c
<?php
$total = "25 students";
$more = 10;
$total = $total + $more;
echo "$total";
?>
a) Error
b) 35 students
c) 35
d) 25 students
11 Which statement will output $x on the screen? a
\

12 What will be the output of the following PHP code? d


<?php
$a = "clue";
$a .= "get";
echo "$a";
?>
a) get
b) true
c) false
d) clueget
13 Which type of function call is used in line 8 in the following PHP code? a
<?php
function calc($price, $tax)
{
$total = $price + $tax;
}
$pricetag = 15;
$taxtag = 3;
calc($pricetag, $taxtag);
?>
a) Call By Value
b) Call By Reference
c) Default Argument Value
d) Type Hinting
14 What will be the output of the following PHP code? c
<?php
function calc($price, $tax="")
{
$total = $price + ($price * $tax);
echo "$total";
}
calc(42);
?>
a) Error
b) 0
c) 42
d) 84
15 Which of the following are valid function names? b
i) function()

iii) .function()
iv) $function()
a) Only i)
b) Only ii)
c) i) and ii)
d) iii) and iv)
16 What will be the output of the following PHP code? c
<?php
function a()
{
function b()
{
echo 'I am b';
}
echo 'I am a';
}
b();
a();
?>
a) I am b
b) I am bI am a
c) Error
d) I am a Error
17 Which one of the following PHP functions can be used to find files? d
a) glob()
b) file()
c) fold()
d) get_file()
18 Which one of the following functions can be used to compress a string? d
a) zip_compress()
b) zip()
c) compress()
d) gzcompress()
19 What will be the output of the following PHP code? d
<?php
echo chr(52);
?>
a) 1
b) 2
c) 3
d) 4
20 ___________ c
a) 1
b) 2
c) 0
d) -1
21 Which of the following are correct ways of creating an array? a
i) state[0] = "karnataka";
ii) $state[] = array("karnataka");
iii) $state[0] = "karnataka";
iv) $state = array("karnataka");
a) iii) and iv)
b) ii) and iii)
c) Only i)
d) ii), iii) and iv)
22 What will be the output of the following PHP code? d
<?php
$fruits = array ("apple", "orange", array ("pear", "mango"),
"banana");
echo (count($fruits, 1));
?>
a) 3
b) 4
c) 5
d) 6
23 The practice of separating the user from the true inner workings of an application c
through well-known interfaces is known as _________
a) Polymorphism
b) Inheritance
c) Encapsulation
d) Abstraction
24 Which of the following term originates from the Greek language that means b

characteristics?
a) Abstraction
b) Polymorphism
c) Inheritance
d) Differentia
25 The practice of creating objects based on predefined classes is often referred to d
as ______________
a) class creation
b) object creation
c) object instantiation
d) class instantiation
26 Which one of the following property scopes is not supported by PHP? a
a) friendly
b) final
c) public
d) static
27 Which one of the following is the right way to define a constant? d

28 Which version of PHP was added with Exception handling? b


a) PHP 4
b) PHP 5
c) PHP 5.3
d) PHP 6
29 How many methods are available for the exception class? c
a) 5
b) 6
c) 7
d) 8
30 Which version added the method getPrevious()? d
a) PHP 4
b) PHP 5
c) PHP 5.1
d) PHP 5.3
31 Which of the following statements invoke the exception class? b
a) throws new Exception();
b) throw new Exception();
c) new Exception();
d) new throws Exception();
32 You can extend the exception base class, but you cannot override any of the b
preceding methods because the are declared as__________
a) protected
b) final
c) static
d) private
33 You can extend the exception base class, but you cannot override any of the a
preceding methods because the are declared as__________
a) protected
b) final
c) static
d) private
34 Which two predefined variables are used to retrieve information from forms? b
a) $GET & $SET
b) $_GET & $_SET
c) $__GET & $__SET
d) GET & SET
35 The attack which involves the insertion of malicious code into a page frequented c
by other users is known as _______________
a) basic sql injection
b) advanced sql injection
c) cross-site scripting
d) scripting
36 When you use the $_GET variable to collect data, the data is visible to c
___________
a) none
b) only you
c) everyone
d) selected few
37 Which one of the following should not be used while sending passwords or other a
sensitive information?
a) GET
b) POST
c) REQUEST
d) NEXT
38 Which function is used to remove all HTML tags from a string passed to a form? b
a) remove_tags()
b) strip_tags()
c) tags_strip()
d) tags_remove()
39 To validate an email address, which flag is to be passed to the function a
filter_var()?
a) FILTER_VALIDATE_EMAIL
b) FILTER_VALIDATE_MAIL
c) VALIDATE_EMAIL
d) VALIDATE_MAIL
40 Which one of the following is the very first task executed by a session enabled c
page?
a) Delete the previous session
b) Start a new session
c) Check whether a valid session exists
d) Handle the session
41 How many ways can a session data be stored? b
a) 3
b) 4
c) 5
d) 6
42 Which directive determines how the session information will be stored? d
a) save_data
b) session.save
c) session.save_data
d) session.save_handler
43 If session.use_cookie is set to 0, this results in use of _____________ c
a) Session
b) Cookie
c) URL rewriting
d) Nothing happens
44 Which one of the following is the default PHP session name? a
a) PHPSESSID
b) PHPSESID
c) PHPSESSIONID
d) PHPIDSESS
45 Which one of the following function is used to start a session? b
a) start_session()
b) session_start()
c) session_begin()
d) begin_session()
46 Which one of the following databases has PHP supported almost since the d
beginning?
a) Oracle Database
b) SQL
c) SQL+
d) MySQL
47 The updated MySQL extension released with PHP 5 is typically referred to as c
_______________
a) MySQL
b) mysql
c) mysqli
d) mysqly
48 Which one of the following statements is used to create a table? a
a) CREATE TABLE table_name (column_name column_type);
b) CREATE table_name (column_type column_name);
c) CREATE table_name (column_name column_type);
d) CREATE TABLE table_name (column_type column_name);
49 Which one of the following statements can be used to select the database? d
a) $mysqli=select_db('databasename');
b) mysqli=select_db('databasename');
c) mysqli->select_db('databasename');
d) $mysqli->select_db('databasename');
50 Which one of the following methods can be used to diagnose and display c
information about a MySQL connection error?
a) connect_errno()
b) connect_error()
c) mysqli_connect_errno()
d) mysqli_connect_error()
51 What will be the output of the following PHP code? a
<?php
$x;
if ($x)
print "hi" ;
else
print "how are u";
?>
a) how are u
b) hi
c) error
d) no output
52 What will be the output of the following PHP code? b
<?php
$a = "2";
switch ($a)
{
case 1:
print "hi";
case 2:
print "hello";
break;
default:
print "hi1";
}
?>
a) hihellohi1
b) hello
c) hihi1
d) hi1
53 What will be the output of the following PHP code? b
<?php
do
{
print "hi";
}
while(0);
print "hello";
?>
a) infinite loop
b) hihello
c) hello
d) error
54 What will be the output of the following PHP code? a
<?php
$colors = array("red","green","blue","yellow");
foreach ($colors as $value)
{
echo "$value <br>";
}
?>
a) red green blue yellow
b) red
c) no output
d) error
55 What will be the output of the following PHP code? c
<?php
function calc($price, $tax="")
{
$total = $price + ($price * $tax);
echo "$total";
}
calc(42);
?>
a) Error
b) 0
c) 42
d) 84
56 What will be the output of the following PHP code? d
<?php
define("GREETING", "PHP is a scripting language", true);
echo GREETING;
echo "<br>"
echo GREETING;
?>
a) PHP is a scripting language
b) GREETING GREEtING
c) GREETING
d) PHP is a scripting language PHP is a scripting language
57 What will be the output of the following PHP code? d
<?php
one = 1;
two = 2;
three = 3;
four = 4;
echo "one / two + three / four";
?>
a) 0.75
b) 0.05
c) 1.25
d) Error
58 Once your application can generate administrative links, you need to load those c
links into _________
a) php.ini
b) index.ini
c) index.php
d) start.php
59 The (|/) tells the server to match ___________ d
a) nothing
b) forward slash
c) backward slash
d) either nothing or a forward slash
60 When a user confirms that he wishes to delete an c
passed to a function which removes the entry from the __________
a) index.php
b) function.inc.php
c) database
d) admin.php

You might also like