logic and computers chapter 5-9 Flashcards
This instruction is used to repeat other instructions a specific number of times.
C. Loop
This is a type of variable that the Loop instruction uses internally.
B. Counter
This is a loop that repeats without ending.
A. Infinite
This instruction is a count-controlled loop.
C. Loop
This instruction is a conditional loop.
D. While
This is a loop that is inside another loop.
A. Nested loop
A loop is inside another loop. The outer loop repeats 5 times and the inner loop repeats 4 times. How many times will a statement that is inside the inner loop execute?
D. 20 times
If you want to add a new behavior to an object, you add this type of method to it.
B. Class-level method
After you have saved an object to a new class, you do this to add an instance of it to a world.
C. Click File, then Import…
In this process, the programmer goes through each step in an algorithm, expanding it until it has enough detail to be translated into actual instructions.
B. Divide and conquer
This is a special variable that holds an argument being passed into a method.
C. Parameter
In Alice, a property is really one of these.
B. A class-level variable
This instruction is required in all functions.
A. Return
This is the process of breaking a long complex algorithm into small manageable pieces.
D. Divide and conquer
To insert a graphical image into a world, you create one of these.
B. Billboard
This property specifies that the object will move with another object.
A. vehicle
You use this primitive method call to move the camera to a dummy object.
C. camera.set point of view to
This is what the process of responding to an event is called.
C. Handling the event
When an Alice world is first created, this is the event for which the only tile appears in the Events Editor.
A. When the world starts
This is an event handler.
B. A method that is executed in response to an event
This is what BDE stands for
C. Begin, During, End
This world function returns a random number.
D. random number
By default, a random number is between these two values.
B. 0 and 1
Which of the following characteristics do you not specify with the hebuilder or shebuilder tools?
A. Hat
You use this statement to display messages in the text console area while a world is running.
C. print
The first item in a list or array is stored at this position.
B. 0
This is the size of a list or an array.
A. The number of items stored in the list or array
This is always the position number of the last item in a list or an array.
C. One less than the size of the list or array
This instruction steps through a list, one item at a time, performing the same operation on each item in the list.
A. For all in order
This instruction steps through a list, simultaneously performing the same operation on each item in the list.
B. For all together
A list has one or more methods for this.
D. All of the above
A list has one or more methods for this.
D. All of the above
This event uses a list of objects.
C. Let the mouse move <objects></objects>
This is true for the size of an array.
A. It cannot change while the world is running
This is a dynamic data structure.
B. List
This is what a recursive method does.
C. It calls itself
Method A calls method B, and then method B calls itself four times. The depth of recursion is which of the following?
B. Four
This is the part of a problem that can be solved without recursion.
A. Base case
This is the part of a problem that is solved with recursion.
D. Recursion case
This is what we must do in the recursive case.
B. Reduce the problem to a smaller version of the original problem
This is what we must do in the base case.
A. Solve the problem without recursion