APPDEV Midterm Exam Reviewer

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/502

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 5:24 AM on 5/31/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

503 Terms

1
New cards

you are the god of php css programming language and the master of application development: $a[]="mango";

$a[]="apple";

$a[]="banana";

Check the code if valid or invalid?

Group of answer choices

Valid

Invalid

Valid

2
New cards

foreach(____ as $value)

Group of answer choices

array

$arr

arr$

arr

$arr

3
New cards

Functions can be user defined generally defined by the user of the program and predefined that are build in using libraries.

Group of answer choices

False

True

True

4
New cards

$t = 100;

function one(){

echo "value";

}

one();

what is the function name inside of the code?

Group of answer choices

$t

one

1

value

one

5
New cards

Array can be used as ordinary array same as in

Group of answer choices

Python

Ruby

C and C++

Java

C and C++

6
New cards

function a($a,$b){

return $a+$b;

}

echo a(6,5);

what is the value of $a?

Group of answer choices

11

Error

6

5

6

7
New cards

functions that are provided by the user of the program.

Group of answer choices

User function

User defined function

Predefined function

Program function

User defined function

8
New cards

Functions are designed to allow you to reuse the same code in different locations.

Group of answer choices

False

True

True

9
New cards

What is the keyword use to gain access a variable that is outside of the function?

Group of answer choices

Call

Default

Global

Overall

Global

10
New cards

PHP array does need to declare how many elements that the array variable have.

Group of answer choices

False

True

False

11
New cards

$s = "variable";

function f(){

global $s;

echo "function called ";

echo "$s";

}

f();

what is the output of the code?

Group of answer choices

function called variable

function called undefined variable: s

function called

function variable

function called variable

12
New cards

Sorts by a function

Group of answer choices

krsort($array)

usort($array)

ksort($array)

kusort($array)

usort($array)

13
New cards

Function can have a return value

Group of answer choices

False

True

True

14
New cards

rsort(), arsort(), and krsort() functions are used to sort elements in the array in descending order.

Group of answer choices

False

True

True

15
New cards

$g = 200;

function a(){echo "5";}

function b(){echo "4";}

a();

what is the value of the $g?

Group of answer choices

Error

5

200

4

200

16
New cards

PHP array does not need to declare how many elements that the array variable have.

Group of answer choices

False

True

True

17
New cards

it is required to create a function name for a function

Group of answer choices

True

False

True

18
New cards

You can create a function inside of a function

Group of answer choices

False

True

True

19
New cards

Functions are limited to 1 per code only

Group of answer choices

True

False

False

20
New cards

Array can be used as ordinary array same as in C and C++ arrays.

Group of answer choices

True

False

True

21
New cards

is used to aggregate a series of similar items together, arranging and dereferencing them in some specific way.

Group of answer choices

Array

Index

Function

Variable

Array

22
New cards

var_dump function is same as print_r function except it adds additional information about the data of each element.

Group of answer choices

False

True

True

23
New cards

$fruit = array("orange","apple","grape","banana");

What is the value of index 0?

Group of answer choices

grape

banana

apple

orange

orange

24
New cards

Id the keyword used to declare a function

Group of answer choices

fntn

ft

function

func

function

25
New cards

$g = 200;

function a(){echo "5";}

function b(){echo "4";}

a();b();

what is the output of the code?

Group of answer choices

Error

45

54

200

54

26
New cards

$t = 100;

function one(){

echo "1000";

}

one();

what is the value of the $t after execute the code?

Group of answer choices

1000

100

1

Error

100

27
New cards

$f = array(

'102' => "red",

'101' => "blue",

'100' => "yellow");

krsort($f);

print_r($f);

What is the output of the code?

Group of answer choices

Array ( [102] => red [101] => blue [100] => yellow )

Array ( [102] => yellow [101] => blue [100] => red )

Array ( [100] => yellow [101] => blue [102] => red )

Array ( [100] => red [101] => blue [102] => yellow )

Array ( [102] => red [101] => blue [100] => yellow )

28
New cards

Function count($val){

$c = 0;

$c += $val;

echo $c;

}

count(10);

count(5);

What is the output of the code?

Group of answer choices

5

105

15

Error

105

29
New cards

You can pass values to a function and you can ask functions to return a value.

Group of answer choices

False

True

True

30
New cards

This takes an argument of any type and prints it out, which includes printing all its parts recursively.

Group of answer choices

print_a()

print_p()

print_r()

print_c()

print_r()

31
New cards

function a($a,$b){

return $a+$b;

}

echo a(5,4);

what is the name of the parameter?

Group of answer choices

B

a

$a

$b

$b

32
New cards

functions are commonly used for debugging. The point of this of these functions is to help you visualize what's going on with compound data structures like arrays.

Group of answer choices

print_p() and var_add()

print_r() and var_dump()

print_a() and var_size()

print_c() and var_info()

print_r() and var_dump()

33
New cards

Sorts by value in reverse order; assign new number as the keys

Group of answer choices

arsort($array)

asort($array)

rsort($array)

sort($array)

rsort($array)

34
New cards

$f = array(

'102' => "red",

'101' => "blue",

'100' => "yellow");

ksort($f);

print_r($f);

What is the output of the code?

Group of answer choices

Array ( [100] => red [101] => blue [102] => yellow )

Array ( [102] => yellow [101] => blue [100] => red )

Array ( [100] => yellow [101] => blue [102] => red )

Array ( [102] => red [101] => blue [100] => yellow )

Array ( [100] => yellow [101] => blue [102] => red )

35
New cards

is a statement used to iterate or loop through the element in an array.

Group of answer choices

foreach()

seteach()

everyeach()

everyone()

foreach()

36
New cards

is one that declared outside a function and is available to all parts of the program.

Group of answer choices

Static variables

Dynamic variables

Global variables

Local variables

Global variables

37
New cards

Each member of the array index references a corresponding value and can be a simple numerical reference to the value's position in the series, or it could have some direct correlation to the value.

Group of answer choices

True

False

True

38
New cards

Sorts by value in reverse order; keeps the same key

Group of answer choices

sort($array)

arsort($array)

asort($array)

rsort($array)

arsort($array)

39
New cards

function is used to print the array structure.

Group of answer choices

print_f

print_s

print_r

print_a

print_r

40
New cards

You can create your own function inside of a php code

Group of answer choices

True

False

True

41
New cards

Function count($val){

static $c = 0;

$c += $val;

echo $c;

}

Count(4);

Count(3);

What is the output of the code?

Group of answer choices

43

Error

47

7

47

42
New cards

function disp(){

function disp2(){

echo "hello";

}

}

disp();

disp2();

Group of answer choices

blank

disp

hello

error

hello

43
New cards

Sorts by value; assign new numbers as the keys

Group of answer choices

arsort($array)

rsort($array)

asort($array)

sort($array)

sort($array)

44
New cards

You use can functions in different ways.

Group of answer choices

False

True

True

45
New cards

param - is the formal parameters of the function. Parameter must follow the rule of naming dentifier.

Group of answer choices

False

True

True

46
New cards

The foreach statement is use to iterate through the element in an array.

Group of answer choices

False

True

True

47
New cards

$fruit = array("orange","apple","grape","banana");

What is the value of index 2?

Group of answer choices

banana

grape

apple

orange

grape

48
New cards

Array index is also known as Array Keys.

Group of answer choices

True

False

True

49
New cards

Functions can only have 1 parameter

Group of answer choices

False

True

False

50
New cards

prints additional information about the size and type of the values it discovers

Group of answer choices

var_dump()

var_add()

var_info()

var_size()

var_dump()

51
New cards

Function count($val){

static $c = 0;

$c += $val;

echo $c;

}

count(4);

count(3);

What is the output of the code?

Group of answer choices

47

7

error

43

47

52
New cards

We use static keyword to declare a variable inside a function that will act as accumulator variable this will let the program remember the last value of the variable that was used.

Group of answer choices

False

True

True

53
New cards

function keyword is used in PHP to declare a function.

Group of answer choices

True

False

True

54
New cards

is used to retain the values calls to the same function.

Group of answer choices

Static variables

Dynamic variables

Global variables

Local variables

Static variables

55
New cards

Array index in PHP can be also called as array storage

Group of answer choices

True

False

False

56
New cards

Local Variables is one that declared outside a function and is available to all parts of the program.

Group of answer choices

False

True

False

57
New cards

$g = 200;

function a(){echo "5";}

function b(){echo "4";}

ab();

what is the output of the code?

Group of answer choices

error

200

54

45

error

58
New cards

sort(), asort(), and ksort() functions are used to sort elements in the array in ascending order.

Group of answer choices

True

False

True

59
New cards

$g = 200;

function a(){echo "5";}

function b(){echo "4";}

a();

what is the output of the code?

Group of answer choices

4

5

200

A

5

60
New cards

is declared inside a function and is only available within the function in which it is declared.

Group of answer choices

Global variables

Dynamic variables

Local variables

Static variables

Local variables

61
New cards

What do you call a function inside of a function

Group of answer choices

Double function

Nested function

Function fun

Loop function

Nested function

62
New cards

is a group of PHP statements that performs a specific task. Functions are designed to allow you to reuse the same code in different locations.

Group of answer choices

Functions

Variables

Arrays

Operators

Functions

63
New cards

specify an array expression within a set of parenthesis following the foreach keyword.

Group of answer choices

False

True

True

64
New cards

$mo = array("jan","feb","mar");

echo "

";

var_dump ($mo);

echo "";

Check the code if valid or invalid?

Group of answer choices

Invalid

Valid

valid

65
New cards

$f = array(

'102' => "red",

'101' => "blue",

'100' => "yellow");

ksort($f);

print_r($f);

What is the key of the yellow?

Group of answer choices

102

Error

100

101

100

66
New cards

functions that are built-in into PHP to perform some standard operations

Group of answer choices

User function

User defined functions

Program functions

Predefined functions

Predefined functions

67
New cards

references a corresponding value.

Group of answer choices

Array collection

Array index

Array number

Array setting

Array index

68
New cards

$g = 200;

function a(){echo "5";}

function b(){echo "4";}

b();

what is the output of the code?

Group of answer choices

Error

200

5

4

4

69
New cards

Global Variables is declared inside a function and is only available within the function in which it is declared.

Group of answer choices

False

True

False

70
New cards

foreach($arr as ___ => $value){

//do something

}

Group of answer choices

$get

$var

$set

$key

$key

71
New cards

PHP has a built-in function to perform operations

Group of answer choices

True

False

True

72
New cards

Functions is a group of PHP statements that performs a specific task.

Group of answer choices

False

True

True

73
New cards

function disp(){

function disp2(){

echo "hello";

}

}

Disp();

disp2();

Group of answer choices

blank

hello

disp

error

error

74
New cards

You can insert CCS code inside of a function

Group of answer choices

True

False

False

75
New cards

asort() and arsort() used to sort elements by keys.

Group of answer choices

False

True

False

76
New cards

To gain access to a variable that is outside from the function we use the global keyword.

Group of answer choices

False

True

True

77
New cards

function a($a,$b){

return $a+$b;

}

echo a(5,4);

what is the output of the code?

Group of answer choices

4

9

5

Error

9

78
New cards

sort() and rsort() does not maintain its index reference for each values.

Group of answer choices

False

True

True

79
New cards

Sorts by key in reverse order

Group of answer choices

usort($array)

krsort($array)

ksort($array)

kusort($array)

krsort($array)

80
New cards

$num=array(1,2,3,4,5);

foreach(num as $val){

echo $val;

}

Check the code if valid or invalid?

Group of answer choices

Valid

Invalid

Invalid

81
New cards

$fruit = array("orange","apple","grape","banana");

What is the value of index 3?

Group of answer choices

orange

grape

apple

banana

banana

82
New cards

Array is used to aggregate a series of similar items together.

Group of answer choices

True

False

True

83
New cards

Sorts by key

Group of answer choices

ksort($array)

krsort($array)

kusort($array)

usort($array)

ksort($array)

84
New cards

Function can only do something without passing values.

Group of answer choices

True

False

True

85
New cards

Array index in PHP can be also called

Group of answer choices

Array number

Array keys

Array storage

Array set

Array keys

86
New cards

asort(), ksort(), arsort(), and krsort() maintains its reference for each values.

Group of answer choices

False

True

True

87
New cards

Syntax of a function

Group of answer choices

Function name(param){}

Param_function

Param (function name){}

Function name {param}

Function name(param){}

88
New cards

foreach($arr as ______)

Group of answer choices

val

val$

$value

value$

$value

89
New cards

$num=array(1,2,3,4,5);

foreach($num as $val){

echo $val;

}

What is the output of the code?

Group of answer choices

Error

1

5

12345

12345

90
New cards

Sorts by value; keeps the same key

Group of answer choices

arsort($array)

rsort($array)

asort($array)

sort($array)

asort($array)

91
New cards

You can use only 10 for Array elements

Group of answer choices

True

False

False

92
New cards

Using foreach statement you can display both the keys and value of each element in the array.

Group of answer choices

False

True

True

93
New cards

Functions is a group of PHP statements that performs a specific task.

Group of answer choices

False

True

True

94
New cards

Format character for a full number representation of a year, 4 digits

Group of answer choices

y

r

c

Y

Y

95
New cards

$g = 200;

function a(){echo "5";}

function b(){echo "4";}

a();b();

what is the output of the code?

Group of answer choices

Error

45

54

200

54

96
New cards

Format character for a full textual representation of the day of the week

Group of answer choices

t

w

d

l

l

97
New cards

Sorts by value in reverse order; keeps the same key

Group of answer choices

sort($array)

asort($array)

rsort($array)

arsort($array)

arsort($array)

98
New cards

Functions are limited to 1 per code only

Group of answer choices

False

True

False

99
New cards

Local Variables is one that declared outside a function and is available to all parts of the program.

Group of answer choices

True

False

False

100
New cards

var_dump function is same as print_r function except it adds additional information about the data of each element.

Group of answer choices

False

True

True