Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Question 6 Not yet answered Marked out of 1.00 Not flaggedFlag question Question

ID: 3730119 • Letter: Q

Question

Question 6
Not yet answered
Marked out of 1.00
Not flaggedFlag question
Question text
What is the correct way to add 1 to the $count variable?

Select one:
a. $count =+1
b. ++count
c. count+;
d. None of the above
Question 7
Not yet answered
Marked out of 1.00
Not flaggedFlag question
Question text
What will the value of $x be at the end of this script?

<?PHP
$x=0;
$x=$x+1;
echo $x.” value”;
$x++;
?>

Select one:
a. 1
b. 2
c. 3
d. There will be an error
Question 8
Not yet answered
Marked out of 1.00
Not flaggedFlag question
Question text
What will be displayed by this code?

<?php   
FUNCTION TEST()   
{
ECHO "HELLO WORLD! ";  
}
test();
?>

Select one:
a. Nothing
b. test()
c. Blinking text
d. HELLO WORLD!
Question 9
Not yet answered
Marked out of 1.00
Not flaggedFlag question
Question text
What will be printed?

$var = true;
if ($var) {
echo 'true';
} else {
echo 'false';
}

Select one:
a. false
b. error
c. warning
d. true
Question 10
Not yet answered
Marked out of 1.00
Not flaggedFlag question
Question text
Which of the following is a valid way to start a for loop in PHP that would print out the numbers 0 through 4?

Select one:
a. for($i < 5; $i = 0;)
b. for($i = 0; $i < 5; $i++)
c. for($i < 5;)
d. for( $i < 5; $i = 0; $i++)

Explanation / Answer

Question 6
What is the correct way to add 1 to the $count variable?
Answer: Option d. None of the above
Question 7

What will the value of $x be at the end of this script?
<?PHP
$x=0;
$x=$x+1;
echo $x.” value”;
$x++;
?>
Answer: Option a. 1

Question 8
What will be displayed by this code?
<?php   
FUNCTION TEST()   
{
ECHO "HELLO WORLD! ";  
}
test();
?>
Answer: Option d. HELLO WORLD!

Question 9
What will be printed?
$var = true;
if ($var) {
echo 'true';
} else {
echo 'false';
}
Answer: Option d. true
Question 10

Which of the following is a valid way to start a for loop in PHP that would print out the numbers 0 through 4?
Program:
<?php

for($i = 0; $i < 5; $i++)

{

echo $i;

echo " ";

}

?>

Output: 0 1 2 3 4


Answer: Option b) for($i = 0; $i < 5; $i++)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote