UNIVERSITY EXAMINATIONS: 2011/2012
YEAR 3 EXAMINATION FOR THE BACHELOR OF SCIENCE IN
INFORMATION TECHNOLOGY
BIT 4303 ADVANCED WEB DESIGN
DATE: APRIL 2012 TIME: 2 HOURS
INSTRUCTIONS: Answer Question One and Any other Two Questions
QUESTION ONE
a) Define style sheets (2 Marks)
b) Explain two reasons why style sheets were developed (5 Marks)
c) “CSS Saves a Lot of Work!” agree or disagree with this statement (4 Marks)
d) Study the file below saved with the name Myfirststyle.css.
Body {background-color: tan}
h1 {color:maroon; font-size:20pt}
hr {color:navy}
p {font-size:11pt; margin-left: 15px}
a:link {color:green}
a:visited {color:yellow}
a:hover {color:black}
a:active {color:blue}
i. Using a html statement explain how it can be called in any html page (5 Marks)
ii. Describe the effects of applying this file in any html page (8 Marks)
e) Using an example explain how the HTML comment tag can be used to “hide” the JavaScript to
browsers that do not support java script (6 Marks)
QUESTION TWO
a) JavaScript has three kinds of popup boxes. List and describe how each one of them can be applied
in an organization’s website to improve its usability (9 Marks)
b) Provide syntax to show how functions are defined in java script (4 Marks)
c) Write a HTML sample code that pops up a thank you message when the user clicks on the link
(4 Marks)
d) Explain how the onsubmit event can be used on a webpage (3 Marks)
QUESTION THREE
a) Using appropriate examples Describe the three methods of adding style rules to HTM (9 Marks)
b) Need to catch and handle JavaScript errors, so you don’t lose your audience. Explain and illustrate
using JavaScript syntax how this can be done. (5 Marks)
c) Using an example describe the syntax of any cascading style rule (6 Marks)
QUESTION FOUR
a) PHP is “a weakly typed language”. Explain what this statement means as regards php variables
(4 Marks)
b) Write a PHP program that outputs the statement “Have a nice weekend!” if the current day is
Friday, otherwise it prints “Have a nice day!” (6 Marks)
c) Describe four arrays that can be used in PHP. (10 Marks)
QUESTION FIVE
a) Using Php write a simple program that uses a function to print your name when it is called.
(6 Marks)
b) i) Explain the class selector as used with html and clearly differentiate it from the id selector
(4 Marks)
ii) Create a class that can be used to centre align all the html elements its applied to in a html
document (4 Marks)
iii) Create a html document that can be used to demonstrate the use of the class created in part b
(ii) above. (6 Marks)