0% found this document useful (0 votes)
4 views

WebDevelopmentusingPHP 3

Uploaded by

skr.04088s
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

WebDevelopmentusingPHP 3

Uploaded by

skr.04088s
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Exam Paper Code - 6974

Tata Institute of Social Sciences


School of Vocational Education

Programme Name: B. Voc. In Software Development Sem 3 Exam : Main

Course Title : Web Development using PHP Course Code : BVOC-SD 5.1

Exam Date : 28/2/23 Venue : TISS SVE HUB

Time : 10 am to 1 pm Session : Main

Total Marks : 100 Duration : 3 Hours

Instructions: Write concise, to the point answers. Longer is not always better. Rambling answers that do not convey
understanding of the subject will be penalized by lower marks. As far as possible, bullet point your answers. Please
write neatly, someone will have to read your handwriting. Clearly mark question numbers so the evaluator knows
which question you are answering.

Q1. Multiple Choice Questions : How would you store order number (34) in an ‘OrderCookie’? 1 Marks

1) setcookie(‘OrderCookie’,34); 2) makeCookie(‘OrderCookie’,34); 3) Cookie(‘OrderCookie’,34); 4)


OrderCookie(34);

Q2. Multiple Choice Questions : Trace the function that does continue the script execution even if 1 Marks
the file inclusion fails
1) include() 2) require() 3) both of above 4) None of above

Q3. Multiple Choice Questions : Which of the following will not combine strings $s1 and $s2 into a 1 Marks
single string?
1) $s1 + $s2 2) “{$s1}{$s2}” 3) $s1.$s2 4) implode(‘ ‘, array($s1,$s2))

Q4. Multiple Choice Questions : Which of the following statement produce different output 1 Marks

1) <?echo "This is php example"; ?> 2) <P="This is php example"; ?> 3) <?PHP echo "This is php example";
php?> 4) <script language="php"> print "This is php example";</script>

Q5. Multiple Choice Questions : Which datatypes are treaded as arrays 1 Marks

1) Integer 2) Float 3) String 4) Booleans

Q6. Multiple Choice Questions : Which of the following can add a row to a table 1 Marks

1) Add 2) Insert 3) Update 4) Alter


1/5 Exam Paper Code - 6974
Q7. Multiple Choice Questions : Which SQL statement is used to insert a new data in a database 1 Marks

1) INSERT INTO 2) UPDATE 3) ADD 4) INSERT NEW

Q8. Multiple Choice Questions : Which of the following array represents an array containing one or 1 Marks
more arrays
1) Numeric Array 2) Associative Array 3) Multidimentional Array 4) None of the above

Q9. Multiple Choice Questions : Which of the following method can be used to parse an XML 1 Marks
document using PHP
1) simplexml_load_string() 2) loadxml() 3) Both of the above. 4) None of the above.

Q10. Multiple Choice Questions : Which of the following function returns the sum of the values in 1 Marks
an array
1) array_sum() 2) array_splice() 3) array_udiff() 4) array_udiff_assoc()

Q11. Multiple Choice Questions : Which of the following is used to check that a cookie is set or not 1 Marks

1) getcookie() function 2) $_COOKIE variable 3) isset() function 4) None of the above

Q12. Multiple Choice Questions : Which of these characters can be processed by the 1 Marks
htmlspecialchars() function?
1) ' - single quote 2) '' - double quote 3) < - less than 4) All

Q13. Multiple Choice Questions : Which statement about the code below is correct? class A {} class 1 Marks
B {} class C extends A, B {}
1) the code is perfectly fine 2) classes can not be empty 3) class C can not extend both A and B 4) qualifiers
'public' or 'private' are missing in
class definitions
Q14. Multiple Choice Questions : What is the out put? 1 Marks
<?php
$color=array("red","yellow","white");
$x=in_array("black",$color);
if($x==0)
echo "good bye";
if($x==1) echo "Hello";
?>

1) Hello 2) Error 3) good bye 4) None of the above

Q15. Identify True or False. If False write correct statement. : Whether One-line comment begin with 1 Marks
pound sing(#) in php
1) TRUE 2) FALSE 3) None of above
2/5 Exam Paper Code - 6974
Q16. Multiple Choice Questions : Which character do the error_reporting directive use to represent 1 Marks
the logical operator NOT?
1) / 2) ! 3) ~ 4) ^

Q17. Multiple Choice Questions : The practice of creating objects based on predefined classes is 1 Marks
often referred to as
1) class creation 2) object creation 3) object instantiation 4) class instantiation

Q18. Multiple Choice Questions : Which of the following is/are the right way to declare a method? i) 1 Marks
function functionName() { function body } ii) scope function functionName() { function body
} iii) method methodName() { method body } iv) scope method methodName() { method body
} ii) 2) Only iv) 3) i) and ii) 4) iii) and iv)
1) Only

Q19. Multiple Choice Questions : Question : which of the following pair have non-associative equal 2 Marks
precedence?
1) +,- 2) ==, != 3) &=, |= 4) All of these

Q20. Multiple Choice Questions : Multiple select/load is possible with: 2 Marks

1) Checkbox 2) Select 3) File 4) All of the above

Q21. Multiple Choice Questions : What will be the output of following code? $a = 10; echo ‘Value 2 Marks
of a = $a’;
1) Value of a = 10 2) Value of a = $a 3) Undefined 4) Syntax Error
5) None of the
above
Q22. Multiple Choice Questions : Which of the following is a PHP resource? 2 Marks

1) Domxml document 2) Odbc link 3) File 4) All of the above

Q23. Multiple Choice Questions : $str=”3dollars”; $a=20; $a+=$str; print($a); ?> Output ? 2 Marks

1) 23dollars 2) 203dollars 3) 320dollars 4) 23

Q24. Identify True or False. If False write correct statement. : PHP runs on different platforms 2 Marks
(Windows, Linux, Unix, etc.)
1) TRUE 2) FALSE

Q25. Multiple Choice Questions : What is the difference between stat() and fstat()? 2 Marks

1) While stat() works on open file pointers, fstat() works on


files specified by pathname 2) While fstat() works on open file pointers,
stat() works on files specified by
pathname 3) fstat() has nothing to do with files 4) stat() has nothing to do with files
3/5 Exam Paper Code - 6974
Q26. Give One Word or Phrase : Assuming that image.jpg exists and is readable by PHP, how will 2 Marks
the following script be displayed if called directly from a browser?
1) As a JPEG image 2) As a binary file for display within the
browser 3) As a binary file for download 4) As a JPEG file for download
5) As a broken
image
Q27. Multiple Choice Questions : fopen($file_doc,”r+&rdquo) opens a file for 2 Marks

1) reading 2) writing 3) none of above 4) both of above

Q28. Multiple Choice Questions : Which of the following delimiter syntax is PHP's default delimiter 2 Marks
syntax
1) <? php ?> 2) <% %> 3) <? ?> 4) <script language="php"> </script>

Q29. Multiple Choice Questions : Which of the following delimiter is ASP style? 2 Marks

1) <> 2) <% %> 3) <? ?> 4) <script language="php"> </script>

Q30. Multiple Choice Questions : Which of following function return 1 when output is successful? 2 Marks

1) echo ( ) 2) print ( ) 3) both 4) None

Q31. Multiple Choice Questions : If a boolean variable $ alive= 5; 2 Marks

1) $ alive is false 2) $ alive is true 3) $ alive is overflow 4) the statement is snot valid

Q32. Identify True or False. If False write correct statement. : In a SELECT with a GROUP BY 2 Marks
clause, a WHERE clause, and a HAVING clause, the WHERE conditions are applied before
the HAVING conditions
1) TRUE 2) FALSE

Q33. Multiple Choice Questions : Choose valid PHP5 data type. 2 Marks

1) money 2) varchar 3) float 4) char


5) complex

Q34. Multiple Choice Questions : Which of the following is NOT a magic predefined constant? 2 Marks

1) __LINE__ 2) __FILE__ 3) __DATE__ 4) __CLASS__


5) __METHOD__

Q35. Identify True or False. If False write correct statement. : What will be printed? if ('2' == '02') { 2 Marks
echo 'true'; } else { echo 'false'; }
1) TRUE 2) FALSE
4/5 Exam Paper Code - 6974
Q36. Multiple Choice Questions : What will be printed? $a = array( null => 'a', true => 'b', false => 2 Marks
'c', 0 => 'd', 1 => 'e', '' => 'f'); echo count($a), "\n";
1) 2 2) 3 3) 4 4) 5
5) 6

Q37. Multiple Choice Questions : What gets printed? 2 Marks

1) ab(newline) 2) a\b(newline) 3) a\b\n 4) a\\b(newline)


5) a\\b\n

Q38. Multiple Choice Questions : What will be the output: 2 Marks

1) 43 2) 1 3) 8 4) 6

Q39. Multiple Choice Questions : what will the ouptut of below date() function ? 2 Marks

1) 2009-5-19:14:31:38 2) 2009-5-19:2:31:38 3) 19-5-2009:2:31:38 4) 19/5/2009:14:31:38

Answer any 8 out of 10

Q40) Explain : How is it possible to know the number of rows returned in a result set when using 5 Marks
MsSql with PHP?
Q41) Explain : How do I check if a given variable is empty or not? 5 Marks
Q42) Explain : Is it possible to remove the HTML tags from data? 5 Marks
Q43) Explain : How can we define a variable accessible in functions of a PHP script? 5 Marks
Q44) Explain : How can we get the error when there is a problem in uploading a file? 5 Marks
Q45) Explain : What does $_COOKIE means? 5 Marks
Q46) Explain : How session works and are handle in php 5 Marks
Q47) Explain : The importance of the function htmlentities. 5 Marks
Q48) Explain : What is the use of "ksort" in php? 5 Marks
Q49) Explain : How we can retrieve the data in the result set of MySQL using PHP? 5 Marks

You might also like