wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

[Hall] Functions With Parameters

Total questions: 28

Worksheet time: 13mins

Name
Class
Date
1.

What is on line 4?

a)

Function Call

b)

Function Definition

2.

What is a better name for banana?

a)

boatX

b)

boatY

c)

boatSize

d)

boatColor

3.

Is the code displayed a function call or a function definition?

a)

function call

b)

function definition

4.

Looking at this function definition determine how many parameters drawEmoji has?

a)

0

b)

1

c)

2

d)

3

5.

True or False - a function can have many definitions.

a)

True

b)

False

6.

What is a better name for apple?

a)

fishX

b)

fishY

c)

fishSize

d)

fishColor

7.

Is the code displayed a function call or a function definition?

a)

function call

b)

function definition

8.

Looking at these function calls determine how many parameters drawSeaweed has?

a)

3

b)

4

c)

5

d)

6

9.

What is a better name for cab?

a)

fishX

b)

fishY

c)

fishSize

d)

fishColor

10.

How many times is drawSeaweed called?

a)

7

b)

4

c)

5

d)

6

11.

What is a better name for apple?

a)

boatX

b)

boatY

c)

boatSize

d)

boatColor

12.

Which of the following is NOT a good parameter name for a function that draws a boat?

a)

boatColor

b)

boatWidth

c)

banana

d)

boatY

13.

How many parameters does the function drawFish most likely have if it is called as drawFish(100, 200, 'blue', 50)?

a)

5

b)

4

c)

3

d)

2

14.

Which of the following is a function call?

a)

function drawBoat(x, y, color, size) { ... }

b)

drawBoat(50, 100, 'red', 30);

15.

How many parameters does the function drawBoat most likely have if it is called as drawBoat(120, 80, 'yellow')?

a)

2

b)

3

c)

4

d)

5

16.

What is drawBoat?

a)

Custom Function

b)

Stored Procedure

17.

What is an example of a Stored Procedure?

a)

draw = function() {....}

b)

var drawFish = function() {....}

c)

ellipse(.........)

d)

size(600, 400)

18.

Which stored procedure runs repeatedly?

a)

setup

b)

draw

19.

What is the purpose of the variable in this code?

a)

To store the X-POSITION of the ellipse

b)

To store the Y-POSITION of the ellipse

c)

To store the WIDTH of the ellipse

d)

To store the HEIGHT of the ellipse

20.

What is animating in this code?

a)

the ellipse is moving RIGHT

b)

the ellipse is moving DOWN

c)

the ellipse is getting WIDER

d)

the ellipse is getting TALLER

21.

Which parameter controls the y-position?


ellipse ( param1, param2, param3, param4 );

a)

param1

b)

param2

c)

param3

d)

param4

22.

What color intensity does 100 represent?

fill(120, 50, 100)

a)

Red

b)

Green

c)

Blue

23.

Meaningful Variable Names

What is a better name for xxx?

a)

sunX

b)

sunSize

c)

shoeX

d)

shoeY

24.

Meaningful Variable Names

What is a better name for xxx?

a)

sunX

b)

sunY

c)

varX

d)

shoeY

25.

Describe the animation.

a)

Ellipse is moving RIGHT

b)

Ellipse is moving SHRINKING

c)

Ellipse is GROWING

d)

Ellipse is moving DOWN

26.

Meaningful Variable Names

What is a better name for xxx?

a)

sunX

b)

sunY

c)

varX

d)

shoeY

27.

Describe the animation.

a)

Ellipse is moving RIGHT

b)

Ellipse is moving SHRINKING

c)

Ellipse is GROWING

d)

Ellipse is moving DOWN

28.

Meaningful Variable Names

What is a better name for ball?

a)

ballX

b)

ballY

c)

ballSize

d)

ballWidth