Академический Документы
Профессиональный Документы
Культура Документы
Regulations:
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.
(E)
6.
(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)
(U)
(An)
9.
(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
(U)
(E)
(R)
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.
(E)
A)
B)
C)
D)
21.
(R)
LimeScript
ClientScript
ECMScript
ECMAScript
22.
(U)
23.
(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)
Q.
No.
Question
Thinking
Skill
(Blooms
Taxonomy)
An
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
13
An
14
Ap
15
Evaluate the following statement - "1"+2+4 and show the final result.
16
17
18
An
19
How you will add function as a property in a JavaScript object? Give example.
20
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