wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Unit5Review

Total questions: 25

Worksheet time: 2hrs 56mins

Name
Class
Date
1.

What is the first value of c in the for loop?

a)

saddleBrown

b)

pink

c)

0

d)

1

2.

Look at line 28. What is the value of len(app.colors)

a)

Impossible to tell

b)

5

c)

4

3.

Which of the following is the best way to access the last item in this list?

a)

len(nums)

b)

nums[len(nums)]

c)

nums(len(nums))

d)

nums[len(nums) - 1]

e)

nums[len(nums)] - 1

4.

What is the parameter of this function?

a)

first_last6

b)

def

c)

nums

5.
What will print?
a)
nothing
b)
5
c)
6
d)
an error message
6.

Which of the following items are present in the function header?

a)

Function name only

b)

Both function name and parameter list

c)

parameter list only

d)

Return value

7.

Consider the line of code:

Label('Go Team', 200, 100)

What is the Label?

a)

argument

b)

parameter

c)

function name

8.

When defining a function, the definition must occur before it is called.

a)

true

b)

false

9.

What is the name for the code highlighted in red?

a)

function name

b)

function definition

c)

parameters

d)

arguments

10.

Which quadrant will be affected by line 19?

a)

Upper Left and Lower Left

b)

Upper Left only

c)

Lower Left only

d)

Upper Left and Upper Righ

11.

What is being accomplished in lines 20 - 23?

a)

the value of redMouth label is being set to 'o-'

b)

If the value of the redMouth label is '-', it is set to 'o'. The next time it will be set back to '-'

12.

Programming languages have some similarities and differences to the "natural" language you use in everyday speech. Select the two true statements about programming languages:

a)

Ambiguities in natural language necessitate the creation of programming languages for controlling a computer

b)

Compared to the number of words in a natural language, the number of defined words in a programming language is very small.

c)

The number of defined words in a programming language is about the same as the number of words in a natural language.

d)

There are typically many possible ways to interpret an instruction written in a programming language.

13.

Which of the following images shows the path and ending location of the robot that will result from executing the code above. The starting location of the robot is shown as dotted triangle for cases where the robot does not start and end at the same location.


REPEAT 4 TIMES {

MOVE_FORWARD()

MOVE_FORWARD()

MOVE_FORWARD()

ROTATE_RIGHT(90)

MOVE_FORWARD()

ROTATE_RIGHT(90)

MOVE_FORWARD()

ROTATE_RIGHT(90)

}

a)
b)
c)
d)
14.

Which of the following is NOT true about functions in programming?

a)

Functions are reusable programming abstractions.

b)

Functions help reduce the complexity of writing and maintaining programs.

c)

Functions cannot make calls to other functions within the same program.

d)

Once defined, a function can be called many times from different parts of a program.

e)

Functions help break a problem into logical chunks.

15.

What is one important naming convention of functions?

a)

A function name should indicate how long the function takes to run.

b)

Two functions with similar behavior should be given identical names to indicate the relationship between them.

c)

A function name should be as descriptive as possible to indicate what the function does.

d)

Function names should be organized alphabetically.

e)

The function name should begin with a number that indicates the order in which it should be executed.

16.
Know how to drive a car without knowing how the engine works is an example of abstraction 
a)
True
b)
False
17.

When programmers work together, what is an example of how abstraction in programming can promote collaboration?

a)

Team members can rely on one another to explain their code.

b)

Programmers can write functions without needing to know what they do or how they should work.

c)

Programmers can use functions created by their partners, relying on the functionality without needing to know the specific details of how the function is implemented.

d)

In order for programmers to work together, they must work in the same room.

e)

Abstraction allows programmers to brainstorm more creative solutions to problems.

18.

Why are these icons a good use of abstraction?

a)

They tell us what they mean without needing to use the name

b)

They are difficult to understand

c)

They don't explain what they are

19.

What do parameters used in a procedure provide?

a)

A way to get values into the procedure, making the code more flexible

b)

A way to return values calculated in the procedure back to the calling program

c)

A way to call a procedure from within another procedure

d)

A way to connect an API to the procedure

20.

An extra piece of information passed to a function to customize it for a specific need

a)

Parameter

b)

Library

c)

Function

d)

Block

21.

An error in a program that prevents the program from running as expected

a)

onEvent

b)

Bug

c)

Moth

d)

Fly in the Ointment

22.

A set of steps you can follow in order to solve a problem or achieve a result often written down in regular spoken language.

a)

Debugging

b)

Event

c)

Algorithm

d)

Computer Program

23.
A generic term for a type of programming statement (usually an if-statement) that uses a Boolean condition to determine, or select, whether or not to run a certain block of statements.
a)
Algorithm
b)
Sequencing
c)
Iterate
d)
Selection
24.
To repeat in order to achieve, or get closer to, a desired goal
a)
Algorithm
b)
Sequencing
c)
Iterate
d)
Selection
25.
Putting commands in correct order so computers can read the commands
a)
Algorithm
b)
Sequencing
c)
Iterate
d)
Selection