Post Quiz 1 Question Review
The PHP Group recommends you use the standard ____ script delimiters to write PHP code declaration blocks. a. ? statements ? b. ?php statements ? c. script language = "php">statements/script
?php statements ?>
You cannot use words that JavaScript has reserved for other purposes when you create a variable name.
True
You use the ____ function to find the total number of elements in an array. a. sum() c. count() b. counta()
count()
The ____ function is used to create a constant a. create() c. describe() b. define()
define()
If you do not include code that changes the value used the by the condition expression, your program will be caught in a ____ loop. a. continuous c. constant b. continuing d. infinite
infinite
The ____ function tests whether a variable contains a numeric data type. a. is_number() c. is_numeric() b. is_digit()
is_numeric()
A variable's scope can be either global or ____. a. local c. universal b. undeclared d. declared
local
The ____ operator uses the % symbol to find the remainder of integer division. a. division c. arithmetic b. modulus
modulus
The ____ statement halts the processing of the web page and displays an error if an include file cannot be found. a. include c. Insert-contents b. insert d. require
require
Assignment operators are used to assign a ____ to a variable. a. name c. data type b. value
value
12. The primary use of the include and require statements is to reuse content on multiple web pages by allowing you to insert the content of an external file, called an include file, in your PHP scripts.
True
A function definition contains the lines of code that make up a function
True
A function must return a value
True
A text string can be contained in either double or single quotation marks
True
All Web pages containing PHP code must have an extension of .php
True
Early on, a problem with Java was that nonprogrammers found it difficult to learn and use to write their own Java applets
True
If a command block is missing either the opening or closing brace, an error occurs
True
If a function returns a value, it can be stored in a variable.
True
If you use a variable name in a text string enclosed by single quotation marks, the name of the variable will display
True
In Java, programs cannot write content to the hard disk.
True
In PHP, you must declare a global variable with the global keyword inside a function definition for the variable to be available within the scope of that function
True
It is common practice for JavaScript programmers to create libraries of functions located in external files that are easily accessible to many Web pages.
True
JavaScript code can be inserted directly into an HTML file, or placed in a separate text file that is linked to the Web page.
True
JavaScript commands can be inserted directly into an HTML file rather than being placed in a separate program file.
True
Like variables, function names are case sensitive.
True
Some JavaScript functions require parameters, which are variables associated with the function.
True
Spam reduces productivity by forcing employees to wade through numerous spam messages every day to find messages that are truly relevant.
True
The default label contains statements that execute when the value returned by the switch statement expression does not match any case label.
True
The do...while statement executes a statement or statements once, then repeats the execution as long as a given conditional expression evaluates to TRUE.
True
The document.write() and document.writeln() methods reflect the object-oriented nature of the JavaScript language.
True
The else clause can only be used with an if statement
True
The great advantage of a function is that you can reuse it.
True
The switch statement controls program flow by executing a specific set of statements, depending on the value of an expression.
True
Using the standard method of writing PHP blocks, the <?php and ?> are used to begin and end a code block.
True
When the browser loads the HTML file containing a function, the browser bypasses the function without executing it; the function is executed only when called by another JavaScript command.`
True
When using multiple arguments in a function, you must separate the arguments with a comma
True
____ is essentially junk e-mail. a. Spam c. Server-side b. Client-side d. An e-mail harvester
a) Spam
What is the result of writing the keyword var in a function parameter list? a) The result would be a JavaScript runtime error. b) The parameter following the keyword would have global scope. c) The parameter following the keyword would have local scope. d) The parameter following the keyword would become a static variable.
a) The result would be a JavaScript runtime error.
What would the browser display if the following code were executed in a script? var product = 0; while ( product <= 25 ); product = 2 + product; a) nothing, the script would result in an inifite-loop error b) 0 c) 25 d) 26
a) nothing, the script would result in an inifite-loop error
Which of the following is not a DOM collection? a) roots b) anchors c) links d) forms
a) roots
Which of the following is a legal function call for the function definition provided below? function square( y ) { return y * y; } a) square(7+2); b) (7).square; c) square(7,2); d) square 7;
a) square(7+2);
____ is an interpreted language, meaning that the program code is executed directly without compiling. a. JavaScript c. C++ b. Java d. All of the above
a. JavaScript
_________ code can be inserted directly into an HTML file or placed in a separate text file that is linked to a Web page. a. JavaScript c. JScript b. Java d. Java Applets
a. JavaScript
The print_r(), var_export(), and var_dump()functions are used with ____ to display the index and value of each element. a. variables c. arrays b. functions
arrays
What would the browser display if the following code were executed in a script? var product = 0; while (product >= 25) product = 2 + product; document.writeln( product ); a) nothing, the script would result in an error b) 0 c) 24 d) 26
b) 0
A(n) ____ is a person who sends out unsolicited e-mails. a. Analyst c. harvester b. Spammer d. staffer
b) Spammer
What does the following statement do? Math.floor( Math.random() * 12 ); a) This creates a random number from 0 up to and including 12. b) This creates a random number from 0 up to but not including 12. c) This creates a random number from 1 up to and including 12. d) This creates a random number from 1 up to but not including 12.
b) This creates a random number from 0 up to but not including 12.
The style of programming in which the user interacts with a GUI component is called ________ programming. a) object-oriented b) automatic c) event-driven d) modular
b) event-driven
Java requires that users have access to the ____ in order to create an executable Java applet. a. DTD c. ECMA b. JDK d. DDL
b. JDK
A(n) ____ retrieves a Web page from the server. a. programmer b. server-side program c. User d. information set
b. server-side program
____ can be used to look for e-mail addresses by scanning Web pages. a. Spam c. An e-mail harvester b. Server-side d.Client-side
c) An e-mail harvester
An object's methods are accessed by writing the name of the object immediately followed by a ____________. a) method name b) method index c) dot d) property operator
c) dot
Where you place a function in the HTML file is unimportant.
False
The ____ symbol is used to suppress any errors that might be generated by an expression to which it is prepended. a. # c. @ b. =>
@
. ____ are lines you place in your code that do not get executed but provide helpful information such as the name of the script, your name and the date your created the program. a. Pointers c. Comments b. Instructions
Comments
10. $2_ABC1 is a valid variable identifier
False
A function cannot be designed to return a value.
False
A function executes automatically
False
A function must contain a parameter
False
Essentially, Java and JavaScript are the same.
False
Function parameters must be placed within parentheses, following the function name, and the parameters must be separated by periods.
False
In PHP, each statement must be placed on a separate line.
False
In PHP, you are limited to ten (10) code blocks in a single page.
False
In PHP, you can declare a variable without assigning a value to it.
False
In client-side programming, programs that run on the client side directly change the server data.
False
It is a good practice to name all Web files with a .php extension even if they contain no PHP code.
False
Most JavaScript commands and names are not case sensitive.
False
Parameter values cannot be variables themselves.
False
The source code for PHP can be viewed in the client browser.
False
Users need to work with a developer's kit to compile a JavaScript program.
False
When using the (script) element, a value of "php" must be assigned to the type attribute
False
. ___ a variable is the processing of assigning a first value to a variable. a. Initializing c. Finalizing b. Declaring
Initializing
.____ are positive and negative numbers and 0 with no decimal places. a. Integers c. Digits b. Numbers
Integers
To refer to a particular location or element in the array, we specify the name of the array and the ________ of the particular element in the array. a) contents b) size c) position number d) type
c) position number
____-side programs do not require users to wait for data to be sent over the Internet to a Web a. Server c. Client b. File d. Database
c. Client
One way to ensure that a variable is of the correct data type is through type ____. a. naming c. casting b. identifying
casting
The ____ operator executes one of two expressions based on the results of a conditional expression. a. conditional c. comparison b. expressional
conditional
A ____ is a variable that increments or decrements with each iteration of a loop statement a. counter c. iterator b. incrementer/decrementer d. repetitor
counter
What would the function cube return, assuming it is called with the statement cube( 3 )? function cube( y ); { return y * y * y; } a) JavaScript runtime error b) 3 c) 9 d) 27
d) 27
You can ____ an e-mail address to prevent it from being grabbed by programs that scan Web pages. a. inherit c. Spam b. compile d. scramble
d) scramble
____ is the process by which a program is converted from a text file of code into an executable file called an applet. a. Inheritance b. ECMA c. Scripting d. Compiling
d. Compiling
Which of the following does not have features to scramble or unscramble e-mail addresses? a. HTML c. XML b. XHTML d. both a and b
d. both a and b
2. What will be returned if you use a local variable outside the function in which it is declared? a. value c. function b. error message d. nothing
error message
The ____ file is typically saved with a prefix of inc_. a. insert c. nested b. include d. increment
include
A(n) ____ is an element's numeric position within an array. a. location c. indicator b. index
index
When one decision-making statement is contained within another decision-making statement it is referred to as a ____ decision-making structure. a. enclosed c. nested b. contained d. layered
nested
Exponential ____ is a shortened format for writing very large numbers with any decimal places. a. numbering c. registering b. notation
notation
Data types that can be assigned only a single value are called ____ types. a. individual c. primitive b. mono
primitive
The ____ operation uses the === (triple equal sign) to compare two operands for equality and data type. a. equal c. comparison b. strict equal
strict equal
In a ____ programming language the data type for a variable will not change after it has been declared. a. loosely typed c. constantly typed b. strongly typed
strongly typed