Your browser does not support JavaScript. You will need to view non-JavaScript portions of this page.

COP 2822: Fall Term 2003 On-Line Quizzes

In order to forward you your test results please enter your name & email address below:

Enter First Name followed by a space then your Last Name here:


Enter E-mail Address here:



Tutorial Two: Variables, Functions, Objects, and Events

Tutorial 2 Quiz Masters:

Marcelle Bessman (mbessma@ju.edu) [Text Input]

John Taylor (jtaylor@hcc.cc.fl.us) [Consultant]


Multiple Choice [One Answer Only]

Please Note that this test may have errors. Please note all errors in the: I have discovered that...Section below.

Question 1

An image that is divided into regions, each of which is associated with an URL is called a(n)

a) object
b) global variable
c) image map
d) composite image


Question 2

The event that occurs when a mouse is moved off a link is the

a) MouseOver
b) MouseOff
c) MouseOut
d) MouseClear


Question 3

In JavaScript, boolean, class, extends, and import, are all examples of

a) functions
b) variables
c) objects
d) keywords


Question 4

Values stored in computer memory that are updated or read by computer programs are

a) image maps
b) variables
c) functions
d) parameters


Question 5

The reserved word used to declare a variable in JavaScript is

a) var
b) create
c) define
d) declare


Question 6

Multiple variables can be declared in the same statement by separating each set of variables by

a) colons
b) semicolons
c) commas
d) tabs


Question 7

Which one of the following names would be invalid to use as a variable name?

a) 5colors
b) _5colors
c) &5colors
d) A5colors


Question 8

A JavaScript _______allows you to treat a related group of JavaScript statements as a single unit.

a) object
b)variable
c) class
d) function


Question 9

Which of the following statements is a valid function definition?

a) function myFunction(parameters)[statements.]
b) function myFunction(parameters){statements.}
c) function myFunction(parameters)(statements.)
d) function{myFunction(parameters) statements.}


Question 10

The values placed within the parentheses that follow a function name are called arguments, or

a) objects
b) tokens
c) parameters
d) reserved words


Question 11

Once a function has been defined, to execute the function you must

a) call it from elsewhere in the program.
b) load it from the function folder.
c) click the Start button and select the function.
d) none of the above.


Question 12

The term "passing arguments" refers to

a) skipping variables that don't meet specific criteria.
b) sending values or variables to a called function.
c) a variable was tested and passed the condition being tested for.
d) skipping sections of a program based on variable values.


Question 13

A programmer can ensure that a JavaScript function will be created before it is executed by

a) defining the function in the <BODY> section and the call in the <HEAD> section.
b) storing it in an external file.
c) defining the function in the <HEAD> and the call in the <BODY> section.
d) assigning a higher priority to the function definition than to the call statement.


Question 14

Although not required, it is easier to understand and debug a program if the variable names are

a) all lowercase
b) all uppercase
c) used repeatedly in multiple functions
d) unique


Question 15

In an object-oriented programming language, a structure that contains procedures, data, and other attributes, is called a

a) method
b) function
c) prototype
d) class


Question 16

The two types of elements in a constructor function are

a) objects and methods
b) methods and functins
c) properties and methods
d) methods and classes


Question 17

In JavaScript, any _______called from within an object is called a method.

a) class
b) constructor
c) property
d) function


Question 18

The keyword "this" can be used in a constructor function to refer to the current __________that called the function.

a) class
b) object
c) method
d) function


Question 19

The keyword used to create an object from a constructor function is

a) create
b) open
c) new
d) define


Question 20

Which of the following statements illustrates the correct way to access an object's property?

a) object:property=value
b) object.property=value
c) object_property=value
d) object&&property=value


Question 21

Functions associated with a particular object are

a) function methods
b) object classes
c) class functions
d) object methods


Question 22

The term that determines where a variable can be used in a program is known as the

a) variable visibility
b) variable scope
c) variable window
d) variable precedence


Question 23

A variable defined with a function and only available within the function is a _______ variable.

a) global
b) volatile
c) local
d) static


Question 24

JavaScript makes it easy to add interactivity between a Web page and its users through the use of

a) macros
b) prompts
c) events
d) objects


Question 25

A(n) ________ occurs only after an HTML document has been fully rendered by the Web browser and is frequently used to execute some visual effect or animation.

a) load event
b) initializing event
c) page done event
d) none of the above


Question 26

Code that is executed in response to the occurrence of an event is a(n) _______ method.

a) event parser
b) system monitor
c) interrupt handler
d) event handler


Question 27

The JavaScript alert() method

a) causes the computer's speaker to beep
b) displays a dialog box with an Ok and a Cancel button.
c) displays a dialog box with an Ok button.
d) displays a message telling you the program has crashed.


Question 28

Event handlers in JavaScript have the same name as the event itself except they are preceded by the word

a) when
b) if
c) on
d) do


Question 29

A custom message can be displayed in a browser's status bar by using JavaScript's ______ property.

a) message
b) status
c) newtext
d) textvalue


Question 30

The dialog box with the Ok and Cancel buttons shown in Figure 2-17 is the _____ dialog box.

a) alert
b) confirm
c) prompt
d) verify




True/False Questions


Question 31

Reserved words can be used for variable names as long as they are in lowercase.

a) The statement above is TRUE.
b) The statement above is FALSE.



Question 32

The var keyword must be used to declare a variable.

a) The statement above is TRUE.
b) The statement above is FALSE.



Question 33

The value assigned to a variable can be either a literal string or a numeric value.

a) The statement above is TRUE.
b) The statement above is FALSE.



Question 34

A procedure is called a function in JavaScript.

a) The statement above is TRUE.
b) The statement above is FALSE.



Question 35

A JavaScript function must be defined with at least one parameter.

a) The statement above is TRUE.
b) The statement above is FALSE.



Question 36

Functions should always be created in the <BODY> section of an HTML document, immediately preceding the call to the function.

a) The statement above is TRUE.
b) The statement above is FALSE.



Question 37

An object is an instance of a class and inherits all of the class's procedures and data.

a) The statement above is TRUE.
b) The statement above is FALSE.



Question 38

Constructor functions and standard functions can both use the "this" keyword to refer to the current object.

a) The statement above is TRUE.
b) The statement above is FALSE.



Question 39

A global variable is declared outside of a function and is available to all parts of the program it is defined in.

a) The statement above is TRUE.
b) The statement above is FALSE.



Question 40

Code that executes when a particular event occurs is an event interpreter.

a) The statement above is TRUE.
b) The statement above is FALSE.




Fill-in-the-Blank


Fill in the Blank with the word(s) that best fits the definition:

(hint: use vocabulary from the checkboxes below)

Question 41. JavaScript words or keywords cannot be used to a define a variable name.



Question 42. When defining a variable name, the use of the keyword in not required.



Question 43. In the JavaScript language, a procedure is called a(n) .



Question 44. When defining a function, the function's (plural), must be enclosed in curly braces {}.



Question 45. A parameter or (singular) is a variable that is defined in the parenthesis following a function name.



Question 46. A function that is required to pass back a value to a calling statement must include a(n) statement.



Question 47. In an object-oriented language, an object ia an in stance of a(n).



Question 48. A method is a function that is called from within a(n).



Question 49. An object is created from a constructor function using the keyword.



Question 50. Actions that users take, such as clicking the mouse, or moving the mouse over an image, are called (plural-one word).






I have


Please add a comment below



The 'Muddy Water' Issues that I need help on are as follows:





I need class review on the following vocabulary words from this chapter:

keywords reserved words class procedure function

objects property attribute method event

event handler statements parameter argument variable


var new this return true





When you have completed this quiz click the submit button (Those users whose Browser supports JavaScript) to send answers to your instructor

(This may takes a few moments to submit)


Click reset to clear all answers

Users whose browser does not support JavaScript, when you have completed this quiz click the submit button below to send answers to your instructor


Quiz Page was last modified by John Taylor: