BBT 2102 - Web Applications Development - July 2018
BBT 2102 - Web Applications Development - July 2018
C. Using code, illustrate how to create a JavaScript function that accepts one parameter,
and displays “Hooray, Even Number again” when a number is divisible by 2
(3mks)
D. Using code examples, explain how we can be able to integrate styling into our website
(6mks)
E. Explain how content in a PHP file is displayed on a browser
(2mks)
F. You have been given a html file called test.html, which has a div with the id mydiv.
The div has no html content within it. Write JavaScript code to add the text, My Div now
has words. Yay!. (3mks)
G. Name and write the syntax of any two html tags that do not require an opening
and closing tag, but utilize only one tag to implement themselves
(2mks)
H. Your friend John, is trying to post a status on a social networking site. He however
gets a popup that says Error 502. He knows that you have studied web development and
has asked you for help. Explain to John what this error means, and what could be done to
solve it
(5mks)
I. Write a PHP function to generate the months of the year as shown below (3mks)
January
February
March
Question Two (15mks)
During a visit to your former high school, you noted that the school lacked a system to
manage the student records, especially a system to manage the exam marks. Suppose you
were to develop a web based system to capture the information as shown in Table 1.
Table
a) Write HTML code to create an input form within a valid html file to be used to input
the Names, Gender and Subject’s marks. (6mks)
b) Suppose you have a database with a table called, students, which has the fields, id,
surname, othername, gender, maths, english, kiswahili, science, write PHP code to
capture the data and insert them into the database. (5mks)
b) Answer whether the following are true or false giving a reason. (5mks)
i) JavaScript is a version of Java.
ii) Given the JavaScript code below:
c) A friend of yours came across a news article on the issue of net neutrality.
i) They have come to you for explanation on what it is. Explain to them what net
neutrality is and how it affects them. (2mks)
ii) The Kenyan government is set to implement laws (Computer and Cybercrimes
Bill 2017) to regulate against fake news and cyberbullying. Explain to your
friend how the government can regulate the Internet. (5mks)
c) Using code examples show how you can target elements in a web page to change the
font color of a paragraph from red to green. (5mks)
Question Five (15mks)
a) Using code examples, differentiate between an indexed array and associative array
as used in PHP. (5mks)
b) Differentiate between local and global variables in JavaScript and using code snippets,
show how they are implemented. (5mks)
d) Name any two CSS frameworks and outline the benefits of using frameworks in web
development. (2mks)