You are on page 1of 11

[ U n i v e r s i t i

M al ays i a
P A H A N G
Engineering Technology Creativity
FACULTY OF COMPUTER SYSTEMS & SOFTWARE ENGINEERING
FINAL EXAMINATION
COURSE: WEB SCRIPTING
COURSE CODE: BCS2303
LECTURER: QIN HONGWU
LIEW SIAU CHUIN
DATE 21 JUNE 2013
DURATION: 3 HOURS
SESSION/SEMESTER : SESSION 2012/2013 SEMESTER II
PROGRAMME CODE : BCS/BCG/BCN
INSTRUCTIONS TO CANDIDATE:
I.This question paper consists of TWO (2) Sections: Sections A and B. Answer ALL
questions.
2. Write your answers in the answer booklet provided.
3. Answer EACH question from Section B on a new page.
4. All calculations and assumptions must be clearly shown.
EXAMINATION REQUIREMENTS:
DO NOT TURN THIS PAGE UNTIL YOU ARE TOLD TO DO SO
This examination paper consists of ELEVEN (11) printed pages including the front page
CONFIDENTIALBCS/BCG/BCN/121311/BCS2303
SECTION A: Multiple Choice Questions[20 Marks]
This section consists of 15 questions where each question of questions 1-10 is equivalent to 1 mark, each
question of questions 11-15 is equivalent to 2 marks.
1. The browser launches the user's default e-mail program to enable the user to write an e-mail
after the user click
A. <a href= "e-mail: qhwgmail.com"> QHW <Ia>
B. <a href= "mail: qhwgmail.com"> QHW <Ia>
C. <a href= "mailto: qhwgmail.com"> QHW <Ia>
D. <a href= "smtp: qhwgmail.com"> QHW <Ia>
'1

element can draw a horizontal line in the display window.


A. <hr>
B. <br>
C. <ul>
D. <or>
3. Which of the following is the proper form of using image as hyperlink?
A. <a img href "contact.html" src = "contact.jpg" width = "65" height "50" alt
"contact"> image hyperlink </a
B. <img src = "contact.jpg" width = "65" height = "50" alt = "contact"> <a href
="contact.html"> image hyperlink </a> </img>
C. <img a bref = "imagelink.html"> <img href = "imagelink.jpg" width = "65" height =
"50" alt = "imagelink"> <Ia>
D. <a href= "imagelink.html"> <img src "imagelink.jpg" width = "65" height = "50" alt
"imagelink"> </a>
4. Theattribute in the form element specifies the URL of the script on the
web server that will be invoked to process the form's data.
A. method
B. URL
C. src
D. action
2
CONFIDENTIAL

BCS/BCG/BCN/12I311/BCS2303
5. Which of the following selections is the proper way to apply this CSS rule:
red {color: red}
A.
<p
color"red">
B. <p class"red">
C. <p color = .red>
D. <pid=.red>
6. Which of the following properly declares inline styles?
A. <p class "style">
B.
<p
style "color: red;">
C. <p id = "content">
D. <p class = "style 1 style2">
7. If we define the following style rule for element a
a:hover { text-decoration: none; }
Which of the following is the proper display of link <a href= "ump.html"> UMP</a> when
the page appear?
A. UMP
B. UMP
C. UMP
D. liMP
8. The first line of each http request message is called Request Line. Which of the following is
not included in Request Line?
A. Command
B. Request header
C.URL
D. HTTP version
9. S-HTTP authenticates the identity of both client and server by using
A. Message Authentication Code (MAC)
B. Secure Sockets Layer (SSL)
C. Digital Signatures
D. Communication Authentication Code
3
CONFIDENTIAL

BCS/BCG/BCN/1213111BCS2303
protocol to retrieve e-mail from a remote mail 10. An e-mail client use
server.
A. HTTP
B. FTP
C. SMTP
D. POP3
11. What is the output of the following script?
<?php
$a=1O;$b=20;$c=4;$d=8;$e=1.O;
$f$c+$d*2;
$g$f%20;
$i = $h <<$c;
print $j;
A. 128
B. 42
C. 242.0
D. 256
4
CONFIDENTIAL

BCS/BCG/BCN/1 21311/BCS2303
12. What is displayed when the following script is executed?
<?php
defme(myvalue, "10");
$myarray[10] = "Dog";
$myarray[] = "Human";
$myarray['myvalue'] = "Cat";
$myarray["Dog"] = "Cat";
print "The value is: ";
print $niyarray[myvalue]. "\n";
A. The value is: Dog
B. The value is: Cat
C. The value is: Human
D. The value is: 10
13. Consider the following array, called $multi_array. Flow would the value can be referenced within the
$multi_array array?
<?php
$multi array = array("red","green",42 > "blue",
"yellow" => array("apple",9 => "pear","banana",
It
> array("dog","cat","iguana")));
A. $multi_array['yellow'] ['apple'] [0]
B. $multi_array['blue'] [0] ['orange'] [1]
C. $multi_array['yellow'] ['orange'] ['cat']
D. $multi_array['yellow'] [orange'][ I]
5
CONFIDENTIAL

BCS/BCG/BCN/121311/BCS2303
14. What is the output of the following script?
<?php
$x=5;
$y= 10;
function myTest()
{
global $x,$y;
}
myTestO;
echo $y;
?>
A.0
B. 15
C. 10
D.5
15 .
What is the output of the following script?
<?php
$txtl"Hello world!";
$txt2"What a nice day!";
echo $txtl ."" . $txt2;
?>
A. $txtl $txt2
B. Hello world! What a nice day!
C. Hello world!..What a nice day!
D.
"
6
CONFIDENTIAL

BCS/BCG/BCN/121311/BCS2303
SECTION B: Structured Questions

[80 Marks]
QUESTION 1

[13 Marks]
(a)
Suppose you are hired to design a web site for College of East Coast. What kind of web site
factors need to be considered during the design?
[6 Marks]
(b)
Give TWO (2) examples on how to simplify the architecture for usable designing. [4 Marks]
(c)
The navigation or menu is a key component of effective Web design. List at least
THREE
(3) commonly-used rules for developing navigation.
[3 Marks]
QUESTION 2
[13 Marks]
(a) Differentiate GET and POST commands in HTTP request.

[4 Marks]
(b)
Explain from technical aspect what happened after we key in URL "http://www.yahoo.com
]
filename.htm" and press Enter key until the web page displays in browser window. [6 Marks]
(c)
Many web applications have three-tier architecture. Explain each phase of the three-tier
architecture.
[3 Marks]
QUESTION 3
[10 Marks]
(a) Give THREE (3)
components of E-commerce.
[3 Marks]
(b) Explain THREE (3)
functions of online shopping cart.
[3 Marks]
(c)
Define E-marketing and give ONE (1) example.

[4 Marks]
7
CONFIDENTIAL

BCS/BCG/BCN/121311/BCS2303
QUESTION 4

[12 Marks]
You are given an HTML document as shown in Figure 1. Draw the output of this document that
will be displayed on the browser.
<html xmlns='http://www.w3.org/1999/xhtml' >
<head>
<title> </title>
</head>
<body>
<table border = "1">
<Capt ion> Progranime of FSKKP</Capt ion>
<thead>
<tr>
<th rowspan = "2" align"left">
<Ui>
<li> Diploma</li>
<li> Degree</li>
<li> Master</ii>
<li> PHD</li>
</u 1>
</th>
<th coispan = "4"> Undergradu ate Programine</th>
</tr>
<tr>
<td> Compu ter Science</td>
<td> Software Engineering</td>
<td> Compu ter Networking</td>
<td> Graphics and Mu ltimedia</td>
</tr>
</thead>
<tbody>
<tr>
<th> Master</th>
<td colspan = "2"> Cou rse Mode</td>
<td colspan = "2"> Research Mode</td>
</tr>
<tr>
<th> PHD</th>
<td colspan = "4"> Research Mode</td>
</tr>
</tbody>
</tabl e>
</body>
</html>
Figure 1
8
CONFIDENTIAL

BCS1BCG/BCN/121311/BCS2303

QUESTION 5

[12 Marks]
Figure 2 shows an incomplete
HTML document. Figure 3 shows the output of this document as
displayed on the browser (Note that arrows and numbers are not parts of the output, they are used
to specify distance). Based on the output shown in Figure 3, insert your CSS code to make the
HTML document complete.
<html xmlns='http://www.w3.org/1999/xhtml " >
<head>
<title> </title>
<style type = text/css>
II INSERT YOUR CODE HERE
</style>
</head>
<body>

<ul classnav'>
<li> <a href =" > Home</a> </li>
<li> <a hrefr> FSKKP</a> </li>
<li> <a href => Library</a> </li>
</ul>
<p class = A> Cascading Stie Sheets (CSS) are the tool that web designers and
developers use alongside markup languages such as HTML and XHTML to build websites.
</p>
<p class = B" > Cascading Stle Sheets (CSS) are the tool that web designers and
developers use alongside markup languages such as HTML and XHTML to build websites.
</p>
<p class = A" > Cascading Stie Sheets (CSS) are the tool that web designers and
developers use alongside markup languages such as HTML and XHTML to build websites.
</p>
</body>
</html>
Figure 2
9
CONFIDENTIAL

BCSIBCGIBCN/1 21311/BCS2303
- .-
t1hiLJ htc
P
FileEthtViewFavoritesTcolHelp
140P__
30P
10 0 P Hone
FSKKP
Library
30P
Cascading StleSheets(CSS) arethetool that
veb designersand developersusealongside
markup languagessuchasHTML and

100P
XHTML tobuild \vebsites.
30P
Cascading StieSheets(CSS) arethetool that
veb designersand developersusealongside
tnarkup lan guagessuchasHTML and
XHT\1tobuild ivebsites.
30P
cascading StieSheets(CSS) arethetool that
veb designersand developersusealongside
narkup languagessuchasHT-. and
HTML tobuild vebsites.
300PX
Figure3
10
CONFIDENTIAL

BCS/BCG/BCN/1213111BCS2303

QUESTION 6

[20 Marks]
(a) Create and display a multidimensional array, $myBook with the information shown in

Figure 4.
[8 Marks]
Book : Learn PHP
Publisher : Treehouse
Price : 25.00
Book : Computer Networking
Publisher : Pearson
Price 84.50
Figure 4
(b)
Write a program that has $Markl and $Mark2 to store marks. These variables will be
passed to a function called CalculateAvgMarks() to calculate the average marks. Declare
$Avg as a global variable to display the average mark outside of the function. [8 Marks]
(c) Describe the following file functions.

[4 Marks]
(i) file_get_contents()
(ii) fscanl()
(iii) fgetc()
(iv) fileputcontents
END OF QUESTION PAPER
1 1

You might also like