BIT 4303  ADVANCED WEB DESIGN  DEVELOPMENT KCA Past Paper

UNIVERSITY EXAMINATIONS: 2010/2011
THIRD YEAR STAGE EXAMINATION FOR THE DEGREE OF BACHELOR
OF SCIENCE IN INFORMATION TECHNOLOGY
BIT 4303: ADVANCED WEB DESIGN & DEVELOPMENT
DATE: JUNE 2011 TIME: 2 HOURS
INSTRUCTIONS: Answer question ONE and any other TWO questions

Question One
a) JavaScript has three kind of popup boxes: Describe each one of them using example code to
Illustrate (9 Marks)
b) Describe one application for each of the buttons above question in question one (a) in a website
(6 Marks)
c) Styles sheets were added to HTML 4.0 to solve a problem. Using examples to illustrate, explain
the problem solved by use of style sheets. (6 Marks)
d) Describe situations where it might be necessary to place styles sheets in an external file. (3 Marks)
e) Using an example to illustrate explain how style sheets can be placed in an external file (6 Marks)
Question Two
a) Using examples to illustrate describe the “id” and “class” selectors as used with CSS (12 Marks)
b) Describe the main parts of a style sheet rule using an example to illustrate (8 Marks)
Question Three
a) Using php write a code segment to bid farewell to a user with the following messages “Have a
nice weekend!” if the current day is Friday, and “Have a nice Sunday!” if the current day is
Sunday. Otherwise it will output “Have a nice day!” (10 Marks)
b) Explain an array (2 Marks)
c) Using an appropriate example explain situations where using an array is better than using a
variable (8 Marks)
Question Four
a) Explain why user input should be validated on the client side whenever possible and sate
situations where it may be necessary to validate on the server. (8 Marks)
b) Apply external style sheets to create a HTML document with the following formatting (12 Marks)
1) Body background-color to be red
2) All heading one to be maroon in color
3) Font-size to be 20pt
4) All paragraphs to have 11 font-sizes and a margin of 15px
5) All active links to be of color green, visited links to be color yellow, when the mouse hovers at a
link it should turn black.
The HTML page above should have all the elements above to allow testing
Question Five
Study the php code below and answer the questions that follow
<html>
<body>
<?php
$db = mysql_connect(“localhost”,”root”);
mysql_select_db(“mydb”,$db);
$result = mysql_query(“SELECT * FROM employees”,$db);
printf(“First Name: %s<br>\n”, mysql_result($result,0,”first”));
printf(“Last Name: %s<br>\n”, mysql_result($result,0,”last”));
printf(“Address: %s<br>\n”, mysql_result($result,0,”address”));
printf(“Position: %s<br>\n”, mysql_result($result,0,”position”));
?>
</body>
</html>
Describe the purpose of each of the following statements in the code above (20 Marks)
a) mysql_connect() function
b) mysql_select_db()
c) mysql_query()
d) mysql_result()

(Visited 77 times, 1 visits today)
Share this:

Written by