Beruflich Dokumente
Kultur Dokumente
Spring 2010
CS101- Introduction to Computing (Session - 2)
Time: 90 min
Marks: 58
Student Info
StudentID:
Center:
Q No. 9 10 11 12 13 14 15 16
Marks
Q No. 17 18 19 20 21 22 23 24
Marks
Q No. 25 26 27 28 29 30 31 32
Marks
Q No. 33 34 35 36
Marks
Question No: 1 ( Marks: 1 ) - Please choose one
a = Math.ceil(12.01)
► 12
► 13 (correct)
► 12.0
► 13.01
_____________ errors are caused by the code that somehow violates the
rule of the language.
► Syntax (correct)
► Semantic
► Run time
► Load time
► Space
► Time (correct)
► Memory and time
► Bandwidth
Question No: 17 ( Marks: 1 ) - Please choose one
► Entity
► Name (correct)
► Interpreter
Question No: 21 ( Marks: 1 ) - Please choose one
__________ means you have only one container to store more than one
value in JavaScript.
► Variable
► Matrix
► Array ( 80 % SURE)
► String
In JavaScript, what is event handling? What are the two types of events?
• The Web (as it currently exists) was designed for humans to read,
not for computers to understand and manipulate meaningfully
• Computers face great problems in dealing with the current text-
and graphics-based content of the Web
The event handler attribute consists of three parts. Write about each of
them.
The identifier of the event handler
The equal sign
A string consisting of JavaScript statements enclosed in double
or single quotes
Used for
scientific research,
artistic expression,
for industrial applications
What are the important properties, methods and event handlers of image
object?
Example1:- (preloading)
dieImg = new Array( 7 ) ;
for( k = 1; k < 7; k = k + 1 ) { //Preload images
dieImg[ k ] = new Image( ) ;
dieImg[ k ].src = "die" + k + ".gif" ;
Example 2:-
dieImg = new Array( 7 ) ;
for( k = 1; k < 7; k = k + 1 ) { // Preload images
dieImg[ k ] = new Image( ) ;
dieImg[ k ].src = "die" + k + ".gif" ;
}
Example:
Function add(a, b) {
C= a + b ;
Return c ;