Search Header Logo

4/6 quiziz

Authored by D W

Computers

9th - 11th Grade

Used 10+ times

4/6 quiziz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

6 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which code segment results in "true" being returned if a number is even? Replace "MISSING CONDITION" with the correct code segment.

function isEven(num){

if(MISSING CONDITION){

return true;

} else {

return false;

}

}

num % 2 == 0;

num % 0 == 2;

num % 1 == 0;

num % 1 == 2;

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What will be printed to the console after this program runs?


var numbers = [2, 5, 3, 1, 6]


function changeNums(numList, addNum, subtractNum){

for(var i=0; i<numList.length; i++){

if(numList[i] % 3 == 0){

numList[i] = numList[i] + addNum;

} else {

numList[i] = numList[i] - subtractNum;

}

}

}


changeNums(numbers, 3, 2);

console.log(numbers);

[2, 5, 3, 1, 6]

[0, 3, 6, -1, 9]

[-1, 2, 6, -2, 8]

[5, 2, 6, 3, 9]

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Which call of the function correctly follows the instructions laid out in the API?

moveElement("button1", 2, 23);

moveElement("button1", "left", "thirty");

moveElement("button1", 30, "two");

moveElement("button1", "down", 25);

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Parameter

the value passed to the parameter

used to return the flow of control to the point where the procedure (also known as a function) was called and to return the value of expression.

Extracting shared features to generalize functionality

a variable in a function definition. Used as a placeholder for values that will be passed through the function.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Argument

The subdivision of a computer program into separate subprograms

the value passed to the parameter

a variable in a function definition. Used as a placeholder for values that will be passed through the function.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What will print to the console after running this code segment?

10

16

21

18

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?