Student ID No: ___________________
UNIVERSITY OF TASMANIA
Pages: 8 Questions: 20
Instructions:
EXAMINATIONS FOR DEGREES AND DIPLOMAS June 2019
KIT502 Web Development
First and Only Paper Ordinary Examination
Examiner: Dr Soonja Yeom
Time Allowed: TWO (2) hours Reading Time: FIFTEEN (15) minutes
There is a total of 120 marks available. Attempt ALL questions of both Section A and Section B.
2 KIT502 Web Development
SECTION A
Attempt ALL questions from Section A. Each question is worth 5 marks. Answers to each question should around FIVE (5) written lines in length. This section is worth 80 marks, or 70% of the examination.
Question 1 (addresses ILO 1)
Provide a simple definition of protocol. Explain two relevant protocols from the unit with their main roles.
[5 marks]
Question 2 (addresses ILO 4)
Describe one advantage and one problematic point of using shorthand method with an example.
[5 marks]
Question 3 (addresses ILO 3)
What is the main security goal of sending a message encrypted with a Symmetric
algorithm? Compare with the Asymmetric algorithm.
[5 marks]
Question 4 (addresses ILO 3)
What is the problem that public key algorithm can¡¯t be assured of? Explain it. What are you going to suggest for solving the situation out?
[5 marks]
Question 5 (addresses ILO 1)
Below is an example of the data structure of a database table. Describe any problems you can see and explain how you will improve it in PHP.
Question 6 (addresses ILO 1)
Describe what primary key and foreign key are with an example.
[5 marks]
[5 marks]
Question 7 (addresses ILO 3)
What is an SQL injection? Explain with a simple example and suggest a solution.
Continued…
[5 marks]
3 KIT502 Web Development
Question 8 (addresses ILO 3)
What do you think about the statement below? Do you agree with it or not? Briefly explain your answer.
Statement: If we combine different hash functions, it makes the message digest (hash) stronger and securer. For example, md5(sh1(password)) or sha1(str_rot13(password + salt)).
Question 9 (addresses ILO 1)
Explain what variables are and how to use it in PHP with possible rules.
Question 10 (addresses ILO 2)
What is the output of the following code?
Question 11 (addresses ILO 4)
What is the output of the following fragment of PHP code?
¡°January¡±, ¡°March¡±, ¡°June¡±); $arr[3]= ¡°holiday¡±;
$arr[¡°hello¡±] = 3;
echo $arr[3];
echo $arr[¡®2¡¯]; echo $arr[¡®hello¡¯];
?>
[5 marks]
[5 marks]
Question 12 (addresses ILO 4)
What is the reason for using trim() or strip_tag() in PHP? Explain your answer.
[5 marks]
[5 marks]
Continued…
[5 marks]
4 KIT502 Web Development
Question 13 (addresses ILO 1)
Describe the functions of the PHP coding below.
echo ““;
} }
} ?>
Continued…
[10 marks]
}
foreach ( $days as $values ) {
echo ““;
}
echo ““;
6 KIT502 Web Development
Question 18 (addresses ILO 4)
Please fill in two missing parts, (1) and (2).
Continued…
(1)
(2)
[10 marks]
7 KIT502 Web Development
Question 19 (addresses ILO 4)
Show the output of coding below. You may correct any part of the coding, if you wish. You may have assumptions.
Continued…
$arr = array( 7, 1, 2, 6 );
print(“Before sorting
“); print(“$arr[0]
“); print(“$arr[1]
“); print(“$arr[2]
“); print(“$arr[3]
“);
print(“
“);
selection_sort($arr);
print(“After sorting by using selection sort
“); print(“$arr[0]
“);
print(“$arr[1]
“);
print(“$arr[2]
“);
print(“$arr[3]
“);
[10 marks]
function selection_sort(&$arr) {
// count() returns the number of elements in an array
$n = count($arr);
for($i = 0; $i < count($arr); $i++) { $min = $i; } } for($j = $i + 1; $j < $n; $j++) if($arr[$j] < $arr[$min]) $min = $j; $tmp = $arr[$min]; $arr[$min] = $arr[$i]; $arr[$i] = $tmp; 8 KIT502 Web Development Question 20 (addresses ILO 3) A notice board for comments is available for users. If anybody wants to highjack the users to their own sites, it could be done when the programmer is not paying attention carefully. This is a coding produced: Is there any potential problem with this coding and a form design? Describe any possible problems if user types the code in below: 50% off!! Click this
Explain your answer with an example.
End of Examination
[10 marks]