COMP 310 INTE 221 BBIT 221 COSF 124 WEB PROGRAMMING - Kabarak University
COMP 310 INTE 221 BBIT 221 COSF 124 WEB PROGRAMMING - Kabarak University
COMP 310 INTE 221 BBIT 221 COSF 124 WEB PROGRAMMING - Kabarak University
UNIVERSITY EXAMINATIONS
MAIN/TOWN CAMPUS
SECOND SEMESTER 2020/2021 ACADEMIC YEAR
EXAMINATION FOR THE DEGREE IN COMPUTER FORENSICS
COMP 310 INTE 221 BBIT 221 COSF 124 WEB PROGRAMMING
INSTRUCTIONS TO CANDIDATES
1. Answer Question 1 and any other two questions in the answer booklet provided.
2. Do not write on your question papers. All rough work should be done in your answer booklet.
As members of Kabarak University family, we purpose at all times and in all places, to set apart in one’s heart, Jesus as
Lord. (1 Peter 3:15)
Kabarak University is ISO 9001:2015 Certified
Page 1 of 5
SECTION A: [Compulsory] TOTAL MARKS FOR THIS SECTION IS 30.
1.
As members of Kabarak University family, we purpose at all times and in all places, to set apart in one’s heart, Jesus as
Lord. (1 Peter 3:15)
Kabarak University is ISO 9001:2015 Certified
Page 2 of 5
SECTION B. TOTAL MARKS FOR THIS SECTION IS 40.
ANSWER ANY TWO QUESTIONS FROM THIS SECTION. EACH QUESTION IN THIS
SECTION CARRIES 20 MARKS.
2.
(a) HTML, CSS and Javascript are client-side languages while PHP is a server-side scripting
language. Explain this statement [4 Marks]
(b) Explain the following attributes used in HTML tables [4 Marks]
(i) Rowspan
(ii) Colspan
(c) Write complete HTML codes to display the Quotation table below [6 Marks]
(d) Write a well-documented PHP program that takes different values for the radius and uses that
to compute the circumference of a semi-circle. Show the use of comments, variables, and opera-
tors in your program [6 Marks]
3.
(a) List any four HTML5 tags which do not require a closing tag. [4 Marks]
As members of Kabarak University family, we purpose at all times and in all places, to set apart in one’s heart, Jesus as
Lord. (1 Peter 3:15)
Kabarak University is ISO 9001:2015 Certified
Page 3 of 5
(b) Describe the purpose of the following as used in HTML forms. Use HTML elements for each
case [6 Marks]
(i) Drop Down Boxes
(ii) Radio Buttons
(iii) Check Boxes
(c) Using a well labelled diagram of web communication architecture to answer the following ques-
tions:
(i) Describe webserver-client communication [5 Marks]
(ii) Distingush between the HTTP Request and Response [5 Marks]
4.
(a) Discuss three reasons why CSS instead of tables should be used to control page layouts
[4 Marks]
(b) Examine the code snippet below and answer the following questions:
<style type="text/css">
.a {color:red;}
.b {color:green;}
.c {color:blue;}
</style>
<div id="colorText">Select to change text color</div>
<select onchange="changeColor(this.value)">
<option value="a">Red</option>
<option value="b">Green</option>
<option value="c">Blue</option>
</select>
<script type="text/javascript">
function changeColor(value) {
Document.getElementById("colorText").className = value
}
</script>
(i) Identify and Explain all the CSS class and id selectors [4
Marks]
(ii) Explain the overall function of the JS in this code snippet [3 Marks]
(iii) Identify and explain all event handlers in the code [3 Marks]
(c) Write a PHP program to demonstrate count from 1 to 1000 in descending order using while loop
[6 Marks]
As members of Kabarak University family, we purpose at all times and in all places, to set apart in one’s heart, Jesus as
Lord. (1 Peter 3:15)
Kabarak University is ISO 9001:2015 Certified
Page 4 of 5
5.
(h) Use the web page given below to answer the following questions;
(i) Write HTML and CSS codes to reproduce “fruits classification” list [6 Marks]
(ii) The image in the web page above is called fruits_photo.jpg. Use HTML and CSS to place
the image in the web page [4 Marks]
(i) Several divs have a class of even. Write a style rule (as it would appear in an external
stylesheet) that gives each of these dark text (hex value 303030) on light gray background (hex
value e0e0e0), using 10pt verdana font, and the borders should be 1 pixel solid black lines all
around. In addition to verdana specify the appropriate generic font for computers that do not
have verdana installed. [4 marks]
(j) Which PHP functions are used to achieve the following with a MySQL database server on the
local machine? Use example to show how each is implemented [6 Marks]
(i) Connect to the server with username root and password Kabarak_pw01
(ii) Select a database called Kabarak_db002 to be used for queries
(iii) Execute a query select all rows and columns from the table Kabarak_users
As members of Kabarak University family, we purpose at all times and in all places, to set apart in one’s heart, Jesus as
Lord. (1 Peter 3:15)
Kabarak University is ISO 9001:2015 Certified
Page 5 of 5