Vous êtes sur la page 1sur 8

2011

Regulations:

BANNARI AMMAN INSTITUTE OF TECHNOLOGY


(An Autonomous Institution Affiliated to Anna University)

SATHYAMANGALAM 638 401

Question Bank Unit III


Department of Information Technology
Branch & Semester : B.Tech IT & VI
Subject Code & Title : 11I604 - Web Systems and Technology
Faculty Name

: A.Dennis Ananth / T.Prasanth

PART A
Marks

Q.
No.
1.

2.

3.

4.

Question

Thinking
Skill
(Blooms
Taxonomy)

R
What is the purpose of <noscript> tag in Java Script?
A) Prevents scripts on the page from executing.
B) Enclose text to be displayed by non JavaScript browsers.
C) Suppresses the result to be displayed on the web page.
D) Prevents scripts on the page and suppresses the result
The type of a variable that is volatile is
U
A) Volatile variable
B) Mutable variable
C) Immutable variable
D) Dynamic variable
A graphical HTML browser resident at a network client machine Q accesses a
(An)
static HTML webpage from a HTTP server S. The static HTML page has exactly
Gate
one static embedded image which is also at S. Assuming no caching, which one of
2014
the following is correct about the HTML webpage loading (including the
embedded image)?
A) Q needs to send at least 2 HTTP requests to S, each necessarily in a separate TCP
connection to server S
B) Q needs to send at least 2 HTTP requests to S, but a single TCP connection to server
S is sufficient
C) A single HTTP request from Q to S is sufficient, and a single TCP connection between Q
and S is necessary for this
D) A single HTTP request from Q to S is sufficient, and this is possible without any TCP
connection between Q and S
The generalised syntax for a real number representation is
(R)
A)
B)
C)

[digits][.digits][(E|e)[(+|-)]digits]
[digits][+digits][(E|e)[(+|-)]digits]
[digits][(E|e)[(+|-)]digits]

D)

[.digits][digits][(E|e)[(+|-)]digits]

5.

When there is an indefinite or an infinity value during an arithmetic value


computation, JavaScript
A) Prints an exception error
B) Prints an overflow error
C) Displays Infinity
D) Prints the value as such

(E)

6.

Which of the following is not considered as an error in JavaScript?

(U)

7.

8.

A)

Syntax error

B)

Missing of semicolons

C)

Division by zero

D) Semantic Error
The snippet that has to be used to check if a is not equal to null is
A)

if(a!=null)

B)

if (!a)

C)

if(a!null)

D)

if(a!==null)

Consider the code snippet given below .

(U)

(An)

var count = [1,,3];


What is the observation made?
A)
B)
C)

9.

The omitted value takes undefined


This results in an error
This results in an exception

D) Count with three values


Consider the following code snippet
var a1 = [,,,];
var a2 = new Array(3);
0 in a1
0 in a2
The result would be

(E)

10.

11.

12.

13.

14.

A) true false
B)
false true
C)
true true
D) false true
Consider the following code snippet :
if (!a[i]) continue;
What is the observation made?
A) Skips the undefined elements
B) Skips the non-existent elements
C) Skips the null elements
D) Skips the execution
Consider the following code snippet :
var a = [1,2,3,4,5];
a.slice(0,3);
What is the possible output for the above code snippet ?
A) Returns [1,2,3
B) Returns [4,5]
C) Returns [1,2,3,4]
D)
Returns [1,2,3,4,5]
The method or operator used to identify the array is
A) isarrayType()
B) ==
C) ===
D) typeof
The unordered collection of properties, each of which has a name and a value is
called
A) String
B) Object
C) Serialized Object
D) Class
Consider the following code snippet :
var book = {
"main title": "JavaScript",
'sub-title': "The Definitive Guide",
"for": "all audiences",
author: {
firstname: "David",
surname: "Flanagan"
}
};
In the above snippet, firstname and surname are
A)

properties

(An)

(E)

(Ap)

(R)

(Ap)

15.

B) property values
C) property names
D) objects
Consider the below given syntax
book[datatype]=assignment_value;
In the above syntax, the datatype within the square brackets must be
A)
B)
C)

16.

17.

18.

An integer
A String
An object

D) Decimal
Consider the following code snippet
function f() {};
The above prototype represents a
A)
B)
C)
D)

(An)

Function f
A custom constructor
Prototype of a function
Not valid Syntax

Identify the process done in the below code snippet


o = {x:1, y:{z:[false,null,""]}};
s = JSON.stringify(o);
p = JSON.parse(s);
A) Object Encapsulation
B) Object Serialization
C) Object Abstraction
D) Object Encoding
The basic purpose of the toLocaleString() is to
A)
B)
C)
D)

(U)

(E)

(R)

return a localised object representation


return a parsed string
return a local time in the string format
return a localized string representation of the object

19.

Which of the following is the correct way for writing Java Script array?
A) var salaries = new Array(1:39438, 2:39839 3:83729)
B) var salaries = new (Array1=39438, Array 2=39839 Array 3=83729)
C) var salaries = new Array(39438, 39839,83729)
D) var salaries = new Array() values = 39438, 39839 83729

(E)

20.

Which of the following syntax is correct to refer an external script called


formValidation.js?

(E)

A)

<script href = formValidation.js>

B)
C)
D)
21.

<script source = formValidation.js>


<script name = formValidation.js>
<script src = formValidation.js>

What is the alternate name for Java script?


A)
B)
C)
D)

(R)

LimeScript
ClientScript
ECMScript
ECMAScript

22.

How does Java Script store dates in objects of Date type?

(U)

23.

A) The number of days since 1st, 1900


B) The number of seconds since January 1st, 1970
C) The number of milliseconds since January 1st, 1970
D) The number of picoseconds since January 1st, 1970
Which attribute is used to hold the Java Script Version?

(U)

24.

25.

A) SCRIPT
B) VERSION
C) LANGUAGE
D) VER
Consider the following code snippet
function printArray(a)
{
var len = a.length, i = 0;
if (len == 0)
console.log("Empty Array");
else
{
do
{
console.log(a[i]);
} while (++i < len);
}
}
What does the above code result?
A) Prints the numbers in the array in order
B) Prints the numbers in the array in the reverse order
C) Prints 0 to the length of the array
D) Prints Empty Array
Consider the following code snippet
while (a != 0)
{
if (a == 1)

(E)

(U)

continue;
else
a++;
}
What will be the role of the continue keyword in the above code snippet?
A)
B)
C)
D)

The continue keyword restarts the loop


The continue keyword skips the next iteration
The continue keyword skips the rest of the statements in that iteration
No Execution

Q.
No.

Question

Thinking
Skill
(Blooms
Taxonomy)

How to allow scripts to run in files on your computer?

Create a javascript to display your name in a web page.

List the escape sequences available in javascript.

Is it possible to break JavaScript Code into several lines?

An

Identify and correct the errors in the following statement:


if ( c < 7 );
window.alert( "c is less than 7" );
Compute the product of the three integers contained in variables x, y and z, and
assign the result to the variable result using javascript.
State the order of evaluation of the operators in the following JavaScript
statements, and show the value of x after the evaluation.
x = ( 3 * 9 * ( 3 + ( 9 * 3 / ( 3 ) ) ) );
Identify the keywords that are reserved but not used in java script.

6
7

8
9

Ap
E

U
C

11

Write four JavaScript statements that each add 1 to variable x, which contains a
number.
What is wrong with the following while repetition statement?
while ( z >= 0 )
sum += z;
Cite the three control structures used in java script.

12

Give the synatx for the variants of repetition control structures.

13

Why should the XML documents be validated?

An

14

Demonstrate the XML Namespaces with an example.

Ap

15

Evaluate the following statement - "1"+2+4 and show the final result.

16

Define the term Google App Script.

17

What can Apps Script do?

18

Differentiate between XML Scriptlet and HTTP Scriptlets.

An

19

How you will add function as a property in a JavaScript object? Give example.

20

How to get the contents of an input box using Javascript?

10

An

PART
B

PART C

Q. No.

Question

1.

Write a script that asks the user to enter two numbers, obtains the two numbers
from the user and outputs text that displays the sum, product, difference and
quotient of the two numbers. Use the prompt dialog box technique.
What displays in the alert dialog when each of the given JavaScript statements is
performed?
Assume that x = 12 and y = 13.
a) window.alert( "x = " + x );
b) window.alert( "The value of x + x is " + ( x + x ) );
c) window.alert( "x =" );
d) window.alert( ( x + y ) + " = " + ( y + x ) );
Summarize the arithmetic operators used in JavaScript along with their order of
evaluation.
Write a script that reads an integer and determines and outputs HTML5 text that
displays whether its odd or even. [Hint: Use the remainder operator. An even
number is a multiple of 2.Any multiple of 2 leaves a remainder of zero when
divided by 2.]
Develop a class-averaging script that will process an arbitrary number of grades
each time the script is run.
Describe the selection control structures used in JavaScript with a neat flow chart
representation.
Explain the repetition control structures used in JavaScript with a neat flow chart
representation.
What are the essentials of counter controlled repetition in JavaScript? Explain
with sample script.
Give the syntax of for statement and Show the methods of varying the control
variable in a for statement.
Find the error in each of the following code segments, and explain how to correct
it:
a) x = 1;
while ( x <= 10 );
++x;
}
b) switch ( n )
{
case 1:
document.writeln( "The number is 1" );
case 2:
document.writeln( "The number is 2" );
break;
default:
document.writeln( "The number is not 1 or 2" );
break;
}
c) The following code should print the values from 1 to 10:
n = 1;
while ( n < 10 )
document.writeln( n++ );
How does a Switch statement differs from if else ladder? Explain with sample
scripts.
Assume that i = 1, j = 2, k = 3 and m = 2.What does each of the given statements
print? Are
the parentheses necessary in each case?
a) document.writeln( i == 1 );

2.

3.
4.

5.
6.
7.
8.
9.
10.

11.
12.

Thinking
Skill
(Blooms
Taxonomy)

Ap

U
Ap

C
U
U
R
An
An/E

An