Quiz#2: PHP functions, data types and constructs
Download file with the answers
Quiz#2: PHP functions, data types and constructs
1 file(s) 107.83 KB
Not a member!
Create a FREE account here to get access and download this file with answers
Quiz#2: PHP functions, data types and constructs
Question 1
1. When using the POST method, variables are displayed in the URL.
True
False
10 points
Question 2
1. PHP allows you to send emails directly from a script.
True
False
10 points
Question 3
1. What is the professional way to add 1 to the $count variable?
$count++;
count++;
Add 1 to $count;
$count = $count plus one;
10 points
Question 4
1. Which of these variables has an illegal name?
$myvar
$myVar
$my_var
$my-var
10 points
Question 5
1. The ______ function returns the absolute value of a number.
absolute()
positive()
pos()
abs()
10 points
Question 6
1. The ______ function returns a formatted string according to the string format.
format();
stringf()
formatString()
sprintf()
10 points
Question 7
1. The ______ function returns a rounded value.
rountdit()
rvalue()
round()
roundNow()
10 points
Question 8
1. The ______ function returns the next highest integer value by rounding up.
round()
ceil()
floor()
next()
10 points
Question 9
1. The ______ function returns the next lowest integer value by rounding down.
round()
ceil()
floor()
next()
10 points
Question 10
1. The rand() function generates a random number.
True
False
10 points
Question 11
1. The ______ function returns a string with whitespace removed from the beginning and end of the string.
remove()
deleteWhiteSpace()
leftRightSideRemove()
trim()
10 points
Question 12
1. A ______ is a named location, whose contents can vary over time.
variable
constant
register
keyword
10 points
Question 13
1. The result of the following statement is ____?
echo 3 + 5 * 2 + 4;
20
24
3524
17
10 points
Question 14
1. A variable’s data type describes the kind of values it can hold, and the types of operations that can be performed on the variable.
True
False
10 points
Question 15
1. A variable’s name describes the kind of values it can hold, and the types of operations that can be performed on the variable.
True
False
10 points
Question 16
1. The PHP variable $a would be seen as a completely different variable from $A.
True
False
10 points
Question 17
1. When a program never ends because of a repeating flow of logic, this is referred to as a(n) __________.
infinite loop
for loop
do loop
never never loop
10 points
Question 18
1. The term for placing a structure within another structure is _________.
framing
embedding
looping
nesting
10 points
Question 19
1. How many states can a Boolean expression represent?
one of 256
one of 10
one of 2
one of 14.7 million
10 points
Question 20
1. Usually, you compare only variables that have the same _____.
name
size
type
value
10 points
Question 21
1. PHP code can be placed anywhere within the HTML markup.
True
False
10 points
Question 22
1. $cost = 45.87;
declares a ________ variable with a value of 45.87
boolean
integer
floating-point (double)
string
10 points
Question 23
1. $username = ‘puppy’;
declares a ________ variable with a value of puppy.
boolean
integer
floating-point
string
10 points
Question 24
1. The _______ method takes one argument – the name of the variable whose type will be returned.
gettype()
settype()
returntype()
vartype()
10 points
Question 25
1. A whole number, positive, negative or zero has a data type of
boolean
integer
floating-point
string
10 points
Question 26
1. The data type used for values that are either true or false is
boolean
integer
floating-point
string
10 points
Question 27
1. This data type includes a decimal part, even if that decimal part is zero such as 34.0
boolean
integer
floating-point(double)
string
10 points
Question 28
1. These reserved words are words that have special meaning in the PHP language.
keywords
private
taken
booked
10 points
Question 29
1. Assume
$number = 14;
echo ++$number;
results in a displayed value of
13
14
15
141
10 points
Question 30
1. Assume
$number = 14;
echo $number++;
results in a displayed value of
13
14
15
141
10 points
Leave a reply