QUESTION 1 An HTML form tag should contain _____ attribute which gives the path
ID: 2247197 • Letter: Q
Question
QUESTION 1
An HTML form tag should contain _____ attribute which gives the path to the page on the web server that will process form data submitted by the user.
an action
a method
a name
a size
4 points
QUESTION 2
The value property of an HTML radio button is either true or false.
True
False
4 points
QUESTION 3
Which of the following are logical operators? Choose all that apply.
&&
xor
||
!
#
4 points
QUESTION 4
Variable names must start with a ____.
dollar sign
a letter of the alphabet
an underscore
a hyphen
4 points
QUESTION 5
What does this code do?
$x = 4;
echo gettype($x);
"sends 'integer' to the user's browser"
"sends 'int' to the user's browser"
"sends 'is_numeric' to the user's browser"
"sends '4' to the user's browser"
4 points
QUESTION 6
When a user submits HTML form data to a web server the information is packaged up as name-value pairs where name is the name of the HTML form element and data is the value property held by that form element.
True
False
4 points
QUESTION 7
The echo command sends items to the users browser.
True
False
4 points
QUESTION 8
What does this code do?
$x = 4;
echo is_float($x);
sends the Boolean value 'false' to the user's browser
"sends 'integer' to the user's browser"
"sends 'float' to the user's browser"
sends the Boolean value 'true' to the user's browser
4 points
QUESTION 9
What does this code do?
$x = 4;
$y = (string)$x;
"it assigns $y the string value '4'
it produces an error
it sends the Boolean value 'true' to the user's browser
it sends the Boolean value 'false' to the user's browser
4 points
QUESTION 10
Which of the following are comparison operators? Choose all that apply.
>=
==
<
!=
===
=>
4 points
QUESTION 11
PHP has 4 scalar data types. What are they? Choose all that apply.
Integer
Boolean
Float
String
Array
Object
4 points
QUESTION 12
By default + is evaluated before /
True
False
4 points
QUESTION 13
"Assume an HTML form is submitted to your PHP page. What is the significance of the word $_POST in this code? "
$_POST is the name of the array used to hold the name=value pairs of an HTML form when the method of the HTML form that was submitted as given as POST.
$_POST is just a place holder and its actual name can be anything.
$_POST is the name of the array used to hold name=value pairs of an HTML form when the method of the HTML form that was submitted as given as GET.
4 points
QUESTION 14
"What does this code do?
$x = 4;
$y = settype($x, "float");
assigns $y the value 4.0
assigns $y the Boolean value true
assigns $y the Boolean value false
assigns $y the value 4
4 points
QUESTION 15
Assume an HTML for is submitted to your page. What is the significance of the word 'full_name' in this code?
full_name must be the the name attribute of the HTML form element that was submitted to the PHP page.
full_name is just a place holder and its actual name can be anything.
full_name is a reserved word and cannot be used as a variable name.
full_name should start with a dollar sign.
4 points
QUESTION 16
The value property of an HTML text box is whatever the user types in that text box.
True
False
4 points
QUESTION 17
By default && is evaluated before ||.
True
False
4 points
QUESTION 18
Variable names are case insensitive.
True
False
4 points
QUESTION 19
What is the value of $y after this runs?
$x = 5;
$y = ++$x;
6
4
5
0
4 points
QUESTION 20
PHP has 2 compound data types. What are they? Choose all that apply.
Object
Array
Boolean
Float
String
Integer
an action
a method
a name
a size
Explanation / Answer
Answer 1) an action attribute is used which gives the path to the page on the web server that will process form data submitted by the user.
Answer 2) Yes, it is true that the value property of an HTML radio button is either true or false.
Answer 3) LOGICAL OPERATORS are - && , || , ! (only these three)
Answer 4) Variable names must start with a letter of the alphabet or an underscore.
Answer 5) "sends 'integer' to the user's browser". Because gettype() in PHP returns the type of a variable.
Answer 6) True.
Answer 7) True.
Answer 8) sends the Boolean value 'false' to the user's browser. because is_float() tells us that whether a variable is float or not.
Answer 9) it assigns $y the string value '4' Because of type casting.
Answer 10) All the six operators mentioned are comparison operators.
Answer 11) Boolean,Integer,float,String are 4 scalar data types in php.
Answer 12) False, beacuse "/" has higher precedence than "+".
Answer 13) $_POST is the name of the array used to hold the name=value pairs of an HTML form when the method of the HTML form that was submitted as given as POST.
Answer 14) assigns $y the value 4.0 because settype() function sets the type of a variable.
Answer 15) full_name is a reserved word and cannot be used as a variable name.
Answer 16) True
Answer 17) True because "&&" has higher precedence than " || ".
Answer 18) True because variable names are Case-Sensitive in PHP.
Answer 19) $y will be 6 because due to pre-increment "++" operator,first value of x will be change and then assign to y.
Answer 20) 2 compound data types in PHP are "Array" and "Object".
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.