Tribhuwan University

Institute of Science and Technology

Model

Bachelor Level / Third Year / Fifth Semester / Science

Bachelors in Information Technology (BIT301)

(Web Technology II)

Full Marks: 60

Pass Marks: 24

Time: 3 Hours

Candidates are required to give their answers in their own words as for as practicable.

The figures in the margin indicate full marks.

Section A

Long Answers Questions

Attempt any TWO questions.
[2*10=20]
1.
What is a function? How can you define and call a function in PHP? Write a PHP program to implement a function with parameters and return value.[10]
2.
How can you retrieve form data? Write a PHP program to create a form data that will take a Fahrenheit value as input and displays equivalent Celsius value on submit. The Celsius = (5/9)*(Fahrenheit-32).[10]
3.
What are casting operators? Differentiate for from foreach statement. Write PHP program to illustrate use of for and foreach.[10]
Section B

Short Answers Questions

Attempt any Eight questions.
[8*5=40]
4.
Write a PHP program to parse a CSV file. [5]
5.
Define error handling, error reporting and error suppression. [5]
6.
What is session? Write a PHP program for maintaining user data with sessions. [5]
7.
Write a PHP program to connect database and retrieve data from a table and display in a page. [5]
8.
How can you define class and object in PHP. Illustrate with example. [5]
9.
Write a PHP program that will read two input strings in variable fname and lname and display concatenation of fname and lname. [5]
10.
How can you define variable in PHP. Illustrate with example. [5]
11.
How conversion between array and variables is done? [5]
12.
Write a PHP program to illustrate string patterns using regular expression. [5]