Bit2210:Internet Programming Question Paper
Bit2210:Internet Programming
Course:Bachelor Of Information Technology
Institution: Meru University Of Science And Technology question papers
Exam Year:2013
1
a. Define the following terms: (6 Marks) i. Exception ii. Style sheet iii. Servlet b. Describe the lifecycle of a servlet. (6 Marks) c. How do you add components to a JApplet? What is the default layout manager of the content pane of JApplet? (4 Marks) d. What does the JVM do when an exception occurs? How do you catch an exception? (4 Marks) e. Describe three internet connection methods. (6 Marks) f. What are differences between CGI and servlets? (4 Marks)
QUESTION TWO – 20 MARKS
a. What are the differences between the GET and POST methods in an HTML form? (4 Marks) b. Outline any four benefits of using client side programming in any internet applications. (4 Marks) c. Describe any two methods of inserting CSS in a HTML document. (4 Marks) d. Write JavaScript code that will validate the following HTML form elements: (8 Marks)
2
QUESTION THREE – 20 MARKS
a. Describe the four basic methods that constitute the lifecycle of an Applet. (8 Marks) b. Write a servlet program that generates the following HTML form and on clicking the submit button will sent it to a database, SRegDB in a table Registration. (12 Marks)
QUESTION FOUR – 20 MARKS
a. To compile a servlet program, what library file has to be included in the classpath? (2 Marks) b. What output stream should you use to sent images to the browser? What content type do you have to set for the response? (4 Marks) c. Write a servlet that enables the user to change the password from an HTML form as shown in the figure (a) below. Suppose that the user information is stored in a database table named account with three columns, username, password and name where name is the real name of the user. The servlet performs the following tasks: i. Verify that the username and old password are in the table. If not, report the error and redisplay the HTML form (4 Marks) ii. Verify that the new password and the confirmed password are the same. If not, report this error and redisplay the HTML form. (4 Marks) iii. If the user information is entered correctly, update the password and report the status of the update to the user, as shown in figure (b). (4 Marks)
3
QUESTION FIVE – 20 MARKS
a. Describe the importance of the following objects: HTTPServletRequest and HTTPServeletResponse. (4 Marks) b. Write a Java applet that views, inserts and updates staff information stored in a database as shown in the figure below. The view button displays a record with a specified ID. The staff table is created as follows:
create table Staff ( id char(9) not null, lastName varchar(15), firstName varchar(15), mi char(l), address varchar(20), city varchar(20), state char(2), telephone char(10), email varchar(40), primary key (id) ); (16 Marks)
More Question Papers