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 Three:

Chapter 3 Quiz Masters:

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

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


Multiple Choice [One Answer Only]

Please Note that this test was prepared for the first edition of the text and it may have errors. Please note all errors in the: I have discovered that...Section below.

Question 1

JavaScript variables contain a specific category of information, which called the variable's

a) data mode
b) data type
c) category
d) class


Question 2

Which of the following is not a JavaScript primitive data type?

a) Boolean
b) integer
c) array
d) string


Question 3

A programming language that requires the type of each variable to be declared is a(n)

a) object-oriented
b) static typed
c) loosely-typed
d) strongly-typed


Question 4

When defining variables in JavaScript,

a) you are not allowed to declare a data type.
b) you are required to declare a data type.
c) you can declare a data type if desired, but it is not mandatory.
d) the data type is determined by the variable name.


Question 5

The correct syntax for the JavaScript typed operator is

a) typeof.variablename();
b) typeof(variablename);
c) typeof_variablename;
d) typeof-(variablename);


Question 6

In JavaScript, a positive or negative number with no decimal places is a(n)

a) floating point number
b) real number
c) integer
d) whole number


Question 7

The data type that can only have a value of true, or false, is a(n)

a) binary
b) Boolean value
c) switch
d) toggle


Question 8

What is the result of the statement, myfield="";

a) A string variable is initialized as an empty string
b) JavaScript will report an error when it interprets the statement
c) A string variable is initialized to contain double quotation marks
d) none of the above


Question 9

A series of zero or more characters surrounded by single or double quotation marks is a(n)

a) array
b) byte map
c) string
d) structure


Question 10

In the statement, setField="My dog\'s name is Rex";, why does the backslash follow the g in dog?

a) It doesn't mean anything, it is probably a typo
b) It is supposed to be an escape character, but it should be a forward slash.
c) It is an escape character,telling JavaScript the following character is not terminating the string, but is a keyboard character
d) none of the above


Question 11

When an escape character is combined with some other character, it creates a(n)

a) escape function
b) escape string
c) string sequence
d) escape sequence


Question 12

A collection of variables referenced by a single variable name is a(n)

a) object
b) class
c) string
d) array


Question 13

Which of the following statements shows the proper way to initialize an array element?

a) array_value=[3]"John Smith";
b) array_value(3)="John Smith";
c) array_value3="John Smith";
d) array_value[3]="John Smith";


Question 14

The correct way to define an array is shown by which statement?

a) test_array=new Array(5)
b) test_array[5]=new Array
c) test_array(5)=new Array
d) test_array=new array{5}


Question 15

Which of the following statements shows the correct syntax to access the fifth element of an array?

a) arrayentry[5]
b) arrayentry[+5]
c) arrayentry[4]
d) arrayentry[+4]


Question 16

The data entries in an array are referred to as array

a) cells
b) elements
c) objects
d) slots


Question 17

Which statement shows the proper way to initialize multiple array entries in one program statement?

a) myArray=new Array("one";"two";"three";);
b) myArray=new Array("one":"two":"three":);
c) myArray=new Array("one","two","three");
d) myArray=new Array("one"),("two"),("three");


Question 18

A combination of literal values, operators, and variables that can be evaluated by a JavaScript interpreter to achieve some results is a(n)

a) formula
b) macro
c) expression
d) operand


Question 19

The variables and literals contained in an expression are called

a) operators
b) objects
c) statements
d) operands


Question 20

An equal sign (=), the plus sign (+) and the minus sign (-), are all examples of

a) expressions
b) operators
c) operands
d) qualifiers


Question 21

The operator type used for performing Boolean operations on Boolean operands is

a) Assignment
b) Comparison
c) Logical
d) Arithmetic


Question 22

An operator that requires a single operand either before or after the operator is a(n)

a) unary
b) binary
c) simple
d) stand alone


Question 23

Which of the statements below will return a string value of "45"?

a) x=4;y=5;value=x+y;
b) x=4;y="5";value=x+y;
c) x="four";y="five";value=x+y;
d) x="4";y="5";value=x+y;


Question 24

The increment (++) and the decrement (--)can be used as a prefix operator, or as a _______ operator.

a) suffix
b) postfix
c) trailing
d) none of the above


Question 25

The operators >=,<=,!=, are all examples of ________operators.

a) comparison
b) unary
c) logical
d) assignment


Question 26

What value would be assigned to myvalue in the expression, myvalue=10==20;?

a) 10
b) 20
c) true
d) false


Question 27

Which of the following statements will return a value of true if x=4 and y=5?

a) x<=y;
b) x!=y;
c) x<y;
d) all of the above


Question 28

The double ampersand operator represents the ________logical operator.

a) or
b) not
c) and
d) exclusive or


Question 29

In the expression, string1="my car is red,"+"and very fast";,the plus sign (+) is called a(n)

a) arithmetic
b) concatenation
c) logical
d) associative


Question 30

The _______function can be used to evaluate expressions contained within strings.

a) eval()
b) compare()
c) confirm()
d) strcompare()




True/False Questions


Question 31

HTML tags can be used within JavaScript strings, as long as the tag is inside the quotation marks of the string.

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



Question 32

The index number of the first element within an array is one (1).

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



Question 33

The elements within a JavaScript array can be all different data types.

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



Question 34

A combination of variables, literals, and operators, such as, x="this is a test";, is called an expression.

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



Question 35

The equal sign (=) is one example of a unary operator.

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



Question 36

The expression, newval=++count;, will return a value of count + 1 to the variable newval.

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



Question 37

The expressions, x=(a=5);, and x=(a==5);, are identical and will always return the same value to x.

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



Question 38

If x=2, and y=5, the expression, rtnvalue=x==2&&y>=5; will return a value of false

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



Question 39

The expression, rtnvalue=4+2*8; will return a value of 48 to rtnvalue.

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



Question 40

The highest priority operator precedence in JavaScript is the parenthesis.

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.

The JavaScript data type that assigns an empty value to a variable is the type.

Question 42.

The JavaScript data type that can only have a value of true, or false, is the type.

Question 43.

The (one word-no hyphens) is the escape character in JavaScript.

Question 44.

A variable identified by a single name but that contains a set of data, possibly including multiple data types is a(n) .

Question 45.

The index value of the first element within an array is always .

Question 46.

The symbols used to manipulate the operands in an expression are called (plural).

Question 47.

The plus sign (+) which means addition, the asterisk (*) which represents multiplication, and the forward slash (/) are all examples of operators.

Question 48.

A(n) operator requires an operand on the left and the right side of the operator.

Question 49.

The "+=", and "%=" operators are all examples of operators.

Question 50.

Two literal strings can be combined into one string using the operator.




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:

data type primitive type strongly-typed programming language loosely-typed programming language static typing

dynamic typing typeof() operator integer data type floating-point number data type string data type

Boolean value empty strings escape character escape sequence array

array elements expression operands operators binary operator

unary operator arithmetic operator prefix operator postfix operator assignment operator

logical operator string operator operator precedence eval() function modulus operator

concatenation and or not






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


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: