Sei sulla pagina 1di 8

APPROVED

EXAMINATION PAPER: Campus School Department Level TITLE OF PAPER COURSE CODE Date and Time London Trinidad Malaysia UAE Zambia

ACADEMIC SESSION 2005/2006 Maritime Greenwich Computing and Mathematical Sciences Computer Science Three Web Engineering COMP 1309 Monday 5th June 2006 - 3 hours 13.30 09.30 18.00 16.00 14.30 Hong Kong Malta Bahrain Singapore Greece 18.00 15.00 15.00 18.00 15.00

Answer any FOUR of the following SIX questions. Each question is worth 25 marks. If you answer more than four questions, marks will ONLY be awarded for your FOUR best answers.

Web Engineering COMP1309 Page 1 of 8

View Web Engineering Exam Questions and Answers Guide

APPROVED 1. (a) What is the role of the World Wide Web Consortiums (W3C) Web Accessibility Initiative (WAI)? [10 marks] You have just been appointed as web development manager for a medium sized company that sells toys online. You have decided to investigate the possibility of switching from the current software used to run the web site (largely Perl CGI and XML with SQL Server) to Microsoft .NET software. The IT director, to whom you report, is sceptical and you suspect that they are not familiar with .NET. You decide to put together a short presentation explaining the potential benefits of the .NET framework for your business. What are the main points of your presentation? [15 marks]

(b)

2.

(a)

Open source software is widely used for creating web applications. (i) (ii) (iii) What is meant by the term open source? What is GPL and what is its primary purpose? What is the difference between free software and free beer? [6 marks]

(b)

Compare and contrast open source and proprietary software, illustrating your answer with reference to operating systems, web servers, server-side scripting languages, web browsers and database servers. [19 marks]

Web Engineering COMP1309 Page 2 of 8

APPROVED 3. Study the code of the DHTML web page given below. Line numbers have been added that you may refer to in your answer. (a) Describe the sequence of events in the browser as index.html loads into a browser that supports JavaScript 1.5 and CSS level 2. You should include in your answer all interactions between the client and the server. [9 marks] Describe in detail, with the aid of a diagram, what you expect to see in the browser when this page has loaded. [8 marks] This page demonstrates several interesting behaviours. Describe in some detail what is dynamic about this page. [8 marks]

(b)

(c)

index.css
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 body { background:#DDEEFF; font-family:sans-serif; padding:1em; } h1 { background:#BBCCFF; text-align:center; padding:0.5em; margin:0px; } h2 { text-align:center; } table { width:60%; margin-left:20%; background:white; } td { text-align:center; } #eMess, #pMess { width:50%; }

Question 3 continues on the following page Question 3 continued: index.html Web Engineering COMP1309 Page 3 of 8

APPROVED

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

<html> <head> <title>Feline Forum</title> <link rel="stylesheet" type="text/css" href="index.css"/> <script type="text/javascript" src="index.js"></script> </head> <body onload="init()"> <h1>Feline Forum</h1> <h2>Where cat lovers go to talk about cats</h2> <form method="post" action="auth.php"> <table><tr> <td id="eMess">Email</td> <td id="pMess">Password</td> </tr><tr> <td><input type="text" name="email" size="20" onblur="validEmail()"/></td> <td><input type="password" name="passwd" size="20"/></td> </tr><tr> <td colspan="2" style="color:white">X</td> </tr><tr> <td colspan="2"> <input type="image" src="buttonA.gif" onmouseover="foo(this)" onmouseout="bar(this)" onclick="return validate(this.form)"/> </td></tr></table> </form> </body></html>

index.js
1 2 3 4 5 6 7 8 9 10 11 12 13 function init(){ img0 = new Image; img0.src = 'buttonB.gif'; } function foo(x){ x.src = 'buttonB.gif'; } function bar(x){ x.src = 'buttonA.gif'; }

Question 3 continues on the following page Question 3 continued:


14 15 16 17 18 19 20 function validate(theForm) { var valid = true; if (theForm.email.value == "") { feedback('eMess','Enter your email address here',6); valid = false; } else valid = validEmail(); if (theForm.passwd.value == "") {

Web Engineering COMP1309 Page 4 of 8

APPROVED
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 feedback('pMess','Enter your password here',6); valid = false; } else if (theForm.passwd.value.length <= 5){ feedback('pMess','Password too short',6); valid = false; } else feedback('pMess','Password',1); if ( valid ) return true; else return false; } function validEmail() { email = document.forms[0].email; var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.) +([a-zA-Z0-9]{2,4})+$/; if (filter.test(email.value)) { feedback('eMess','Email',1); return true; } else { feedback('eMess','Not a valid email address',6); return false; } } function feedback(item,mess,count) { document.getElementById(item).innerHTML = mess; if ( count%2 == 1 ) { document.getElementById(item).style.color = 'black'; } else { document.getElementById(item).style.color = 'white'; } count--; var foo = 'feedback(\'' + item + '\',\'' + mess + '\',' + count + ')'; if ( count > 0 ) { setTimeout(foo,300); } }

Web Engineering COMP1309 Page 5 of 8

APPROVED 4. (a) HTTP is a stateless protocol. Explain what this means and give reasons why HTTP was developed as a stateless protocol. [7 marks] Compare and contrast cookies and session variables as techniques for developing stateful web applications. [18 marks]

(b)

5.

(a)

It is common practice to validate HTML form data at both the client and the server. (i) (ii) (iii) Why is it important to validate data input from HTML forms? Why is it important to validate at both the client and the server? What is the difference between validation and authentication? [13 marks]

(b)

The first 8 lines from a PHP page are given below. Line numbers have been added that you may refer to in your answer. (i) (ii) (iii) What is the purpose of this code? Explain in detail how this code operates. How could the intention of this code be circumvented? [12 marks]

1 2 3 4 5 6 7 8

<html> <head> <?php define("URLFORM", "http://www.foo.bar/register.html"); if ($_SERVER[HTTP_REFERER] != URLFORM ) { echo '<meta http-equiv="Refresh" content="0; url='. URLFORM . '"/>'; exit ('</head><body></body></html>'); }

Web Engineering COMP1309 Page 6 of 8

APPROVED 6. While writing articles for an online journal you decide to collect your bibliographic references in an XML format using an XML markup language designed for bibliographic data, BibML. An example of your XML bibliography is shown below together with the XSLT used to render the XML into XHTML. (a) The file bib.xml is a valid BibML document. Create a DTD for BibML. Note that an article may have one or more authors and a book may have one or more editors or more authors. [8 marks] (b) Discuss the relative merits of DTDs and XML Schemas. [8 marks] (c) Describe in detail, with the aid of a figure, what you would expect to see when bib.xml is viewed in a browser that can process XSLT. (Character references 39 and 160 are an apostrophe and a non-breaking space respectively) [9 marks] bib.xml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE bibliography SYSTEM "bib2.dtd"> <?xml-stylesheet type="text/xsl" href="bib2.xsl"?> <bibliography> <reference cite="DOS99"> <book year="1999"> <editor>C. DiBona</editor> <editor>S. Ockman</editor> <editor>M. Stone</editor> <title>Open Sources</title> <publisher>O&#39;Reilly</publisher> <location>USA</location> </book> </reference> <reference cite="JC99"> <article year="1999"> <author>M. Jain</author> <author>M. Cross</author> <title>Finite Population Cellular Radio</title> <journal vol="23" part="1" fPage="77" lPage="86">Applied Mathematical Modelling</journal> </article> </reference>

Question 6 continues on the following page Question 6 continued:


23 24 <reference cite="CR03"> <book year="2003">

Web Engineering COMP1309 Page 7 of 8

APPROVED
25 26 27 28 29 30 31 <author>C. Ritchie</author> <title>Operating Systems</title> <publisher>Continuum</publisher> <location>London</location> </book> </reference> </bibliography>

bib.xsl
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <html> <h2>Bibliography</h2><table> <xsl:for-each select="//reference"> <xsl:sort order="ascending" select="@cite"/> <tr><td> [<xsl:value-of select="@cite"/>] &#160; &#160; </td><td> <xsl:apply-templates select="book|article"/> </td></tr> </xsl:for-each></table> </html> </xsl:template> <xsl:template match="book"> <xsl:apply-templates select="author|editor"/> (<xsl:value-of select="@year"/>) <i><xsl:value-of select="title"/></i>, <xsl:value-of select="publisher"/>, <xsl:value-of select="location"/> </xsl:template> <xsl:template match="article"> <xsl:apply-templates select="author"/> (<xsl:value-of select="@year"/>) <xsl:value-of select="title"/>, <xsl:apply-templates select="journal"/> </xsl:template> <xsl:template match="author|editor"> <xsl:value-of select="."/>, </xsl:template> <xsl:template match="journal"> <i><xsl:value-of select="."/></i>, <xsl:value-of select="@vol"/> (<xsl:value-of select="@part"/>), <xsl:value-of select="@fPage"/>-<xsl:value-of select="@lPage"/> </xsl:template> </xsl:stylesheet>

View Web Engineering Exam Questions and Answers Guide

Web Engineering COMP1309 Page 8 of 8

Potrebbero piacerti anche