You are on page 1of 6

B.E./B.Tech.

DEGREE EXAMINATION, NOVEMBER/DECEMBER 2007 Seventh Semester Computer Sciente and Engineering CS 1401 - INTERNET PROGRAMMING Time Three hours Maximum: 100 Marks Answer ALL questions PARTA(10 x 2=20 Marks) What is the primary function of an HTTP server? The server starts by sending a line of text giving its identify telling whether it is prepared to received mail. This is the primary ifinction of an HflP server. 2. What is the difference between an absolute pathname and a relative pathname? Absolute pathname specifies the correct path where the source is present. Relative pathname has only the reference to get source. 3. For each of the following, write down the value that will be stored in result; double result, mt numi = 5, num 2 = 12, num 3 = 2; double vail = 5.O,val 2 = 12.0, vat 3 = 2.0; a) result = num b) result = numi +++++ num2; Solution: a) Result=5x2x4%6=6 b) Itiswrong. 4. What is an important difference between writing a Java application and a Java applet? Applets are Java program that can be embedded on a web Page and run in a secure area or environment within a browser. This is the difference between Java and Applet. 5. What is the benefit of using Javascript code in an HTML document? 1. Javascript is powerful. 2. Simple 3. It has increased ftinctionality.

6. For the following form, write the Javascript code to swap the contents of the two text boxes. cFORMNAME = DaForm> Input texti ; <INPUT TYPE = TEXT NAME = A> Input text2 <INPUT TYPE = TEXT NAME = B> <FORM> Function swap (search) {

varA 10; varB = 20; var tmp; document.writeln (Exchanging); tmp = A; A=B; B = tmp; document.writeln (+A+); document.writeln (+B+); } 7. Which function can be used to create an alert popup dialog box? Write an example to create an alert popup box. <htm <head> <title> printing multiple lines in a dialog box </title> <script type text /javascript> window.alert (More lines); </script> </head> </htm 8. State the commands in cascading style sheet used for grouping of elements? 1. Tag classes 2. 10 attribute. Example: <P 10 = Use?> Here is a paragraph 9. What is servlet? How do you compare servlet and tranditional CGI programs? Servlets are dynamically loaded module that services the requests from a web server. It runs entirely inside the Java Virtual Machine. It does not depend on browser capability. Because servlet is running on the server side only. 10. How can you create JDBC statements? All the interfaces and classes necessary to implement JDBC remains in a package called java.sql.*.

This API has a single class called DriverManager and also the set of interfaces like statements.Resultset and connection. PARTB(5 x 16=80 Marks) 11. a) List the 5 layers used by the internet. For each layers you list, give the general purpose of each layer as well as a current implementation? Refer the Page No. 1.8 to 1.9 (OR) b) Explain the concept of TCP data transmission? Refer the Page No. 1.lOto 1.12 12. a) Write a program in Java that determines and prints the number of odd, even and zero digits in an integer value read from the keyboard? importjava.lO.*; class demo { public static void main (string a [ { string tmp = 120; Byte b [ = tmp.getBytes Q; ByteArray Inputstream bin = new ByteArray Inputstream b); for c in i = ; i <2 ; i++) { mc; while C(C = in.read Q) 0) count = count + 1; ..,... .t.&1nJ .(1a VAjJL system.Out.println (count); } for(inti=O;i<2;i++) { if((c mod 2) = = 0) { countl=countl +1; system.out.println c The number of ODD digits are); system.out.println (count 1); L)4r.zi

system.Out.println CThe number of 0s are:);

} else if 1) { count 2 = count 2+1 system .Out .print (The number of EVEN digits are); system.Out.println (count 2); } } } } (OR) b) What is the use of the applet? Explain its life cycle with an example? Refer the Page No.2.114 to 2.118 13. a) Write a Javascript function named drawstripes that will draw a number of colored stripes by generating an HTML table in which each row has a different color. Your function must accept three parameters? width, the width of each stripe height, the height of each stripe colors, an array in which each element is the name of a color name isa valid HTML, color <html> <head> <title> switch case </title> <script type = text /javascript> var str; str = window.prompt (please enter your stripe Number:ln +lO 1,102,103); switch ( str) { case 101: document.writeln (< h2> stripe No: 101 <br> width : 100<br >height: 150< br> color: Blue </h2>); break; case 102; document.writeln (<h2>stripeNo: 103 <br>

width :200<br>height ;250<br>color:Red< /h2>); break; case 103 document.writeln ( <h2>stripeNo: 103 <br> width:300 <br> height;350<br>color:Black< 1h2>); break; default; document.writeln ( <h2 > Invalid < 1h2 >); } </script> </head> <body> </body> </html> (OR) b) Explainhow you could use HTML frames to provide awebsite that includes an advertisementler your company along with the content from any other webpage. Showthat HTML you woujd need to do this, assume that for your example the other web Page is www.yahoo.com. Make sure that you explain how this works. <html> <head> <title > prompt box </title> <script type = text /javascript> var name; name = window.prompt (please enter your name,Hi); document.writein (<hi> Hello +name+, welcome to xxxsuper company </hi>), document.writeln (<hi> It gives best products only! <hi>); document.writeln (<hi >Reference;www.yahoo.com <hi>); </script> <head> <body> </body> <htm 14. a) Write a program using cascading style sheet (CSS) to display the background image repeatedly in a file? <html> <head> <title> linked style </title> <head> <body style background image:Ur(wfall.gif);

background repeat repeat; fontstyle :italic; font family A <hi style = color:orange>hi welcome to our Page <hi> a </body> <html> (OR) b) Describe the use of data binding and data control in DHTML? Refer the Page No.4.30 to 4.33 15. a) Explain Java seviet life cycle and interfaces in detail? Refer the Page No.5.3 to 5.10 (OR) b) Describe the operation of retrieval of a webPage with its associated messages using HTTP? Refer the Page No.5.54 to 5.55

You might also like