NEW
Font size
Worksheets[Hall] Functions With Parameters
Total questions: 28
Worksheet time: 13mins
What is on line 4?
Function Call
Function Definition
What is a better name for banana?
boatX
boatY
boatSize
boatColor
Is the code displayed a function call or a function definition?
function call
function definition
Looking at this function definition determine how many parameters drawEmoji has?
0
1
2
3
True or False - a function can have many definitions.
True
False
What is a better name for apple?
fishX
fishY
fishSize
fishColor
Is the code displayed a function call or a function definition?
function call
function definition
Looking at these function calls determine how many parameters drawSeaweed has?
3
4
5
6
What is a better name for cab?
fishX
fishY
fishSize
fishColor
How many times is drawSeaweed called?
7
4
5
6
What is a better name for apple?
boatX
boatY
boatSize
boatColor
Which of the following is NOT a good parameter name for a function that draws a boat?
boatColor
boatWidth
banana
boatY
How many parameters does the function drawFish most likely have if it is called as drawFish(100, 200, 'blue', 50)?
5
4
3
2
Which of the following is a function call?
function drawBoat(x, y, color, size) { ... }
drawBoat(50, 100, 'red', 30);
How many parameters does the function drawBoat most likely have if it is called as drawBoat(120, 80, 'yellow')?
2
3
4
5
What is drawBoat?
Custom Function
Stored Procedure
What is an example of a Stored Procedure?
draw = function() {....}
var drawFish = function() {....}
ellipse(.........)
size(600, 400)
Which stored procedure runs repeatedly?
setup
draw
What is the purpose of the variable in this code?
To store the X-POSITION of the ellipse
To store the Y-POSITION of the ellipse
To store the WIDTH of the ellipse
To store the HEIGHT of the ellipse
What is animating in this code?
the ellipse is moving RIGHT
the ellipse is moving DOWN
the ellipse is getting WIDER
the ellipse is getting TALLER
Which parameter controls the y-position?
ellipse ( param1, param2, param3, param4 );
param1
param2
param3
param4
What color intensity does 100 represent?
fill(120, 50, 100)
Red
Green
Blue
Meaningful Variable Names
What is a better name for xxx?
sunX
sunSize
shoeX
shoeY
Meaningful Variable Names
What is a better name for xxx?
sunX
sunY
varX
shoeY
Describe the animation.
Ellipse is moving RIGHT
Ellipse is moving SHRINKING
Ellipse is GROWING
Ellipse is moving DOWN
Meaningful Variable Names
What is a better name for xxx?
sunX
sunY
varX
shoeY
Describe the animation.
Ellipse is moving RIGHT
Ellipse is moving SHRINKING
Ellipse is GROWING
Ellipse is moving DOWN
Meaningful Variable Names
What is a better name for ball?
ballX
ballY
ballSize
ballWidth
