0% found this document useful (0 votes)
12 views

CIT-3301-Internet-application-programming.doc

This document is an examination paper for various Bachelor's degree programs at Meru University of Science and Technology for the course CIT 3301/3325: Internet Application Programming. It includes multiple questions covering topics such as client-server architecture, PHP and JavaScript programming, form validation, and event handling. The exam consists of five questions, with students required to answer question one and any two additional questions.

Uploaded by

deosiatah0
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

CIT-3301-Internet-application-programming.doc

This document is an examination paper for various Bachelor's degree programs at Meru University of Science and Technology for the course CIT 3301/3325: Internet Application Programming. It includes multiple questions covering topics such as client-server architecture, PHP and JavaScript programming, form validation, and event handling. The exam consists of five questions, with students required to answer question one and any two additional questions.

Uploaded by

deosiatah0
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

30

MERU UNIVERSITY OF SCIENCE AND TECHNOLOGY


P.O. Box 972-60200 – Meru-Kenya
Tel: +254(0) 799 529 958, +254(0) 799 529 959, + 254 (0) 712 524 293,
Website: [email protected] Email: [email protected]

University Examinations 2018/2019

THIRD YEAR FIRST SEMESTER EXAMINATION FOR THE DEGREE OF BACHELOR


OF BUSINESS INFORMATION TECHNOLOGY, BACHELOR OF SCIENCE
INFORMATION SCIENCE, BACHELOR OF SCIENCE IN COMPUTER SCIENCE,
BACHELOR OF COMPUTER TECHNOLOGY, BACHELOR OF INFORMATION
TECHNOLOGY, BACHELOR OF EDUCATION SCIENCEAND BACHELOR OF
SCIENCE IN COMPUTER SECURITY AND FORENSICS

SECOND YEAR FIRST SEMESTER BACHELOR OF MATHEMATICS AND


COMPUTER

CIT 3301/3325: INTERNET APPLICATION PROGRAMMING

DATE: JANUARY 2019 TIME: 2 HOURS

INSTRUCTIONS: Answer question one and any other two questions

QUESTION ONE (30 MARKS)

a) Differentiate between client-server architecture and distributed systems architecture

(2 marks)

b) Outline any four features of JavaScript (4 marks)

c) Loops in PHP are used to execute the same block of code a specified number of times.
Explain four loop types supported by PHP (4 marks)

d) Use an example to write a simple script to illustrate the following PHP in- built
functions (4 marks)

i. String function

ii. Array function

e) Write a JavaScript to validate a form by ensuring at least 6 characters are entered into a
text box (6 marks)

Meru University of Science & Technology is ISO 9001:2015 Certified


Foundation of Innovations Page 1
f) Distinguish between onFocus and onBlur event handlers (2 marks)

g) Describe the purpose of the following attributes in a <form> tag (4 marks)

i. Action

ii. Method

h) Write a PHP script to assign two values to variables then display the biggest and the
smallest value (4 marks)

QUESTION TWO (20 MARKS)

a) Write a PHP script to display today date (4 marks)

b) Write a html tags to create a form with textbox to enter product name, price and
quantity then display total price (4 marks)

i. Write a JavaScript to capture price and quantity values from the form,
calculated total price and return the result to the form result text box

(4 marks)

c) One of the most common uses of event handler is to display a message on the status
line when the user moves a mouse over a link

i. Write a html tag to display a link called “order product” (2 marks)

ii. Write a JavaScript to display the message “order a product” on the


status line when a user places the mouse pointer over the order product
link in c. i. above (3 marks)

iii. Write a JavaScript to clear the status line when the user moves the
mouse away from the link (3 marks)

QUESTION THREE (20 MARKS)


a) Use a diagram to illustrate the DOM object hierarchy (4 marks)
b) Write a html tags to create a form with employee first name, second name, hours
worked, rate per hour and send button to send the form details to employee.php
(4 marks)
i. Write a JavaScript to ensure that all fields in the above form in b i. are filed
(4 marks)

Meru University of Science & Technology is ISO 9001:2015 Certified


Foundation of Innovations Page 2
ii. Write employee.php script to receive employee details and the calculated
results into a pay=hours worked* rate per hour and insert all the form details
and the calculated result into a database table called salary in employee
database (8 marks)

QUESTION FOUR (20 MARKS)


a) Differentiate between the following tags (4 marks)
i. <hr> and <nobr>
ii. <dl> and <dt>
b) Given the following PHP code for checking blank textbox, answer the following
questions
1. <? PHP
2. $user_text=trim(“Bill Gates”);
3. display_error_message(user_text);
4. function display_error_message(user_text) {
5. if(user_text is “”){
6. printout”Blank text box detected”;
7. }
else{
8. print “text Ok”;
9. }
10. }
11. ?>
i.What is the role of the PHP inbuilt function called trim( ) in line 2 (2 marks)
ii. Eliminate all errors in the code (4 marks)
iii. Add comments on line 1 to 6 (3 marks)
iv. Rewrite the following in JavaScript (7 marks)

QUESTION FIVE (20 MARKS)


a) Loops causes a section of your program to be repeated a certain number of time
i. Differentiate between JavaScript for loop and JavaScript while loops (4 marks)
ii. Using JavaScript write a for loop that adds up the numbers 1 to 10 (6 marks)

Meru University of Science & Technology is ISO 9001:2015 Certified


Foundation of Innovations Page 3
iii. Using JavaScript write a while loop to add up the numbers 1 to 10 (6 marks)
b) Using if....else statement, write a simple PHP program that will output “Have a nice
weekend !” if the current day if Friday, otherwise it will output “Have a nice day!”
(4 marks)

Meru University of Science & Technology is ISO 9001:2015 Certified


Foundation of Innovations Page 4

You might also like