Why do we write functions?
Functions and Parameters

Flashcard
•
Computers
•
9th - 12th Grade
•
Hard
Quizizz Content
FREE Resource
Student preview

13 questions
Show all answers
1.
FLASHCARD QUESTION
Front
Back
Make our code easier to understand by giving a readable name to a group of instructions, Avoid writing repeated code, Make our code reusable.
2.
FLASHCARD QUESTION
Front
What is the parameter of the function in the following code: function printThreeTimes(word){ println(word); println(word); println(word); }
Back
word
3.
FLASHCARD QUESTION
Front
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);
}
Back
15
5
4.
FLASHCARD QUESTION
Front
What is printed by the following program?
function printNumbers(two, one, zero){
println(two);
println(one);
println(zero);
}
function start(){
var zero = 0;
var one = 1;
var two = 2;
printNumbers(zero, one, two);
}
Back
0
1
2
5.
FLASHCARD QUESTION
Front
How many parameters to 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; }
Back
3 parameters go in, 1 return value comes out
6.
FLASHCARD QUESTION
Front
We want to write a function isSuperman that takes in two parameters isBird and isPlane and returns true if it in in fact Superman, and false otherwise. If it's not a bird and it's not a plane, it must be Superman. Which of the following functions is the correct implementation of isSuperman?
Back
function isSuperman(isBird, isPlane){
return !isBird && !isPlane;
}
7.
FLASHCARD QUESTION
Front
What are the names of the parameters in the following code:
function start(){
var length = 5;
var width = 4;
rectangleArea(length,width);
}
function rectangleArea(base, height){
var area - base * height;
println(area);
}
Back
base and height
Create a free account and access millions of resources
Similar Resources on Quizizz
15 questions
CSA Review -2nd 9 Weeks

Flashcard
•
9th - 12th Grade
11 questions
Java Boolean Statements

Flashcard
•
11th Grade
16 questions
Loops Flashcard

Flashcard
•
9th - 12th Grade
15 questions
Adding & Subtracting Functions

Flashcard
•
9th - 12th Grade
15 questions
Operation and Composition of Functions

Flashcard
•
9th - 12th Grade
14 questions
Javascript Control Structures Practice

Flashcard
•
9th - 12th Grade
8 questions
Unit #4- Loops and Nested Loops

Flashcard
•
9th - 12th Grade
14 questions
Function Operations

Flashcard
•
9th - 12th Grade
Popular Resources on Quizizz
15 questions
Multiplication Facts

Quiz
•
4th Grade
20 questions
Math Review - Grade 6

Quiz
•
6th Grade
20 questions
math review

Quiz
•
4th Grade
5 questions
capitalization in sentences

Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance

Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions

Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines

Quiz
•
Professional Development
12 questions
Dividing Fractions

Quiz
•
6th Grade
Discover more resources for Computers
25 questions
Spanish preterite verbs (irregular/changed)

Quiz
•
9th - 10th Grade
10 questions
Identify Slope and y-intercept (from equation)

Quiz
•
8th - 9th Grade
10 questions
Juneteenth: History and Significance

Interactive video
•
7th - 12th Grade
8 questions
"Keeping the City of Venice Afloat" - STAAR Bootcamp, Day 1

Quiz
•
9th - 12th Grade
26 questions
June 19th

Quiz
•
4th - 9th Grade
20 questions
Distance, Midpoint, and Slope

Quiz
•
10th Grade
20 questions
Figurative Language Review

Quiz
•
10th Grade
27 questions
STAAR English 1 Review

Quiz
•
9th Grade