0% found this document useful (0 votes)
55 views4 pages

Bit3202 Internet Programming Virt Varsity

This document contains instructions for a university examination in Internet Programming. It lists 5 questions, with subquestions for a total of 100 marks. Question 1 is compulsory and covers topics like defining scripting languages, capabilities of scripting languages like PHP, using loops to output values, creating a form to capture employee details and pay computation, and features of PHP. Other questions cover additional PHP topics like comments, creating user forms and insertion, using arrays, phpMyAdmin, functions, switch statements, form validation, and inserting/querying data from MySQL tables. It also covers advantages of dynamic websites over static ones.

Uploaded by

ashleykiki.ke
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views4 pages

Bit3202 Internet Programming Virt Varsity

This document contains instructions for a university examination in Internet Programming. It lists 5 questions, with subquestions for a total of 100 marks. Question 1 is compulsory and covers topics like defining scripting languages, capabilities of scripting languages like PHP, using loops to output values, creating a form to capture employee details and pay computation, and features of PHP. Other questions cover additional PHP topics like comments, creating user forms and insertion, using arrays, phpMyAdmin, functions, switch statements, form validation, and inserting/querying data from MySQL tables. It also covers advantages of dynamic websites over static ones.

Uploaded by

ashleykiki.ke
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

UNIVERSITY EXAMINATION 2017/2018

SCHOOL OF COMPUTING AND INFORMATICS


DEPARTMENT OF INFORMATION TECHNOLOGY

BBIT/BIT
VIRTUAL VARSITY

UNIT CODE: BIT3202 UNIT TITLE: INTERNET


PROGRAMMING

WED 28TH AUGUST, 2018 8:00AM SPECIAL/SUPP TIME: 2 HRS

INSTRUCTIONS: ATTEMPT QUESTION ONE AND ANY OTHER TWO QUESTIONS.

Question 1 (20 Marks) - COMPULSORY

a) Define scripting language. (2 Marks)

b) Give three capabilities of scripting languages. (3 Marks)

c) Using loop concept write PHP code for the output given below

Number Square
5 25
4 16
3 9
2 4
1 1

d) Consider a Pay Computation Form for capturing and computing contract


employee salary. The form consist of the following fields:
 Employee Names

Library copy Page 1


 Enployee ID Number
 No. of days worked
 Daily pay Rate (Kshs)
The pay is given by = No. of days worked x Daily pay Rate.

A tax of 16% is deducted from pay to get the net pay.

Required:

i. Write the code for the form with ALL essential components. (6 Marks)

ii. Write the PHP code to receive the submitted details from the form, compute
gross pay, tax amount & net pay then display the computed values.
(8 Marks)

e) Outline ANY four core features of PHP languages. (4 Marks)

f) Using example, demonstrate how to declared and initialize variables in PHP


(2 Marks)
g) Write a PHP code for connecting web application to the MYSQL database server.
Include code for testing if the connection is successful. (5 Marks)

Question 2 (20 Marks)

a) What are comments? Explain two major types of comments supported by PHP.
Use examples (5 Marks)

b) Consider a web form for creating new system users. The form consists of the
following fields: First Name, Last Names, username and password.

Required;
i. Write PHP code for the form with ALL essential components to make the
form functional. (5 Marks)

ii. Write the PHP code for receiving and inserting new user details on the
table Users. The user should be informed that the user has been created
or not. (5 Marks)

c) Write an array program to print out the following items;

TV Phone Radio DVD CD-ROM

Library copy Page 2


Question 3 (20 Marks)

a) Explain phpMyAdmin. (2 Marks)

b) State four capabilities of phpMyAdmin (4 Marks)

c) Write a user defined function to calculate the workers’ pay. The function accepts
two arguments representing hours worked and pay per hour. (6 Marks)

d) Using switch case control structure, write a program requests user to input a
number in web form then return a day equivalent to that number as follows:
(8 Marks)
Number Day
1 Monday
2 Tuesday
3 Wednesday
4 Thursday
5 Friday
6 Saturday
7 Sunday

Question 4 (20 Marks)

a) Differentiate between client side and server side form validation. (4 Marks)

b) Write PHP code to validate web form to ensure that the field cannot be left empty
before submitting the form. (5 Marks)

c) Consider MySQL database that with a table – Customers

Table: Customers
CustID Names Address Product OrderValue
C001 Alex Were Nairobi Computers 150,000
C002 Mary Wangui Kisumu Phones 70,000
C003 Ann Mwere Eldoret TVs 56,000
C004 James Wango Nairobi Computers 200,000
C005 Peteron Joel Kisumu Radios 89,000

Library copy Page 3


i. Write the MySQL statement for inserting the first record on the table.
(5 Marks)

ii. Write the MySQL statement that retrieves only customers who have ordered for
computers only. (3 Marks)

iii. Write the MySQL statement to delete customers from Kisumu. (3 Marks)

Question 5 (20 Marks)

a) What is a web server? (2 Marks)

b) List 3 examples of Web Server software’s (3 Marks)

c) Discuss THREE advantages of dynamic web site over static web site.
(6 Marks)
d) (i) Write a PHP form code for a file named booking.php used for hotel booking.
The form consists of the following fields: (4 Marks)
i. Guest Names
ii. Gender
iii. Check in Date
iv. Check out Date
v. Type of Room (choose from Single, double, master)

(ii) Write the PHP code for a file named received.php which receives and prints
out the submitted from booking.php file above. (5 Marks)

Library copy Page 4

You might also like