Font size
WorksheetsUnit5Review
Total questions: 25
Worksheet time: 2hrs 56mins
What is the first value of c in the for loop?
saddleBrown
pink
0
1
Look at line 28. What is the value of len(app.colors)
Impossible to tell
5
4
Which of the following is the best way to access the last item in this list?
len(nums)
nums[len(nums)]
nums(len(nums))
nums[len(nums) - 1]
nums[len(nums)] - 1
What is the parameter of this function?
first_last6
def
nums
Which of the following items are present in the function header?
Function name only
Both function name and parameter list
parameter list only
Return value
Consider the line of code:
Label('Go Team', 200, 100)
What is the Label?
argument
parameter
function name
When defining a function, the definition must occur before it is called.
true
false
What is the name for the code highlighted in red?
function name
function definition
parameters
arguments
Which quadrant will be affected by line 19?
Upper Left and Lower Left
Upper Left only
Lower Left only
Upper Left and Upper Righ
What is being accomplished in lines 20 - 23?
the value of redMouth label is being set to 'o-'
If the value of the redMouth label is '-', it is set to 'o'. The next time it will be set back to '-'
Programming languages have some similarities and differences to the "natural" language you use in everyday speech. Select the two true statements about programming languages:
Ambiguities in natural language necessitate the creation of programming languages for controlling a computer
Compared to the number of words in a natural language, the number of defined words in a programming language is very small.
The number of defined words in a programming language is about the same as the number of words in a natural language.
There are typically many possible ways to interpret an instruction written in a programming language.
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)
}
Which of the following is NOT true about functions in programming?
Functions are reusable programming abstractions.
Functions help reduce the complexity of writing and maintaining programs.
Functions cannot make calls to other functions within the same program.
Once defined, a function can be called many times from different parts of a program.
Functions help break a problem into logical chunks.
What is one important naming convention of functions?
A function name should indicate how long the function takes to run.
Two functions with similar behavior should be given identical names to indicate the relationship between them.
A function name should be as descriptive as possible to indicate what the function does.
Function names should be organized alphabetically.
The function name should begin with a number that indicates the order in which it should be executed.
When programmers work together, what is an example of how abstraction in programming can promote collaboration?
Team members can rely on one another to explain their code.
Programmers can write functions without needing to know what they do or how they should work.
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.
In order for programmers to work together, they must work in the same room.
Abstraction allows programmers to brainstorm more creative solutions to problems.
Why are these icons a good use of abstraction?
They tell us what they mean without needing to use the name
They are difficult to understand
They don't explain what they are
What do parameters used in a procedure provide?
A way to get values into the procedure, making the code more flexible
A way to return values calculated in the procedure back to the calling program
A way to call a procedure from within another procedure
A way to connect an API to the procedure
An extra piece of information passed to a function to customize it for a specific need
Parameter
Library
Function
Block
An error in a program that prevents the program from running as expected
onEvent
Bug
Moth
Fly in the Ointment
A set of steps you can follow in order to solve a problem or achieve a result often written down in regular spoken language.
Debugging
Event
Algorithm
Computer Program
