Webmaster Mid-Term – Flashcards

Unlock all answers in this set

Unlock answers
question
All Web pages containing PHP code must have an extension of .php. True False
answer
True
question
The source code for PHP can be viewed in the client browser. True False
answer
False
question
It is a good practice to name all Web files with a .php extension even if they contain no PHP code. True False
answer
False
question
In PHP, you are limited to ten (10) code blocks in a single page. True False
answer
False
question
Using the standard method of writing PHP blocks, the are used to begin and end a code block. True False
answer
True
question
The primary purpose of a semicolon in PHP is to identify the end of a line. True False
answer
False
question
In PHP, each statement must be placed on a separate line. True False
answer
False
question
When using the element, a value of "php" must be assigned to the type attribute. True False
answer
False
question
When using multiple arguments in a function, you must separate the arguments with a comma. True False
answer
True
question
Both the echo and print statements return a value of 1 if successful and 0 if not successful. True False
answer
False
question
A text string can be contained in either double or single quotation marks. True False
answer
True
question
A line comment must be placed at the end of the line to which the comment refers. True False
answer
False
question
$_ABC1 is a valid variable identifier. True False
answer
False
question
In PHP, you can declare a variable without assigning a value to it. True False
answer
False
question
When you pass a variable name to the echo statement, you must enclose the variable name in double quotation marks. True False
answer
False
question
If you use a variable name in a text string enclosed by single quotation marks, the name of the variable will display. True False
answer
True
question
Constant names, like variable names, must begin with a $. True False
answer
False
question
Constant names are always case sensitive. True False
answer
False
question
Data types that can be assigned only a single value are called primitive types. True False
answer
True
question
When you assign a NULL value to a variable, you ensure that the variable does not contain any data. True False
answer
True
question
Arrays and objects are examples of the primitive data type. True False
answer
False
question
In PHP programming, you can only use TRUE or FALSE to indicate Boolean values. True False
answer
True
question
Array names are often referred to with the array operators [ and ] at the end of the name to clearly define them as arrays. True False
answer
True
question
The numbering of elements within an array starts with an index number of one (1). True False
answer
False
question
The values assigned to different array elements of the same array can be of different data types. True False
answer
True
question
A unary operator requires an operand before or after the operator. True False
answer
True
question
The modulus operator returns the remainder left from the division of two integers. True False
answer
True
question
A comparison operator returns a Boolean value of TRUE or FALSE after two operands have been compared. True False
answer
True
question
Type casting, changes the data type of a variable from one data type to another. True False
answer
True
question
You can use parentheses with expressions to change the associations in which individual operations in an expression are evaluated. True False
answer
True
question
Functions are placed within parentheses that follow a parameter name. True False
answer
False
question
A function must contain a parameter. True False
answer
False
question
Function arguments are the statements that do the actual work of the function and must be contained within the function braces. True False
answer
False
question
A function executes automatically. True False
answer
False
question
Like variables, function names are case sensitive. True False
answer
False
question
A return statement is a statement that returns a value to the statement that called the function. True False
answer
True
question
A function must return a value. True False
answer
False
question
Variable scope refers to the location that a declared variable can be used. True False
answer
True
question
If you attempt to use a local variable outside the function in which it is declared, you receive an error message. True False
answer
True
question
The formal parameters within the parentheses of a function declaration are global variables. True False
answer
False
question
Global variables are automatically available to all parts of your program, including functions. True False
answer
False
question
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 False
answer
True
question
Using parentheses to enclose the conditional expression of an if statement is optional. True False
answer
False
question
If a command block is missing either the opening or closing brace, an error occurs. True False
answer
True
question
The else clause can only be used with an if statement. True False
answer
True
question
When one decision-making statement is contained within another decision-making statement, they are referred to as multiple decision-making structures. True False
answer
False
question
The switch statement controls program flow by executing a specific set of statements, depending on the value of an expression. True False
answer
True
question
The default label contains statements that execute when the value returned by the switch statement expression does not match any case label. True False
answer
True
question
To ensure that the while statement will eventually end, you must include code within the body of the while statement that changes the value of the conditional expression. True False
answer
True
question
You can use the terminate statement to halt a looping statement and restart the loop with a new iteration. True False
answer
False
question
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 False
answer
True
question
The statements in a do...while statement always execute repeatedly before the conditional expression evaluates the count variable. True False
answer
False
question
The for statement performs essentially the same function as the while statement. True False
answer
True
question
One of the primary differences between the while statement and the for statement is that in addition to a conditional expression, the for statement can also include code that initializes a counter and changes its value with each iteration. True False
answer
True
question
You will not receive an error if you attempt to use a foreach statement with any variable types other than arrays. True False
answer
False
question
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 False
answer
True
question
The include statement and the require statement perform the same function and can be used interchangeably. True False
answer
False
question
Include statements support only absolute path notation. True False
answer
False
question
When you use a variable in a PHP program, you must be aware of the variable's ____. placement scope function statement
answer
scope
question
The concatenation operator (.) combines several string variables and literal strings and assigns the new value to another variable. True False
answer
True
question
The concatenation assignment operator (.=) combines two text strings. True False
answer
True
question
An escape character tells the compiler or interpreter to exit the program at the escape character. True False
answer
False
question
Placing a backslash in front of an apostrophe tells the PHP scripting engine that the apostrophe is to be treated as a regular keyboard character. True False
answer
True
question
The escape character combined with one or more other characters is called an escape sequence. True False
answer
True
question
The escape sequence inserts a comment. True False
answer
False
question
The escape sequence to insert a carriage return is r. True False
answer
True
question
To insert a horizontal tab, use the escape sequence t. True False
answer
True
question
The function substr_count() returns the total number of characters in a string. True False
answer
False
question
The str_word_count() function returns the number of digits in a string. True False
answer
False
question
The term parsing refers to the act of dividing a string into logical component substrings or tokens. True False
answer
True
question
The strpos() function performs a case-sensitive search for specified characters in a string and returns the position of the first occurrence of a substring within a string. True False
answer
True
question
The strchr() function or strrchr() function return a substring from the specified characters to the end of the string. True False
answer
True
question
The strtok() function breaks a program into functions. True False
answer
False
question
The syntax for the strtok() function is $variable=strtok(string, separators) True False
answer
True
question
The explode() function splits a string into an indexed array at a specified separator. True False
answer
True
question
The opposite of the explode() function is the implode() function. True False
answer
False
question
ASCII stands for American Standard Code for Internet Information. True False
answer
False
question
The strcasecmp() function and the strcmp() function respectively perform a case-insensitive and case-sensitive comparison of strings. True False
answer
True
question
The levenshtein() function returns the number of characters you need to change for two strings to be the same. True False
answer
True
question
The sound ex() function returns a value representing a name's phonetic equivalent. True False
answer
True
question
A megaphone is an algorithm that returns a code for indexing words by their sound, when pronounced in English True False
answer
False
question
Regular expressions are patterns that are used for matching and manipulating strings according to specified rules. True False
answer
True
question
PHP support Perl Compatible Regular Expressions (PCRE). True False
answer
True
question
Regular expression patterns are enclosed in opening and closing delimiters. True False
answer
True
question
The metacharacter (.) matches any single character. True False
answer
True
question
The metacharacter (^) anchors characters to the end of a string. True False
answer
False
question
An anchor specifies that a pattern must appear at that position in the string. True False
answer
True
question
Metacharacters that specify the quantity of a match qualifiers. True False
answer
False
question
The concatenation operator in PHP is a ____. plus sign (+) period (.) minus sign (-) mark (?)
answer
period (.)
question
The escape character sequence ____ inserts a new line. 133 options: l CR n nl
answer
n
question
The main content and capabilities of a Web site should be available for users of the least-featured browsers employed by a significant share of your users. True False
answer
True
question
Sometimes the creators of browser rendering engines include support for CSS properties whose functions and syntax haven't yet reached consensus in the W3C development process. True False
answer
True
question
Only in older browsers can you precede a pseudo-element with two colons ( :: ) to differentiate it visually from a pseudo-class. True False
answer
False
question
Style rules based on the :before or :after pseudo-elements don't need to specify an optional value for the content property. True False
answer
False
question
CSS3 made both rgb and hsl more flexible by adding an omega channel the resulting systems are known as rgbo and hslo. True False
answer
False
question
You can specify two values for any border-radius property to create more oblong corners. True False
answer
True
question
Traditionally, text shadows have been brought to Web pages by creating the effects in image manipulation software and then linking to a graphic showing the text in the HTML code. True False
answer
True
question
Few browsers add a shadow to nav bar text when the mouse pointer is over it. True False
answer
False
question
Browser sniffing has an important drawback browsers may not always identify themselves accurately. True False
answer
True
question
Rather than making advanced features crucial to the layout of a Web site, you should add additional features as enhancements only for browsers that can render them, a practice known as degraded enhancement. True False
answer
False
question
Some tools package many shims together into a(n) library of scripts. True False
answer
True
question
Like a pseudo-class, a pseudo-element is preceded by a(n) question mark. True False
answer
False
question
Setting the line width for a drop cap is commonly necessary to integrate the letter optimally with the remaining paragraph text. True False
answer
False
question
CSS enables you to specify the color numerically for a Web page element using the hexadecimal, rgb (red gray blue), and hsl systems. True False
answer
False
question
An effect used in some print layouts is a(n) text shadow, which creates the appearance of a shadow on a surface behind each letter. True False
answer
True
question
When working with the box-shadow property, decreasing the horizontal and vertical offsets moves the shadow farther away from the primary box/figure. True False
answer
False
question
Once Modernizr is linked to a Web page, it tests each user's browser to detect which properties are supported. True False
answer
True
question
Some styles can neatly fall back to other CSS properties, such as a(n) hsl color value substituting when an rgba value isn't recognized. True False
answer
False
question
Feature detection is more reliable than browser sniffing and also provides a more detailed picture of the capabilities of a user's browser. True False
answer
True
question
A useful tool is a script written specifically to bridge the gap between browsers with reduced feature sets and more fully featured browsers. Many of these scripts, known as ____, are available for use by anyone free of charge. shims patches Either A or B. Neither A nor B.
answer
Either A or B.
question
____ 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. Pointers Instructions Comments
answer
Comments
question
____ a variable is the processing of assigning a first value to a variable. Initializing Declaring Finalizing
answer
Initializing
question
The ____ function is used to create a constant. create() define() describe()
answer
define()
question
The ____ type is the specific category of information that a variable contains. variable data content
answer
data
question
Data types that can be assigned only a single value are called ____ types. individual mono primitive
answer
primitive
question
In a ____ programming language the data type for a variable will not change after it has been declared. loosely typed strongly typed constantly typed
answer
strongly typed
question
____ are positive and negative numbers and 0 with no decimal places. Integers Numbers Digits
answer
Integers
question
A(n) ____ is a literal value or variable that can be evaluated by the PHP scripting engine to produce a result. expression condition clause
answer
expression
question
____ are symbols such as the (+) symbol that are used in expressions to manipulate operands. Literals Operators Expressions
answer
Operators
question
A(n) ____ operator requires a single operand either before or after the operator. unary single binary
answer
unary
question
A variable's scope can be either global or ____. local undeclared universal declared
answer
local
question
What will be returned if you use a local variable outside the function in which it is declared? value error message function nothing
answer
error message
question
The parameters within the parentheses of a function declaration are what kind of variables? local global unknown declared
answer
local
question
With many programming languages global variables are automatically available to all parts of your program, including ____. statements definitions functions declarations
answer
functions
question
When you declare a global variable with the global keyword you do not need to assign the variable a(n) ____. value definition function name
answer
value
question
A command block is a group of statements within a set of opening and closing ____. brackets braces parentheses quotation marks
answer
braces
question
When one decision-making statement is contained within another decision-making statement it is referred to as a ____ decision-making structure. enclosed contained nested layered
answer
nested
question
Which of the following terms is not associated with the switch statement? switch title case label executable statements break keyword
answer
switch title
question
A(n) ____ statement is a control structure that repeatedly executes a statement or series of statements while a specific condition is TRUE or until a specific condition becomes TRUE. repeat replicate loop circular
answer
loop
question
A ____ is a variable that increments or decrements with each iteration of a loop statement counter incrementer/decrementer iterator repetitor
answer
counter
question
If you do not include code that changes the value used the by the condition expression your program will be caught in a ____ loop. continuous continuing constant infinite
answer
infinite
question
A ____ statement is used to iterate or loop through the elements in an array. for while foreach if...else
answer
foreach
question
The ____ statement halts the processing of the web page and displays an error if an include file cannot be found. include insert Insert-contents Require
answer
require
question
The ____ file is typically d with a prefix of inc_. insert include nested increment
answer
include
question
All text strings must begin and end with double quotation marks. True False
answer
False
question
In PHP, the escape character is the ____. pipe (|) period (.) semicolon() backslash()
answer
backslash()
question
The escape sequence inserts a(n) ____. comment web ink backslash directory
answer
backslash
question
The escape sequence to insert a carriage return is ____. r cr t
answer
r
question
The strlen() function returns the total ____ in a string. number of numerals number of characters number of occurrences number of words
answer
number of characters
question
The most commonly used string counting function is the ____ function, which returns the total number of characters in a string. str_count() strlen() strpos() total()
answer
strlen()
question
The ____ function converts all of the letters in a string to capital letters. strtoupper() stringtoupper() strtolower() stringtolower()
answer
strtoupper()
question
The ____ function converts any occurrence of (&), ("), ('), () to their equivalent HTML character entity. converttohtml() specialhtml() htmlspecialchars() convertchars()
answer
htmlspecialchars()
question
The ____ function uses a strong encryption algorithm called Message-Digest Algorithm to create a one-way hash of an entered string. strhash() str-ireplace() mda() md5()
answer
md5()
question
The ____ function will remove both leading and trailing spaces from a string. ltrim() rtrm() trim() strtrim()
answer
trim()
question
The ____ function randomly scrambles the order of characters in a string. str_scramble() str_shuffle() str_jumble() str_random()
answer
str_shuffle()
question
The ____ function splits a string into an indexed array. repair() implode() explode() strtok()
answer
explode()
question
The strcmp() function performs a ____ comparison of two strings. case-insensitive standard case-sensitive sub-standard
answer
case-sensitive
question
____ are special characters that define the pattern matching rules in a regular expression. Specialchars Patterncharacters Expressionchars Metacharacters
answer
Metacharacters
question
In a regular expression, a(n) ____ specifies that the pattern must appear at that position in the string. pointer anchor position spotter
answer
anchor
question
The metacharacter, ____, specifies an anchor at the end of the line. () (;) (^) ($)
answer
($)
question
The ____ quantifier specifies that zero or more of the preceding characters can match. (;) (*) (#) (?)
answer
(*)
question
____ quantifiers allow you to more precisely specify the number of times a character must repeat sequentially. Curly brace Curly bracket Parentheses Double quotation marks
answer
Curly brace
question
The characters contained in a set of parentheses within a regular expression are referred as a ____. subpattern basepattern nested pattern base expression
answer
subpattern
question
The ____ metacharacter is used to specify a range of values in a character class. (-) (+) (@) (')
answer
(-)
question
The ____ metacharacter is used to allow a string to contain an alternate set of substrings. (!) (|) () (/)
answer
(|)
question
Recent versions of CSS have decreased the aspects of Web pages that CSS can style. True False
answer
False
question
Beginning in version 2 of the language, CSS has included ____, which are selectors that enable you to isolate a piece of a larger element for styling. alpha-elements alpha-properties pseudo-elements pseudo-properties
answer
pseudo-elements
question
In the code [if lt IE 7], lt stands for ____. greater than equal to less than not
answer
less than
question
When using a drop cap, you use the ____ property to make the text that follows the enlarged letter flow around it. shadow value flow float
answer
float
question
A structure in which variables are placed within curly braces inside of a string is called a ____. complex string syntax simple string syntax function method
answer
complex string syntax
question
Unlike the other pseudo-elements, which simply select parts of existing Web page elements, the ____ pseudo-elements enable you to insert content into Web pages using style rules. :before :after Both A and B. Neither A nor B.
answer
Both A and B.
question
You can use the :before and :after pseudo-elements ____. to add repeating text to all elements of a given class to specify beginning indicators for each page in a Web site to specify ending indicators for each page in a Web site All of the above.
answer
All of the above
question
Style rules based on the :before or :after pseudo-elements must specify a value for the ____ property, which can be either text or the path and name for an image file. content hold file value
answer
content
question
Which of the following is NOT a system that CSS enables you to specify the color numerically for a Web page element? hexadecimal rgb hsl primary color
answer
primary color
question
CSS3 made both rgb and hsl more flexible by adding a(n) ____ channel. alpha omega vertical horizontal
answer
alpha
question
When using rgba and hsla, the earlier triplet of values becomes a set of four, with the final value representing the level of opacity as a decimal value from 0 (fully transparent) to ____ (totally opaque). 1 3 5 10
answer
1
question
Older browsers do not support the ____ property, so adding an rgb triplet is a useful tool for graceful degradation for these properties as well. hsl hsla Both A and B. Neither A nor B.
answer
Both A and B.
question
You can specify two values for any border-radius property to create more oblong corners the first value is the ____. horizontal radius vertical radius blur shadow color
answer
horizontal radius
question
You can specify two values for any border-radius property to create more oblong corners the second value is the ____. horizontal radius vertical radius blur shadow color
answer
vertical radius
question
The border-radius property sets values for ____. one corner of an element at a time two corners of an element at a time three corners of an element at a time all four corners of an element at once
answer
all four corners of an element at once
question
You can use the border-radius property as a shorthand property, specifying ____ values to set different border radii for different corners with a single name-value pair. 2 3 4 Any of the above.
answer
Any of the above.
question
The CSS3 text-shadow property takes four values that includes horizontal ____. offset blur color opacity
answer
offset
question
The CSS3 text-shadow property takes four values that includes vertical ____. offset blur color opacity
answer
offset
question
The CSS3 text-shadow property takes four values that includes shadow ____. offset blur color opacity
answer
color
question
The value for the text-shadow property ____ controls the width and lightness of shadow. offset blur shadow opacity
answer
blur
question
The value for the text-shadow property ____ controls the color of the shadow behind text. offset blur color opacity
answer
color
question
____ has -webkit and -moz variants. Text-shadow Box-shadow Both A and B. Neither A nor B.
answer
Box-shadow
question
____ is a free script library created by Faruk Ates and Paul Irish. Once it is linked to a Web page, it tests each user's browser to detect which properties are supported. CSS3 Bing W3C Modernizer
answer
Modernizer
question
For each feature for which Modernizer finds support in a user's browser, it adds a class value to the ____ element. http html javascript ftp
answer
html
question
Instead of using browser sniffing, Modernizer runs a series of tests and uses the results to decide which features a user's browser supports, a process known as ____ detection. class CSS feature browser
answer
feature
question
Referring to the figure above, the first entry of "5px" refers to the text-shadow property of ____. horizontal offset vertical offset blur color
answer
horizontal offset
question
Referring to the figure above, the second entry of "5px" refers to the text-shadow property of ____. horizontal offset vertical offset blur color
answer
vertical offset
question
Referring to the figure above, the following entries are optional: ____. 3px #333 Both A and B. Neither A nor B.
answer
Both A and B
question
Referring to the figure above, the last entry "#333" indicates the color of the ____. text shadow behind the text opacity All of the above.
answer
shadow behind the text
question
Referring to the figure above, the class that was added to apply results of Modernizr scripts to the Web page is ____. "no-js" "utf-8" "text/css" "scripts/modernizr-1.6.min.js"
answer
"no-js"
question
Referring to the figure above, the ____ value has been applied to the figcaption element "The Sun Room." rgb rgba Both A and B. Neither A nor B.
answer
rgba
question
Referring to the figure above, the correct alpha value to set the background value of the figcaption element to 60% opaque, is ____. .006 .06 0.6 60
answer
0.6
question
Referring to the figure above, the box-shadow property is similar to the text-shadow property except that it ____. offers -webkit and -moz variants does not use the blur value does not use the color value does not use the horizontal offset value
answer
offers -webkit and -moz variants
question
Referring to the figure above, the ____ offsets are 2px. vertical horizontal Both A and B. Neither A nor B.
answer
Both A and B.
question
Jenna manages the Web site for her band. She is exploring browser sniffing and feature detection to see which method will work best on the Web site to announce the dates and times of the band's gigs. Jenna discovers that browser sniffing relies on a ____ which asks the browser to identify itself. property value script pseudo-element
answer
script
question
Jenna manages the Web site for her band. She is exploring browser sniffing and feature detection to see which method will work best on the Web site to announce the dates and times of the band's gigs. Jenna decides to use feature detection on her site as her research shows her that ____. it is more reliable it provides a more detailed picture of the capabilities of a user's browser Both A and B. Neither A nor B.
answer
Both A and B.
question
Tanner is building a Web site featuring safety tips for new hockey players. Tanner wants the words "Safety First" to be inserted before each element of the class he created called "tips." To do this, he should use the content type of ____. text image table icon
answer
text
question
Tanner is building a Web site featuring safety tips for new hockey players. Tanner wants a first aid symbol to be inserted before each element of the class he created called "first aid." He would use the content type of ____. text image table icon
answer
image
question
Tanner is building a Web site featuring safety tips for new hockey players. During his research, Tanner discovers a CSS pseudo-element ::selection. He decides not to use it as it was first supported starting with CSS version ____. 2.1 2.5 3 4
answer
3
question
Exponential ____ is a shortened format for writing very large numbers with any decimal places. numbering notation registering
answer
notation
question
A(n) ____ is an element's numeric position within an array. location index indicator
answer
index
question
You use the ____ function to find the total number of elements in an array. sum() counta() count()
answer
count()
question
The print_r() var_export(), and var_dump()functions are used with ____ to display the index and value of each element. variables functions arrays
answer
arrays
question
A(n) ____ operator requires a single operand either before or after the operator. unary single binary
answer
unary
question
A(n) ____ operator is used in PHP to perform mathematical calculations. math arithmetic calculation
answer
arithmetic
question
The ____ operator uses the % symbol to find the remainder of integer division. division modulus arithmetic
answer
modulus
question
Assignment operators are used to assign a ____ to a variable. name value data type
answer
value
question
____ assignment operators perform mathematical calculations on variables and literal values in an expression and then assign a new value to the left operand. Compound Complex Binary
answer
Compound
question
The ____ operation uses the === (triple equal sign) to compare two operands for equality and data type. equal strict equal comparison
answer
strict equal
question
The ____ operator executes one of two expressions based on the results of a conditional expression. conditional expressional comparison
answer
conditional
question
Logical operators are used for comparing two ____ operands for equality. numeric Boolean String
answer
Boolean
question
The ____ symbol is used to suppress any errors that might be generated by an expression to which it is prepended. # =; @
answer
@
question
One way to ensure that a variable is of the correct data type is through type ____. naming identifying casting
answer
casting
question
The ____ function tests whether a variable contains a numeric data type. is_number() is_digit() is_numeric()
answer
is_numeric()
question
A function definition contains the lines of code that make up a function. True False
answer
True
Get an explanation on any task
Get unstuck with the help of our AI assistant in seconds
New