Functions and Parameters

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

13 questions
Show all answers
1.
FLASHCARD QUESTION
Front
Why do we write functions?
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 Wayground
5 questions
Enhanced For Loops

Flashcard
•
10th - 12th Grade
15 questions
CSA Review -2nd 9 Weeks

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

Flashcard
•
11th Grade
14 questions
4.5 Function Operations

Flashcard
•
9th - 12th Grade
7 questions
Java Basics #2

Flashcard
•
10th - 12th Grade
12 questions
Code.org Unit 6 Assessment Day

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

Flashcard
•
9th - 12th Grade
9 questions
Java For Loops

Flashcard
•
9th - 12th Grade
Popular Resources on Wayground
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
Discover more resources for Computers
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
40 questions
LSHS Student Handbook Review: Pages 7-9

Quiz
•
11th Grade
24 questions
Scientific method and variables review

Quiz
•
9th Grade
10 questions
Characteristics of Life

Quiz
•
9th - 10th Grade
19 questions
Mental Health Vocabulary Pre-test

Quiz
•
9th Grade