Académique Documents
Professionnel Documents
Culture Documents
Get more stuff like.. Assignments, Documents, PC tips and tricks, Widescreen wallpapers,Learning videos,Open source software,Latest cool icons
packs,Important web links and whatever you want...
Follow @ss731382
Welcome to..www.sslifehacker.blogspot.in
Home
Blog Archive
Showing posts with label solved Answers Bsc.IT -52. Show all posts
January (2)
December (7)
November (2)
October (1)
August (3)
May (4)
April (9)
http://sslifehacker.blogspot.in/search/label/solved%20Answers%20Bsc.IT%20-52
MENU ITEMS
4th sem
6 Sem KU Lab
Practical
Assignments
Cracking Pass
(2)
Documents
Downloads
GNIIT Sem C E
(1)
ibps
Icons Pack
Notification
PRACTICAL
solved Answer
-51 (1)
1/25
8/21/2014
solved Answer
-52 (1)
solved Answer
-53 (1)
solved Answer
-54 (1)
solved Answer
-61 (1)
solved Answer
-62 (1)
solved Answer
-63 (1)
solved Answer
-64 (1)
RECENT POSTS
NIIT
How to Recove
Window s 7 Pas
explained how
recover the los
passw ord
usingBacktrack
Passw ord
Here i am going
introduce a new
named as Wind
Passw ord Kille.
Tw itter
10. What is the difference between a scripting language and a programming language?
Ans:
The main difference is that programming languages are generally compiled whereas scripting languages are interpreted.
11. What is Extranet?
Ans:
Unlike Intranet, Extranet allows outside access to local resources.
12. Does HTTP support only two methods - Get and Post?
Ans:
No, HTTP also supports more methods. For example, it supports the HEAD method, which is similar to the GET method but
does not return the message body in the response. It only returns the headers.
----------------------------------------------------------------------------------------------------------
Follow by Em ail
Email address..
Total Pageview s
1 2
http://sslifehacker.blogspot.in/search/label/solved%20Answers%20Bsc.IT%20-52
2/25
8/21/2014
http://sslifehacker.blogspot.in/search/label/solved%20Answers%20Bsc.IT%20-52
3/25
8/21/2014
http://sslifehacker.blogspot.in/search/label/solved%20Answers%20Bsc.IT%20-52
4/25
8/21/2014
The unordered list is a bulleted list and represented by the <UL> tag in HTML. You can use the tag's TYPE attribute to change the
style of the bullets in the list. The <LI> tag is used for individual items of the list. Unordered lists are usually used to represent
various items of a category or related to a topic. An example of an unordered list is given below:
The various types of domestic animals are:
<UL>
<LI>Dogs</LI>
<LI>Cats</LI>
<LI>Horses</LI>
</UL>
FAQ
23. What is <META> tag and why is it used?
Ans:
<META> tag is a special tag, which is used to provide the information about the document under which it is embedded. It is
primarily used for listing keywords and summary associated with a Web page. Search engine spiders use this information while
indexing a page.
24. How can you include e-mail functionality in HTML pages?
Ans:
Hyperlink to an email is created using anchor <a> tag itself but email address has to be preceded with mailto. For example,
<a href="mailto:abc@dummy.com">Click to send mail</a>
This will create a hyperlink. When you click on this hyperlink, your default e-mail client will open with the specified address in the
To field.
25. What is SGML?
Ans:
SGML or Standardized Generalized Markup Language is, a language and a standard to define other markup languages. HTML is
based upon it
26. Which other markup language are based on SGML?
Ans:
CML (Chemical Markup Language) provides tags that can be rendered as chemical symbols; MathML (Mathematical Markup
Language) provides tags that can be rendered as mathematical expressions.
----------------------------------------------------------------------------------------------------------Solutions to Chapter Three Questions
27. What is Java Script? List out uses of Java Script.?
Ans.
JavaScript is a scripting language used to make interactive web pages. It is mostly used as a client side scripting language. Its
uses include:
n Control document appearance and content
n Control the browser
n Interact with document content
n Interact with user
n Read and write client state with cookies
n Interact with applets
n Manipulate embedded images
28. Create an HTML page, which pops up an alert message.
Ans.
Following HTML pops up an alert message:
<html>
<head>
<title>Pop up</title>
</head>
<body>
<h1>Trying Pop-ups</h1>
<script language = "JavaScript">
alert("This is an alert message. It uses alert() in JavaScript");
</script>
</body>
</html>
29. Explain briefly about Cascading Style Sheets (CSS).
Ans.
CSS controls the look and placement of elements on a page. With CSS you can set any style property of any element on a HTML
page. One of the biggest advantages with CSS instead of regular way of changing the look of elements is that you can split content
from design. You can, for instance, link a CSS file to all the pages in your site that sets the look of the pages. So if you want to
change the elements on the page, such as font size of the main text, you can just change it in the CSS and all the pages will be
updated.
The syntax of CSS code is:
<style type ="text/css">
ELEMENT [{property1:value1:property2:value2}]
</style>
http://sslifehacker.blogspot.in/search/label/solved%20Answers%20Bsc.IT%20-52
5/25
8/21/2014
http://sslifehacker.blogspot.in/search/label/solved%20Answers%20Bsc.IT%20-52
6/25
8/21/2014
JavaScript has navigator object to reference browser's property. Browser's name can be obtained using navigator.appName
and its version can be obtained using navigator.appVersion.
--------------------------------------------------------------------------------------------------------Solutions to Chapter Four Questions
41. What is CGI ?Give examples of CGI application and explain any one of them?
Ans.
Common Gateway Interface is a specification, which allows Web users to run programs from their computers. CGI is not a
programming language but rather a specification that allows programs and scripts written in other language to be run over the
Internet.
42. What are CGI environment variables? Explain any five.
Ans.
Most of the information about the client, server, and user input is placed and made available through globally accessible variables
known as CGI environment variables. Some of the commonly used environment variables are:
n QUERY_STRING: The query information passed to the program. It is appended to the URL with a ? when the browser sends it to
the server. The name value pairs are then stored in this environment variable.
n SERVER_PROTOCOL: The name of and revision of the information protocol that the request came in with.
n REQUEST_METHOD: The method with which the information request was issued.
n HTTP_USER_AGENT: The browser used by the client to issue the request.
n CONTENT_LENGTH: The length of the data in bytes passed to the CGI program through the standard input.
43. Give difference between JavaScript and CGI programming.
Ans.
JavaScript is a scripting language whereas CGI itself is a standard, which uses various other programming languages. JavaScript is
used mainly on the client side whereas CGI programming is used to implement server side scripting. In addition, JavaScript is
embedded in HTML documents whereas CGI programs reside in their own independent files.
44. Explain CGI.pm module with an example.
Ans.
PERL supports various add-on modules, which are libraries of functions that perform specific tasks. These are called standard
library modules. CGI.pm is a standard library module, which provides various functions. To include the CGI.pm module in your PERL
script, you have to use the "use" command after the #!/perl/bin/perl line and before any other code:
use CGI qw(:standard);
After including CGI.pm you can call its functions such as header, which prints the Content-type header.
45. Explain different types of PERL variables.
Ans.
PERL variables are of the following three types:
n Scalars: A scalar variable stores a single value of any type. Scalar variables are prefixed with a $. These variables need not be
declared before using them. You can define or use a variable as:
$var =1;
$var_noval;
$str = "This is a scalar string variable";
n Arrays: Arrays store an ordered list of values. Arrays can be declared as:
@emptyarr =();
@arr = ("1", "2","3");
Each individual item of an array is referred to by its index number as:
print "$arr[0]";
You can use the push() and pop() functions to insert or delete an element from an array.
n Hashes: A Hash is a special kind of an array - an associative array or paired list of elements. Each pair in a Hash consists of a
string key and data value. A hash is defined as:
%emptyhs = ();
%hs = ("key1", "val1", "key2", "val2");
or
%hs = (key1 => "val1",
key2=> "val2");
An individual item of a Hash is referred to as $hs{"key1"};
The my function can be used with each of the above type of variables to declare and limit the scope of the variable to the enclosing
block as:
my $var;
http://sslifehacker.blogspot.in/search/label/solved%20Answers%20Bsc.IT%20-52
7/25
8/21/2014
http://sslifehacker.blogspot.in/search/label/solved%20Answers%20Bsc.IT%20-52
8/25
8/21/2014
}
print $cgi->end_html;
Save the file as ques9.pl.
Note
Students need to know the IIS configuration for running perl
applications.
50. Write a CGI application that accepts 3 numbers from the users and displays the LCM of three numbers using GET
and POST methods.
Ans.
#!/usr/bin/perl
#print "Content-type:text/html\n\n";
#$form = $ENV{'QUERY_STRING'};
use CGI;
$cgi = new CGI;
print $cgi->header;
print $cgi->start_html( "Question Ten" );
my $one = $cgi->param( 'one' );
my $two = $cgi->param( 'two' );
my $three = $cgi->param( 'three' );
if( $one && $two && $three )
{
$lcm = &findLCM( &findLCM( $one, $two ), $three );
print "LCM is $lcm";
}
else
{
print '<form action="ques10.pl" method="post"><pre>';
print 'Enter First Number <input type="text" name="one"><br>';
print 'Enter Second Number <input type="text" name="two"><br>';
print 'Enter Third Number <input type="text" name="three"><br>';
print '<input type="submit" value="Submit"><br>';
print "</pre></form>";
}
print $cgi->end_html;
sub findLCM()
{
my $x = shift;
my $y = shift;
my $temp, $ans;
if ($x < $y) {
$temp = $y;
$y = $x;
$x = $temp;
}
$ans = $y;
$temp = 1;
while ($ans % $x)
{
$ans = $y * $temp;
$temp++ ;
}
return $ans;
}
Save the file as ques10.pl.
Note
Students need to know the IIS configuration for running perl
applications.
51. What is Extra Path information? Explain with an example.
Ans.
Besides passing query information to a CGI script, you can also pass additional data known as extra path information as part of the
URL. The server gauges where the CGI program name ends; anything following that is deemed as extra path information and stored
in the PATH_INFO environment variable. For example the following line calls a script with extra path information:
http://some.machine/cgi0bin/display.pl/cgi_doc.txt
FAQ
52. What is FastCGI?
Ans:
FastCGI is an enhancement over CGI. Instead of creating a new process for every request, FastCGI uses the same process and
http://sslifehacker.blogspot.in/search/label/solved%20Answers%20Bsc.IT%20-52
9/25
8/21/2014
http://sslifehacker.blogspot.in/search/label/solved%20Answers%20Bsc.IT%20-52
10/25
8/21/2014
http://sslifehacker.blogspot.in/search/label/solved%20Answers%20Bsc.IT%20-52
11/25
8/21/2014
http://sslifehacker.blogspot.in/search/label/solved%20Answers%20Bsc.IT%20-52
12/25
8/21/2014
http://sslifehacker.blogspot.in/search/label/solved%20Answers%20Bsc.IT%20-52
13/25
8/21/2014
88. Draw a class diagram to show the relationship between major classes in the servlet API.
Ans.
The class diagram is shown as here:
Class Diagram
89. What are the advantages of using servlets to extend server functionality?
Ans.
Following are the advantages of using servlets:
1.
It helps to achieve platform independence.
2.
It provides performance improvement as classes stays in the memory once called.
3.
It is much more secure over traditional server side languages. For example, no problems of memory leakages and buffer
overflows are faced in case of servlets.
4.
It uses Java's multithreading capabilities, which gives it a performance gain.
90. Describe the request handling cycle and the methods invoked on the servlet by the servlet container.
Ans.
Following are the operations done on a servlet by servlet container when a servlet is requested:
1.
If servlet instance does not exist in memory, the container:
a.
Loads the servlet class and thus creates its instance
b.
Calls the init() method on the above class and passes ServletConfig as parameter
http://sslifehacker.blogspot.in/search/label/solved%20Answers%20Bsc.IT%20-52
14/25
8/21/2014
91. Which class provides methods of reading the parameters submitted by a client?
Ans.
There is no class for this but HttpServletRequest interface provides methods getParameter(), getParameterValues(), and
getParameterMap() for obtaining parameters submitted by client.
92. Which class provides methods of reading the parameters specified in the deployment descriptor file?
Ans.
ServletConfig class provides methods getInitParameter() and getInitParameterNames() for reading parameters specified in
deployment descriptor.
93. Which streams are used for sending the contents of the entity-body in the response?
Ans.
ServletOutputStream is used for sending contents in response, if the data is binary. It extends the OutputStream class. Its object is
normally obtained by calling HttpServletResponse.getOutputStream.
For sending character data PrintWriter class is used, which extends the Writer class. Its object is obtained by calling the
HttpServletResponse.getWriter() method.
94. Outline the main steps in implementing the servlet.
Ans
Following are the steps used in implementing a servlet for HTTP communication:
1.
Import required servlet packages in the class.
2.
Make the class extend HttpServlet.
3.
Override methods doGet(), doPost(), or doService() as required by problem in hand.
4.
Make an entry for the above servlet in deployment descriptor.
5.
Configure any extra options or filters, which are required by the server to function.
95. Explain the semantics of the HTML FORM element.
Ans.
The HTML form element represents a form in which users can input data and submit it to the server for processing. The HTML form
tag is as follows:
<FORM NAME="name" ACTION = "action.jsp" METHOD = "POST/GET">
The name attribute specified the name for a form. The action attribute specified the URL of the document or the name of the file to
which the form data is submitted for action and the method attribute specified the HTTP method through which the data is sent to
the server.
The action attribute can be a simple static Web page or a servlet. The method can be POST or GET.
A form includes various other <INPUT> elements such as textbox, list, buttons, or checkboxes.
96. Which statements are true.
1.
A web application can have more than web.xml.
2.
The HTTPServlet class implements the ServletConfig interface.
3.
The HTTPServlet class implements the ServletContext interface
4.
In a doHttpServletMethodName( ) method, the request and the response objects can be manipulated in any order.
5.
The servlet configuration can change from request to request.
6.
The servlet context can change from request to request.
7.
The servlet element must occur before the servlet-mapping in an element in web.xml file.
The servlet-class element must specify the full package name of the servlet class.
Ans:
1.
False
2.
True
3.
False
4.
True
5.
False
6.
False
7.
True
8.
True
FAQ
97. How can you write messages in server log using servlet API? In Tomcat, logs are stored in which directory?
Ans:
ServletContext can be used for logging messages to the server log. One of the major advantages of using logging is that while
printing an exception, the complete stack trace is written in the log. Following snippet explains logging:
ServletContext con = getServletContext();
con.log( "logging is good" );
try
{
throw new Exception( "exception" );
}
catch( Exception e )
{
con.log( e ); //will write e.printStackTrace() in log
}
In Tomcat, logs are stored in logs directory.
98. While sending a file from a servlet response, which header should be set to tell the browser that it should prompt
user to save this file and not to display it in browser window?
Ans:
Content-Disposition header is required to be set for this purpose as:
http://sslifehacker.blogspot.in/search/label/solved%20Answers%20Bsc.IT%20-52
15/25
8/21/2014
http://sslifehacker.blogspot.in/search/label/solved%20Answers%20Bsc.IT%20-52
16/25
8/21/2014
http://sslifehacker.blogspot.in/search/label/solved%20Answers%20Bsc.IT%20-52
17/25
8/21/2014
http://sslifehacker.blogspot.in/search/label/solved%20Answers%20Bsc.IT%20-52
18/25
8/21/2014
------------------------------------------------------------------------------------------------------------
132. Write an example HTML page containing a table 4 X 3 and each row colored
differently.
Ans. The following is an HTML page containing a table 4 X 3 and each row colored differently:
<html>
<head>
<title>Colored Table</title>
</head>
<body>
<table border="1" width="100%">
<tr bgcolor="#0000FF">
<td width="33%"> </td>
<td width="33%"> </td>
<td width="34%"> </td>
</tr>
<tr bgcolor="#00A0FF">
<td width="33%"> </td>
<td width="33%"> </td>
<td width="34%"> </td>
</tr>
<tr bgcolor="#AB00FF">
<td width="33%"> </td>
<td width="33%"> </td>
<td width="34%"> </td>
</tr>
http://sslifehacker.blogspot.in/search/label/solved%20Answers%20Bsc.IT%20-52
19/25
8/21/2014
http://sslifehacker.blogspot.in/search/label/solved%20Answers%20Bsc.IT%20-52
20/25
8/21/2014
Foreach loop: It is used for iterating over a list of values. The elements of an array can be iterated over using
foreach as:
Foreach my $i(@arr)
{
$arr[$i] = $i; //set the value of each element of array to its index number
}
3.
For loop: It is used to repeatedly perform an action. It uses a three-part conditional consisting of the loop
initializer, the loop condition, and the loop reinitializer. For example, to perform an action such as printing use the
for loop as:
for($i=0;$i<10;$i++)
{
print "$i";
}
This will print numbers from 0 to 9.
4. While loop: It is also used to perform an action repeatedly as long as a Boolean expression evaluates to true as:
$i=0;
while ($i<10)
{
print "$i";
}
This will print numbers from 0 to 9.
5.
Until loop: This performs the reverse action of the while loop. It executes as long as a Boolean expression is
NOT true. For example:
$i=0;
until ($i>=10)
{
print "$i";
}
This will print numbers from 0 to 9.
139. What is Query String? Explain with an example.
Ans. The form data appended to a URL following a ? is called a query string. For example:
http://www.myweb.com?username=smith&password=juyhy
In the above URL, the form field 'username', whose value is 'smith', and field 'password' whose value is 'juyhy', are appended to the
URL after '?'. They form the query string. Query string comprises of name-value pairs. Each name value pairs is separated by &.
Spaces between values are encoded as + and other special characters are encoded as their ASCII value preceded by a %.
140. Write a simple CGI application, which accepts the user information and displays the Information entered to the
user?
Ans. #!/usr/bin/perl
#print "Content-type:text/html\n\n";
#$form = $ENV{'QUERY_STRING'};
use CGI;
$cgi = new CGI;
print $cgi->header;
print $cgi->start_html( "Question Nine" );
$text = $cgi->param( 'text' );
if( $text )
{
print "You entered $text";
}
else
{
print '<form action="ques9.pl" method="get">';
http://sslifehacker.blogspot.in/search/label/solved%20Answers%20Bsc.IT%20-52
21/25
8/21/2014
http://sslifehacker.blogspot.in/search/label/solved%20Answers%20Bsc.IT%20-52
22/25
8/21/2014
Class Diagram
149. What are the advantages of using servlets to extend server functionality?
Ans. Following are the advantages of using servlets:
1. It helps to achieve platform independence.
2. It provides performance improvement as classes stays in the memory once called.
3. It is much more secure over traditional server side languages. For example, no problems of memory
leakages and buffer overflows are faced in case of servlets.
4. It uses Java's multithreading capabilities, which gives it a performance gain.
150. Describe the request handling cycle and the methods invoked on the servlet by the servlet container.
Ans. Following are the operations done on a servlet by servlet container when a servlet is requested:
1. If servlet instance does not exist in memory, the container:
a. Loads the servlet class and thus creates its instance
b. Calls the init() method on the above class and passes ServletConfig as parameter
2. On any further request service() method of servlet class is called and HttpServletRequest and
HttpServletResponse are passed as parameters to it.
151. Which class provides methods of reading the parameters submitted by a client?
Ans. There is no class for this but HttpServletRequest interface provides methods getParameter(), getParameterValues(), and
getParameterMap() for obtaining parameters submitted by client.
152. Which class provides methods of reading the parameters specified in the deployment descriptor file?
Ans. ServletConfig class provides methods getInitParameter() and getInitParameterNames() for reading parameters specified in
deployment descriptor.
153. Which streams are used for sending the contents of the entity-body in the response?
Ans. ServletOutputStream is used for sending contents in response, if the data is binary. It extends the OutputStream class. Its
object is normally obtained by calling HttpServletResponse.getOutputStream.
For sending character data PrintWriter class is used, which extends the Writer class. Its object is obtained by calling the
HttpServletResponse.getWriter() method.
154. Outline the main steps in implementing the servlet.
Ans Following are the steps used in implementing a servlet for HTTP communication:
1. Import required servlet packages in the class.
2. Make the class extend HttpServlet.
3. Override methods doGet(), doPost(), or doService() as required by problem in hand.
4. Make an entry for the above servlet in deployment descriptor.
5. Configure any extra options or filters, which are required by the server to function.
155. Explain the semantics of the HTML FORM element.
Ans. The HTML form element represents a form in which users can input data and submit it to the server for processing. The HTML
form tag is as follows:
<FORM NAME="name" ACTION = "action.jsp" METHOD = "POST/GET">
The name attribute specified the name for a form. The action attribute specified the URL of the document or the name of the file to
which the form data is submitted for action and the method attribute specified the HTTP method through which the data is sent to
the server.
The action attribute can be a simple static Web page or a servlet. The method can be POST or GET.
A form includes various other <INPUT> elements such as textbox, list, buttons, or checkboxes.
156. Explain in brief how to use hidden controls in a web page? Give an example.
Ans. Using HTML, hidden controls are an easy way to store data in a Web page. You can store data in a hidden control and then
refer to the value of control wherever required. Hidden controls are often used when you submit a form to itself. That is if your form's
ACTION attribute is set to the same page which contains the form. In this case, every time the page loads you have to determine
whether it is being loaded afresh or after a submission. For this, you can store a text value such as "DONE" in a hidden control
SUBMIT_STATUS, and check for it whenever the page loads. If request.getParameter(SUBMIT_STATUS) returns a NULL value, it
means that the form is being loaded afresh.
This logic is demonstrated in the following code:
http://sslifehacker.blogspot.in/search/label/solved%20Answers%20Bsc.IT%20-52
23/25
8/21/2014
No comments:
Home
Older Posts
Subscribe To
Posts
http://sslifehacker.blogspot.in/search/label/solved%20Answers%20Bsc.IT%20-52
24/25
8/21/2014
Satyendra Sharma
Add to circles
10 have me in circles
Labels
4th sem (1) 6 Sem KU Lab Practical (1) Assignments
Sem C Elective . (1) ibps (2) Icons Pack (2) Notification (1)
PRACTICAL
Bsc.IT -51 (1) solved Answers Bsc.IT -52 (1) solved Answers Bsc.IT -53 (1) solved Answers Bsc.IT -54 (1) solved Answers Bsc.IT -61 (1) solved Answers Bsc.IT -62 (1) solved Answers Bsc.IT -63 (1) solved Answers Bsc.IT -64 (1)
http://sslifehacker.blogspot.in/search/label/solved%20Answers%20Bsc.IT%20-52
25/25