Quarter 3 Final Exam: Functions and Parameters

Quiz
•
Computers
•
9th - 12th Grade
•
Medium
Njemele Bush
Used 32+ times
FREE Resource
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
Similar Resources on Wayground
25 questions
JAVASCRIPT

Quiz
•
12th Grade
17 questions
Cumulative Test Practice Units 1, 3, 4, 5, & 7

Quiz
•
9th - 12th Grade
15 questions
Quiz 2: Rust for beginner

Quiz
•
9th Grade
20 questions
OOP Java

Quiz
•
12th Grade
15 questions
Examen Tema 4 Array, Funciones y Objetos JavaScript

Quiz
•
12th Grade
20 questions
Computer Application Practice Quiz Class 10

Quiz
•
10th Grade
20 questions
AQA GCSE Computer Science - 3.2.10 Subroutines

Quiz
•
8th - 10th Grade
20 questions
uCertify Chapter 1 Test

Quiz
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
10 questions
Proper Keyboarding Techniques

Interactive video
•
6th - 10th Grade
14 questions
Inputs and Outputs: Computer Science Intro

Lesson
•
5th - 9th Grade
10 questions
Understanding Computers: Hardware, Software, and Operating Systems

Interactive video
•
7th - 12th Grade
29 questions
AP CSP Unit 2 Review (Code.org)

Quiz
•
10th - 12th Grade