0% found this document useful (0 votes)
25 views6 pages

IT3505 - 2020 - Part 1

Uploaded by

s22000634
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views6 pages

IT3505 - 2020 - Part 1

Uploaded by

s22000634
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

UNIVERSITY OF COLOMBO, SRI LANKA

UNIVERSITY OF COLOMBO SCHOOL OF COMPUTING

DEGREE OF BACHELOR OF INFORMATION TECHNOLOGY ( EXTERNAL)


Academic Year 2020 – 2nd Year Examination – Semester 3

IT3505 – Web Application Development II


Part 1 - Multiple Choice Question Paper
(ONE HOUR)

Important Instructions :
 The duration of the paper is 1 (one) hour.
 The medium of instruction and questions is English.
 The paper has 20 questions and 6 pages.
 All questions are of the MCQ (Multiple Choice Questions) type.
 All questions should be answered.
 Each question will have 5 (five) choices with one or more correct answers.
 All questions will carry equal marks.
 There will be a penalty for incorrect responses to discourage guessing.
 The mark given for a question will vary from 0 (All the incorrect choices are marked
& no correct choices are marked) to +1 (All the correct choices are marked & no
incorrect choices are marked).
 Answers should be marked on the special answer sheet provided.
 Note that questions appear on both sides of the paper.
If a page is not printed, please inform the supervisor immediately.
 Mark the correct choices on the question paper first and then transfer them to the
given answer sheet which will be machine marked. Please completely read and
follow the instructions given on the other side of the answer sheet before
you shade your correct choices.
 Calculators are not allowed.
 All Rights Reserved.

1
1) Select the correct HTML script(s) which will give the list output given below.
1. Amal
2. Nimal
3. Sunil

(a) <dl><li;1>Amal</li><li;2> Nimal </li><li;3> Sunil </li></dl>


(b) <tr><td> Amal </td><td> Nimal </td><td> Sunil </td></tr>
(c) <ul><li> Amal </li><li> Nimal </li><li> Sunil </li></ul>
(d) <ol><li> Amal </li><li> Nimal </li><li> Sunil </li></ol>
(e) <nl><li> Amal </li><li> Nimal </li><li> Sunil </li></nl>

2) What is/are the correct HTML script(s) for inserting an image with height and width of 42 pixels?

(a) <img href="img.gif height="42" width="42">


(b) <img src="img.gif" height="42" width="42">
(c) <img height="42" width="42"> img.gif</img>
(d) <image href="img.gif height="42" width="42">
(e) <image src="img.gif" height="42" width="42"> <image/>

3) Which of the following tags can be used to make a text bold in HTML?

(a) <b> (b) <fat> (c) <strong>


(d) <black> (e) <emp>

4) Which of the following is/are a single global function(s) defined in the jQuery library?

(a) $() (b) global( (c) jQuery()


(d) query() (e) setInterval()

5) Which of the following is/are (a) heavily overloaded function(s) in jQuery?

(a) $() (b) global( (c) $()


(d) query() (e) setInterval() q

6) Which of the following statement(s) is/are true about software frameworks?


i. The abstract methods defined by the framework classes can be overridden in the application
ii. The software framework defines the control flow of the application.
iii. Software frameworks are also known as software libraries.

(a) Only i (b) Only ii (c) Only i and ii


(d) Only i and iii (e) i , ii and iii

2
7) Which of the following symbol can be used to comment in JavaScripts?
(a) \\ (b) //
(c) \**\ (d) \**/
(e) /**/

8) Which of the following Java Script can be used to retrieve the set of all div elements in a document?
(a) var divs = $(div);
(b) var divs = $("div");
(c) var divs = #("div");
(d) var divs = jQuery("div");
(e) var divs = jQuery£("div");

9) Which of the following statement(s) is/are true regarding JavaScript?

(a) JavaScript is a loosely typed language


(b) JavaScript variables are case sensitive.
(c) JavaScript can contain multi-line comments.
(d) JavaScript is a server-side scripting language.
(e) JavaScript is a client-side scripting language.

10) What is the output of the following JavaScript?


<script language="JavaScript" type="text/JavaScript">
<!--
top:
for (x=8; x>6; x--) {
for (y=2; y<5; y++) {
for (z=3 ;z<8;z++){
document.write(y);
document.write(z);
if (z==5) break top;
}
}
}
-->
</script>

3
(a) 123123 (b) 232425 (c) 323335
(d) 827364 (e) Error

11) What is/are the output(s) of the following JavaScript?


<script language="JavaScript" type="text/JavaScript">
<!--
var x=55+"6";
document.write(x);
-->
</script>

(a) x (b) 5 (c) 61


(d) 55+6 (e) 556

12) Which of the following statement(s) is/are true about the embedding PHP scripts inside an HTML
document.

(a) PHP scripts must always be written inside <?php and ?> tags.
(b) PHP scripts can be imported from an external file using the include statement.
(c) PHP scripts can be included only in the header section of an HTML document.
(d) Some PHP scripts will be executed properly even without the closing PHP tag (?>)
(e) PHP scripts must always be included in the body section of an HTML document

Answer questions 13 to 16 by considering the following PHP script.


<html>
<body>
<?php
$a=40;
while($a<=45)
{
for ($b=3; $b<=6; $b++)
{
$c=$a%$b;
if ($c==5)
{
$d=$a*$b;
}
}
$a++;
}
echo $a." ".$b." ".$c." ".$d;
?>
</body>
</html>

4
13) What is the value of $a?
(a) 3 (b) 7 (c) 24
(d) 46 (e) 246

14) What is the value of $b?


(a) 3 (b) 7 (c) 3
(d) 46 (e) 246

15) What is the value of $c?


(a) 3 (b) 7 (c) 3
(d) 46 (e) 246

16) What is the value of $d?


(a) 3 (b) 7 (c) 3
(d) 46 (e) 246

17) Which of the following PHP function definitions is/are syntactically correct?
a. b.
function fn(){ function fn(){
echo "hello"; echo $xyz;
} }
c. d.
function fn($xyz){echo function
$xyz;} fn($xyz,abc){
echo $xy;
}
e.
void function
fn($xyz,$_xyz){
echo $xyz,$_xyz;
}

18) Which of the following is/are correct ways of creating an array in PHP?

(a) country[0] = "Sri Lanka";


(b) $country [] = array("Sri Lanka ");
(c) $country [0] = " Sri Lanka ";
(d) $country = array("Sri Lanka");
(e) Array $country= "Sri Lanka";

5
19) What is the output of the following PHP code?

<?php
$countries = array("Sri Lanka" => array
("population" => "21,05,000", "capital" =>
"Colombo"),
"India" => array("population" => "13,53,000,000",
"capital" => "Mumbai"));

echo $countries["Sri Lanka"]["population"];


?>

(a) Sri Lanka 21,05,000 (b) 21,05,000 (c) Sri Lanka


(d) Sri Lanka population (e) population 21,05,000

20) Which type of function call is/are used in the following PHP script?

<?php
function calcPrice($price, $tax)
{
$total = $price + $tax;
}
$pricetag = 15;
$taxtag = 3;

calcPrice($pricetag, $taxtag);

echo $pricetag;
?>

(a) Type Hinting (b) Call By Value (c) Call By Reference


(d) Call By Default Value (e) Default Argument Value

*************************

You might also like