Professional Documents
Culture Documents
2016 - KIT502 Web Development
2016 - KIT502 Web Development
2016 - KIT502 Web Development
Student ID number:
________________
Pages : 8
____ Questions : 21
UNIVERSITY OF TASMANIA
June 2016
Examiner
Soonja Yeom
Saurabh Garg
Instructions:
There are a total of 120 marks available. Answer ALL questions.
All answers must be written in the supplied exam booklet, do NOT write your
answers on the exam paper.
-2- KIT502 Web Development
SECTION A
Attempt ALL EIGHTEEN (18) questions from Section A. Each question is worth FIVE (5)
marks. This section is worth 90 marks and 75% of the examination.
Question 1
List four super global variables and provide a brief explanation for each.
[5 marks]
Question 2
Explain two advantages and two disadvantages of client-side scripting.
[5 marks]
Question 3
Briefly explain symmetric-key encryption and public-key encryption. What are the
different goals that each encryption is aiming at?
[5 marks]
Question 4
When creating web sites, separating presentation information from other content is
recommended. Explain three different ways of implementing presentation
information and their pros and cons.
[5 marks]
Question 5
What is SSL and how does it work?
[5 marks]
Question 6
What does the system need to do to prevent XSS or any other code phishing attack?
[5 marks]
Question 7
Which problem can be minimised by using the real_escape_string() function
in web development? Provide a brief example.
[5 marks]
Question 8
What are the technologies involved in AJAX? Identify them with a brief explanation.
[5 marks]
Question 9
PHP provides a large number of functions that can be used to manipulate a
MySQL database. Give the names of TWO (2) of these functions and explain briefly
what each of them does.
[5 marks]
Question 10
What is CGI (Common Gateway Interface)? Describe the concept of CGI.
[5 marks]
Continued …
KIT502 Web Development -3-
Question 11
What is the purpose of templates in PHP? Explain two advantages of templates.
[5 marks]
Question 12
Describe the encryption processes used with digital signatures.
[5 marks]
Question 13
This question is about HTTP messages. Explain what information is required for
request and response messages.
[5 marks]
Question 14
The following questions are about “State Management”.
a HTTP transactions are said to be stateless. What does stateless mean? And
what weakness is caused by being stateless?
[1 mark]
Continued …
-4- KIT502 Web Development
Question 15
The output of the following code displays a form. When the form is loaded, the
cursor automatically focuses on the username field. Fill the box (a) to complete the
code by using jQuery.
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js">
</script>
</head>
<body>
<script>
(a)
</script>
<form>
username: <input id="username" type="text"/><br/>
<input type="submit" name="submit" value="Login"/>
</form>
</body>
</html>
[5 marks]
Question 16
What is the output of the following code? (what you see in the browser)
<?php
$var='final exam';
$var1="Fun!";
$var2=3;
echo $var.$var2."<br/>";
echo $var1+$var2."<br/>";
echo "'$var1' Wait!".'<br/>';
?>
[5 marks]
Question 17
There are two advantages of using jQuery: resolving “cross-browser issues” and
“method chainability”. Describe “cross-browser issues” and “method chainability”.
[5 marks]
Question 18
What is an accessible web site? Explain two points you consider for building an
accessible web site and suggest how to implement them.
[5 marks]
Continued …
KIT502 Web Development -5-
SECTION B
Attempt ALL THREE (3) questions from Section C. Each worth TEN (10) marks each. This
section is worth 30 marks and 25% of the examination.
Question 19
Consider the Implementation of the “city-viewer system”. The completed system
should perform as below. This program consists of two files, “Index.html” and
“get_cities.php”.
Continued …
-6- KIT502 Web Development
a The code below is the source code for “Index.html”. Write answers to replace
the numbered boxes, 1- 10.
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js">
</script>
<script type="text/javascript">
function setup_country_change(){
$( (1) ).change( (2) );
}
function update_cities(){
var country = $( (3) ).attr( (4) );
$.post( (5) );
}
function show_cities(cities){
$( (6) ).html( (7) );
}
$(document).ready( (8) );
</script>
</head>
<body>
<form id="select_country" name="select_country" method=""
action="#">
<table>
<tr> <th>Country</th>
<td><select name="country" id="country">
<option value="" selected="selected">Please
select country.</option>
<option (9) >Australia</option>
<option (9) >United States</option>
<option (9) >United Kingdom</option>
</select></td>
</tr>
<tr> <th>Cities</th>
<td id="cities"> (10) </td>
</tr>
</table>
</form>
</body>
</html>
[5 marks]
Continued …
KIT502 Web Development -7-
b The code below is the source code for “get_cities.php”. Write answers to
replace the numbered boxes. There is one mark for each box that is correctly filled
in.
<?php
switch( (1) )
{
(2) "au":
$cities = array('Adelaide','Brisbane','Canberra');
break ;
(2) "us":
$cities = array ('Chicago','Dallas','Houston');
break ;
(2) "uk":
$cities = array('Birmingham','Glasgow','Leeds');
break;
(3) :
$cities = false;
break;
}
if( (4) ) echo "Please select country";
else echo " (5) ";
?>
[5 marks]
Question 20
The following table displays several PHP functions. Write a description for each
function.
Functions Description
trim() (a)
strip_tags() (b)
html_specialchars() (c)
real_escape_string() (d)
[5 marks]
What is a possible attack we can prevent by using them? Describe the potential attack.
[5 marks]
Continued …
-8- KIT502 Web Development
Question 21
Continued …