Quarter 3 Final Exam: Functions and Parameters

Quarter 3 Final Exam: Functions and Parameters

9th - 12th Grade

20 Qs

quiz-placeholder

Similar activities

BIM1014 Quiz 2

BIM1014 Quiz 2

KG - University

15 Qs

Pixlr E Review

Pixlr E Review

10th Grade

16 Qs

UNIT 1.2 MEMORY

UNIT 1.2 MEMORY

10th Grade

19 Qs

PTS Informatika Kelas 9 Semester Ganjil 2021-2022

PTS Informatika Kelas 9 Semester Ganjil 2021-2022

9th Grade

20 Qs

9.1 Homework #3

9.1 Homework #3

9th Grade

20 Qs

After Effect Intoduction

After Effect Intoduction

10th Grade - University

15 Qs

Pengetahuan Dasar Komputer

Pengetahuan Dasar Komputer

9th - 12th Grade

20 Qs

Visual Basic Assessment

Visual Basic Assessment

11th - 12th Grade

21 Qs

Quarter 3 Final Exam: Functions and Parameters

Quarter 3 Final Exam: Functions and Parameters

Assessment

Quiz

Computers

9th - 12th Grade

Practice Problem

Medium

Created by

Njemele Bush

Used 32+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Why do we write functions?


I. Make our code easier to understand by giving a readable name to a group of instructions

II. Avoid writing repeated code

III. Make our code reusable

II and III

I only

I and II

I, II, and III

2.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

In the following function printThreeTimes:


function printThreeTimes(word){

println(word);

println(word);

println(word);

}

What is the parameter of the function?

printThreeTimes

function

word

println

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the output of the following program?

function start(){

var x = 5;

sumTo(x);

println(x);

}


function sumTo(num){

var sum = 0;

for(var i = 0; i <= num; i++){

sum += i;

}

println(sum);

}

5

15

15

5

5

15

4.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

How many parameters go into the function sum, and how many return values come out of the function sum?


function sum(first, second, third){

var result = first + second + third;

println(first);

println(second);

println(third);

return result;

}

3 parameters go in, 1 return value comes out

3 parameters go in, 3 return values come out

1 parameter goes in, 4 return values come out

1 parameter goes in, 1 return value comes out

5.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

What is printed by the following program?


function product(x, y){

return x * y;

}


function difference(x, y){

return x - y;

}


function start(){

var x = 2;

var y = 5;

var value1 = product(x, y);

var value2 = difference(y, x);


var result = difference(value1, value2);

println(result);

}

-7

7

13

-13

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

True or false: Functions should have parameters.

True

False

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which statement allows us to return values from functions?

break

return

while

function

Create a free account and access millions of resources

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

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?