wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Calling Procedures

Total questions: 5

Worksheet time: 5mins

Name
Class
Date
1.

Which one of the following is NOT an input to this procedure or an output from this procedure?

a)

highGrade

b)

passingGrade

c)

count

d)

testGrade

2.

What can replace “<missing condition>” so that the procedure will display true if both the temperature is between 80 and 95, inclusive, and it is sunny and will display false if it is raining?

The parameter “a” is the temperature. The parameter “b” is a Boolean, true if it is sunny and false if it is raining.

Examples:

  • mystery [90, true] would display “Pool Party on Flag Day ”

  • mystery [90, false] would display “Pool Party is Cancelled”

  • mystery [100, true] would display “Pool Party is Cancelled”

  • mystery [95, false] would display “Pool Party is Cancelled”

a)

(a ≤ 80 ≥ 95) AND (b = true)

b)

(a ≥ 80 ≤ 95) AND (b = true)

c)

(a ≥ 80) AND (a ≤ 95) AND (b = true)

d)

(a ≤ 80) AND (a ≥ 95) AND (b = true)

3.

What will the following procedure display where “num” can be any integer (e.g., 0, 1, 2, 3, 4 …) ?

a)

All numbers from 0 to num

b)

All numbers from 0 to num with the exclusion of numbers divisible by 5

c)

All numbers from 1 to num

d)

All numbers from 1 to num with the exclusion of numbers divisible by 5

4.

What will the following call to the procedure display?


a)

stressed

b)

desserts

c)

list1

d)

backronym

5.

What will price contain after running the following code segment?


a)

[4, 8, 2, 12]

b)

[20, 40, 10, 60]

c)

[40, 80, 20, 120]

d)

[20, 80, 10, 120]