Formative 2

studied byStudied by 7 people
0.0(0)
get a hint
hint

15

1 / 79

encourage image

There's no tags or description

Looks like no one added any tags here yet for you.

80 Terms

1

15

$x=15;
Echo $x--;
What is the output?

  • 13

  • 14

  • 15

  • 16

New cards
2

new

Operator for Object instantiation

  • new

  • ()

  • @

  • start

New cards
3

\t

Escape Sequence for horizontal tab

  • \r

  • \h

  • \t

  • \n

New cards
4

10

$x=10;
Echo $x++;
What is the output?

  • 10

  • 12

  • 11

  • 13

New cards
5

30

$a=10;$
b=20;
If($a<$b)
{echo $a+$b;}
Else
{echo $a-$b;}
Question: what is the output of the code

  • -10

  • 40

  • 30

  • 20

New cards
6

NA

Associativity for Object instantiation

  • NA

  • Left

  • Middle

  • Right

New cards
7

Switch

Another code for condition

  • Get

  • Set

  • Pick

  • Switch

New cards
8

NA

Associativity for object instantiation

  • Right

  • NA

  • Left

  • Middle

New cards
9

/=

Division-assignment symbol

  • /=

  • /

  • //

  • ==/

New cards
10

while(expr){statement}

Syntax for while statement

  • while(statement){expr}

  • expr(while){statement}

  • while(expr){statement}

  • (expr)while{statement}

New cards
11

Valid

If($a == $b){}

  • Valid

  • Invalid

New cards
12

/

Symbol for division

  • =/

  • ?

  • /

  • \

New cards
13

#

Symbol use for Perl style single line comment

  • #

  • @

  • ^

  • $

New cards
14

Continue

statement causes execution of the current loop iteration to end and commence at the beginning of the next iteration.

  • If

  • Continue

  • Goto

  • Break

New cards
15

for(expr1;expr2;expr3){statement}

Syntax for for statement

  • for(expr1;expr2;expr3){statement}

  • for(expr1){statement}expr2

  • for(statement){expr}

  • for{expr1,expr2}(statement)

New cards
16

<=

Symbol for less than or equal to

  • <=

  • <

  • >

  • >=

New cards
17

For

Which of the following is not a conditional statement?

  • Else

  • Elseif

  • If

  • For

New cards
18

Nested if

What do you call a condition inside of a condition?

  • If any

  • If if

  • Inside if

  • Nested if

New cards
19

& ^ |

Operator for Bitwise AND, bitwise XOR, bitwise OR

  • & ^ |

  • ,,

  • &&||

  • ?:

New cards
20

Left

Associativity for Bitwise AND, bitwise XOR, bitwise OR

  • Right

  • Left

  • Middle

  • NA

New cards
21

@

Associativity for error suppression

  • %

  • @

  • ^

  • #

New cards
22

False

There is always default inside of the switch

  • False

  • True

New cards
23

Invalid

$m=3;
switch($m){
                case 1: echo “May”; break;
                case 2: echo “June”; break;
                case 3: echo “July”; break;
                default: echo “invalid”; break;
}
What is the output if $m is one?

  • May

  • Invalid

  • June

  • July

New cards
24

True

break statement is placed within the code of a loop to cause the program to break out of the loop statement.

  • False

  • True

New cards
25

Left

Associativity for Addition, subtraction, concatenation

  • Middle

  • Right

  • NA

  • Left

New cards
26

30

$u=30;
do{
                echo $y++;
}while($u<31);
What is the output?

  • 31

  • 32

  • 30

  • 33

New cards
27

If(expression){statement..}

Syntax for if statement

  • Expression…if(statement)

  • If(expression){statement..}

  • (expression)if{statement…}

  • Statement…if(expression)

New cards
28

do{statement}while(expr);

Syntax for do… while statement

  • do{statement}while(expr);

  • do(expr)while{statement}

  • while(do)expr{statement}

  • while{statement}do(expr)

New cards
29

=

Operator for assignment operators

  • >

  • =

  • +

New cards
30

hooray

$v=70;
if($v<=70) {
                echo “hooray”;
} else {
                Echo “hello”;
}
What is the output?

  • invalid

  • hooray

  • blank

  • hello

New cards
31

Left

Associativity for Division, multiplication, modulus

  • Middle

  • Right

  • Left

  • NA

New cards
32

7

$x=4;
$x++;
Echo $x+2
What is the output?

  • 8

  • 9

  • 7

  • 6

New cards
33

33

$u=30;
do{
                echo $y++;
}while($u<31);
What is the output if $y=33?

  • 32

  • 30

  • 31

  • 33

New cards
34

True

Do is a looping stamen

  • True

  • False

New cards
35

>=

Symbol for greater than or equal to

  • <

  • >=

  • >

  • <=

New cards
36

Rank A

$s=90;
if($s==80 && $s<90) {
                echo “Rank B”;
} else if($s>90){
                echo “Rank A”;
}else{
                echo “Rank C”;
}
What is the output if $s=1000?

  • Rank C

  • Rank A

  • Rank B

  • Error

New cards
37

*

Symbol for multiplication

  • X

  • =*

  • **

  • *

New cards
38

===

Symbol for identical to

  • !=

  • =

  • ==

  • ===

New cards
39

&&

Symbol for AND operator

  • $$

  • ||

  • &&

  • %%

New cards
40

12

$x=0;
for($i=1;$i<5;$i++){$x+=$i;}
echo $x;
What is the output if $x=2

  • 10

  • 12

  • 9

  • 15

New cards
41

Goto

statement is used to jump to other section of the program to support labels.

  • If

  • Goto

  • Break

  • Continue

New cards
42

[]

Operator for index enclosure

  • ()

  • ++

  • <<

  • []

New cards
43

Left

Associativity for Boolean AND, Boolean OR

  • Right

  • NA

  • Left

  • Middle

New cards
44

0

$x=0;
for($i=1;$i<5;$i++){$i+=$i;}
echo $x;
What is the output?

  • 0

  • 12

  • 5

  • 10

New cards
45

+

Symbol for addition

  • +

  • =+

  • ++

New cards
46

()

Operator for Expression subgrouping

  • @

  • []

  • ()

  • /

New cards
47

Operator

symbol that specifies a particular action in an expression.

  • Associativity

  • Precedence

  • Purpose

  • Operator

New cards
48
New cards
49
New cards
50
New cards
51
New cards
52
New cards
53
New cards
54

11

$x=10;
Echo ++$x;
What is the output?

  • 11

  • 14

  • 13

  • 12

New cards
55

Welcome to PHP

<?php
Echo ‘Welcome to PHP’;
?>
What is the output

  • Welcome to php

  • ‘welcome to php’

  • Welcome to PHP

  • “welcome to php”

New cards
56

!

Symbol for NOT

  • #

  • @

  • !

  • $

New cards
57

hello

$v=70;
if($v<=70) {
                echo “hooray”;
} else {
                Echo “hello”;
}
What is the output if the value of $v is 100?

  • hooray

  • invalid

  • hello

  • blank

New cards
58

==

Symbol for equal to

  • ==

  • ===

  • =

  • !=

New cards
59

--

Decrement symbol

  • +

  • ++

  • --

  • -

New cards
60

Statement

Complete the syntax
If(expression){
                __________;
}

  • Statement

  • Condition

  • Expression

  • Value

New cards
61

True

You can use many if condition in one php script

  • True

  • False

New cards
62

<

Symbol for less than

  • >=

  • >

  • <

  • <=

New cards
63

True

$ inside “ and “ are interpreted as variables thus it will display the value rather than the string that starts with $.

  • True

  • False

New cards
64

2

if(expression) {
statement…
} else {
                statement
}
How many condition/s

  • 1

  • 3

  • 4

  • 2

New cards
65

||

Symbol for OR operatpr

  • %%

  • &&

  • ||

  • $$

New cards
66

Right

Associativity for assignment operators

  • Middle

  • NA

  • Left

  • Right

New cards
67

True

elseif is one of the conditional statements in php

Group of answer choices

  • True

  • False

New cards
68

NA

Associativity for Expression subgrouping

  • NA

  • Left

  • Right

  • Middle

New cards
69

+=

Addition-assignment symbol

  • +=

  • +

  • ++

  • ==+

New cards
70

%

Symbol for modulus

  • $

  • ^

  • M

  • %

New cards
71

*=

Multiplication-assignment symbol

  • *=

  • ==*

  • *

  • **

New cards
72

5 4 3 2 1

$a=10;
while($a>0){ echo $a--.” ”;
}
What is the output if $a is 5?

  • 4 3 2 1

  • 5 4 3 2 1

  • 1 2 3 4

  • 1 2 3 4 5

New cards
73

switch($category)

Syntax for Switch

  • swt($cat)

  • $Cat($switch)

  • $switch($category)

  • switch($category)

New cards
74

Rank C

$s=90;
if($s==80 && $s<90) {
                echo “Rank B”;
} else if($s>90){
                echo “Rank A”;
}else{
                Echo “Rank C”;
}
What is the output if $s=50?

  • Rank C

  • Rank A

  • Error

  • Rank B

New cards
75

($a == 12) ? 5 : 1

Ternary format

  • ($a == 12) ? 5 : 1

  • (5 == f)::

  • ($a == 10)?5

  • (10 == $a):?1

New cards
76

++

Increment symbol

  • -

  • ++

  • +

  • --

New cards
77

10 9 8 7 6 5 4 3 2 1

$a=10;
while($a>0){ echo $a--.” ”;
}
What is the output?

  • 10 9 8 7 6 5 4 3 2 1

  • 9 8 7 6 5 4 3 2 1

  • 1 2 3 4 5 6 7 8 9

  • 1 2 3 4 5 6 7 8 9 10

New cards
78

>

Symbol for greater than

  • <

  • >

  • >=

  • <=

New cards
79

True

You can create multiple statements inside of an condition

  • False

  • True

New cards
80

>

if(7 __ 4)
{ echo “true”;}
Else
{ echo “false”;}
What is missing code to make the statements true?

  • !=

  • =

  • <

  • >

New cards

Explore top notes

note Note
studied byStudied by 9 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 33 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 14 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 14 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 71 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 2 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 1 person
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 12565 people
Updated ... ago
4.7 Stars(41)

Explore top flashcards

flashcards Flashcard47 terms
studied byStudied by 22 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard129 terms
studied byStudied by 39 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard73 terms
studied byStudied by 3 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard85 terms
studied byStudied by 78 people
Updated ... ago
5.0 Stars(2)
flashcards Flashcard43 terms
studied byStudied by 11 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard36 terms
studied byStudied by 3 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard67 terms
studied byStudied by 5 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard81 terms
studied byStudied by 13 people
Updated ... ago
5.0 Stars(1)