MURANG’A UNIVERSITY OF TECHNOLOGY
SCHOOL OF COMPUTING AND INFORMATION
TECHNOLOGY
DEPARTMENT OF INFORMATION TECHNOLOGY
UNIVERSITY ORDINARY EXAMINATION
2023/2024 ACADEMIC YEAR
THIRD YEAR FIRST SEMESTER EXAMINATION FOR BACHELOR OF
SCIENCE IN IT, BBIT, BSE, BCT, BCS, AND BACHELOR OF ARTS IN
DEVELOPMENT STUDIES WITH IT
SIT 300 – WEB APPLICATION DEVELOPMENT
DURATION: 2 HOURS
INSTRUCTIONS TO CANDIDATES:
1. Answer Question ONE and Any other TWO questions.
2. Mobile phones are not allowed in the examination room.
3. You are not allowed to write on this examination question paper.
Page 1 of 3
SECTION A – ANSWER ALL QUESTIONS IN THIS SECTION
QUESTION ONE (30 MARKS)
a) Outline the advantages of using dynamic web pages. (4 marks)
b) Explain two reasons for using JavaScript as a client side programming language. (4 marks)
c) Differentiate the following terms as used in web development giving examples of any two
popular implementation technologies in each case.
i. Web designing vs web development (4 marks)
ii. Server side Vs client side scripting (4 marks)
iii. Front – end Vs back –end designing (4 marks)
d) Explain the use of the following MySQL functions and write the implementation syntax for
each of the function. (8 marks)
i. EXTRACT
ii. GET
iii. SELECT
iv. OPEN
e) Write the aid of two examples in each case, distinguish primitive and non-primitive data
types as used in Java Script. (2
marks)
SECTION B – ANSWER ANY TWO QUESTIONS IN THIS SECTION
QUESTION TWO (20 MARKS)
a) Write a Java Script program embedded in HTML that would display all the multiples of 5 in
a range 30 to 100 on a console window. Use a while loop. (6 marks)
b) Explain three methods that can be used to convert string variables to numbers in a Java
Script. (6
marks)
c) Write a Java Script program that prompts a user to enter three numbers. The program should
then compare the three numbers and display on an alert box greatest of the three. (8 marks)
QUESTION THREE (20 MARKS)
a) PHP allows two ways in which an argument can be passed into a function. State and explain
the two ways. (4 marks)
b) Write a PHP function with a simple if – else statement which evaluates students’ marks and
output whether it is pass or fail. Assume that the pass mark is 50 and that the function will be
called with the actual mark as an argument. (6 marks)
c) Write a PHP program to read and display the content of a text file. (4 marks)
d) Describe three ways in which we can connect to MySQL from PHP. (6 marks)
Page 2 of 3
QUESTION FOUR (20 MARKS)
a) Explain what entails planning in web development. (2 marks)
b) Cookies in websites are used to identify users. Write a PHP script that creates a cookie called
mycookie with the value ‘user’. The cookie should expire in 10 days. (4 marks)
c) Write JavaScript code to check the strength of a password entered in a form by displaying the
message ‘password not strong’ when password entered has less than 6 characters. (6 marks)
d) Write a PHP script tag that selects data from a ‘student’ table in the ‘school’ database and
displays each of the results in the browser. (8 marks)
Page 3 of 3