You are on page 1of 6

EXAMINATION PAPER:

ACADEMIC SESSION 2007/2008

Campus School Subject group Level TITLE OF PAPER COURSE CODE Date and Time

Maritime Greenwich Computing and Mathematical Sciences Computing Science Three Web Engineering COMP1309 Thursday 5th June 2008 (2 Hours)

BAHRAIN HONG KONG MALTA SINGAPORE TANZANIA U.A.E

15:00 18:30 15:00 18:30 16:00 17:00

GREECE LONDON MALAYSIA SYRIA TRINIDAD ZAMBIA

15:00 13:00 18:30 16:00 09:30 15:00

You MUST answer question 1 which is worth 40 marks. Answer TWO questions from the remaining THREE questions. If you answer more than two questions, marks will ONLY be awarded for your TWO best answers Each question is worth 30 marks. CALCULATORS AND OTHER ELECTRONIC DEVICES ARE NOT PERMITTED

View Web Engineering Exam Questions and Answers Guide

Approved______________________________________________________________ Question 1 (a) Study the code of the DHTML web page given below. Line numbers have been added that you may refer to in your answer. Describe in detail, with the aid of a figure, what you expect to see in the browser when this page has loaded. [17 marks]

Q1.css
1. body 2. { 3. font: .8em "Lucida Grande", Tahoma, Arial, Helvetica, 4. sans-serif; 5. } 6. ol 7. { 8. margin:0; 9. padding: 0 1.5em; 10. } 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. table { color:#FFF; background:#C00; border-collapse:collapse; width:647px; border:5px solid #900; } thead {

22. } 23. thead th 24. { 25. padding:1em 1em .5em; 26. border-bottom:1px dotted #FFF; 27. font-size:120%; 28. text-align:left; 29. } 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. thead tr { } td { padding:.5em 1em; } tbody tr.odd td { background:transparent url(tr_bg.png) repeat top left; } tfoot

Question 1 continued on the next page

Web Engineering COMP1309 Page 2 of 6

Approved______________________________________________________________
Question 1 continued 42. 43. 44. 45. 46. 47. 48. 49. 50. { } tfoot td { padding-bottom:1.5em; } tfoot tr { }

Q1.js
1. function init(){ 2. img0 = new Image; 3. img0.src = 'buttonB.gif'; 4. } 5. function foo(x){ 6. x.src = 'buttonB.gif'; 7. } 8. function bar(x){ 9. x.src = 'buttonA.gif'; 10. } 11. function validate(theForm) { 12. var valid = true; 13. if (theForm.email.value == "") { 14. feedback('eMess','Enter your email address here',6); 15. valid = false; 16. } else valid = validEmail(); 17. if (theForm.passwd.value == "") { 18. feedback('pMess','Enter your password here',6); 19. valid = false; 20. } else if (theForm.passwd.value.length <= 5){ 21. feedback('pMess','Password too short',6); 22. valid = false; 23. } else feedback('pMess','Password',1); 24. if ( valid ) return true; 25. else return false; 26. } 27. function validEmail() { 28. email = document.forms[0].email; 29. var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([azA-Z0-9]{2,4})+$/; 30. if (filter.test(email.value)) { 31. feedback('eMess','Email',1); 32. return true; 33. } else { 34. feedback('eMess','Not a valid email address',6); 35. return false; 36. }

Question 1 continued on the next page

Web Engineering COMP1309 Page 3 of 6

Approved______________________________________________________________
Question 1 continued 37. } 38. function feedback(item,mess,count) { 39. document.getElementById(item).innerHTML = mess; 40. if ( count%2 == 1 ) { 41. document.getElementById(item).style.color = 'black'; 42. } else { 43. document.getElementById(item).style.color = 'white'; 44. } 45. count--; 46. var foo = 'feedback(\'' + item + '\',\'' + mess + '\',' 47. + count + ')'; 48. if ( count > 0 ) { 49. setTimeout(foo,300); 50. } 51. }

Q1.html
1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 3. <head> 4. <meta http-equiv="Content-Type" content="text/html; charset=iso8859-1" /> 5. <title>The teams list</title> 6. <link href="q1.css" rel="stylesheet" type="text/css" /> 7. <style type="text/css"> 8. <!-9. body,td,th { 10. font-size: 0.8em; 11. } 12. --> 13. </style></head> 14. <body> 15. <h1>The teams </h1> 16. <table> 17. <col /> 18. <col id="middle" /> 19. <col /> 20. <thead> 21. <tr> 22. <th>Teams</th> 23. <th>games won </th> 24. <th>games lost </th> 25. </tr> 26. </thead> 27. <tfoot> 28. <tr> 29. <td colspan="3">Total games played = 4 </td> 30. </tr> 31. </tfoot> 32. <tbody>

Question 1 continued on the next page

Web Engineering COMP1309 Page 4 of 6

Approved______________________________________________________________
Question 1 continued 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55. 56. 57. 58. 59. 60. <tr> <td>team 1 (red) </td><td>1 </td> <td>3</td> </tr> <tr class="odd"> <td>team 2 (green) </td> <td>2</td> <td>2</td> </tr> <tr> <td>team 3 (orange) </td> <td>1</td> <td>3</td> </tr> <tr> <td>team 4 (blue) </td> <td>4</td> <td>0</td> </tr> </tbody> </table> <script type="text/javascript" src="q1.js"></script> <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>

61. <td><input type="password" name="passwd" size="20"/></td> 62. </tr><tr> 63. <td></td><td height="74" colspan="2"> 64. <div align="center"> 65. <input name="image" type="image" onclick="return validate(this.form)" onmouseover="foo(this)" onmouseout="bar(this)" src="buttonA.gif" alt="Go for it!"/> 66. </div></td></tr></table> 67. </form> 68. </body> 69. </html>

(b)

Why would you use XML instead of HTML for your website? [13 marks]

(c)

An example of a very simple XML DTD to describe a list of people is given below. Give an example of an XML file which makes use of and conforms to this DTD.

Question 1 continued on the next page

Web Engineering COMP1309 Page 5 of 6

Approved______________________________________________________________
Question 1 continued

<!ELEMENT people_list (person*)> <!ELEMENT person (name, birthdate?, gender?, socialsecuritynumber?)> <!ELEMENT name (#PCDATA)> <!ELEMENT birthdate (#PCDATA)> <!ELEMENT gender (#PCDATA)> <!ELEMENT socialsecuritynumber (#PCDATA)>

[10 marks] Question 2 (a) Open Source software is widely used for creating Web applications. What is meant by the term Open Source? Explain what you understand by the Open Source Initiative. [25 marks] What is the Cascading Style Sheet mechanism? In your answer pay particular attention to the term Cascading. [5 marks]

(b)

Question 3 (a) Critically discuss the terms structural markup, presentational markup and hypertext markup. [16 marks] What is an HTML element and which properties can it have? [7 marks] (c) What is an HTML form and what it can contain? [7 marks]

(b)

Question 4 (a) A web developer claimed that HTTPS is not as secure as the HTTP protocol. Do you agree or disagree with this statement? [2 marks] Critically discuss the relationship between SSL and TLS. [13 marks] (c) Critically discuss the differences between GET and POST methods. [15 marks]

(b)

Web Engineering COMP1309 Page 6 of 6


View Web Engineering Exam Questions and Answers Guide

You might also like