logic and computers chapter 5-9 Flashcards

1
Q

This instruction is used to repeat other instructions a specific number of times.

A

C. Loop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

This is a type of variable that the Loop instruction uses internally.

A

B. Counter

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

This is a loop that repeats without ending.

A

A. Infinite

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

This instruction is a count-controlled loop.

A

C. Loop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

This instruction is a conditional loop.

A

D. While

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

This is a loop that is inside another loop.

A

A. Nested loop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

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?

A

D. 20 times

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

If you want to add a new behavior to an object, you add this type of method to it.

A

B. Class-level method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

After you have saved an object to a new class, you do this to add an instance of it to a world.

A

C. Click File, then Import…

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

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.

A

B. Divide and conquer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

This is a special variable that holds an argument being passed into a method.

A

C. Parameter

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

In Alice, a property is really one of these.

A

B. A class-level variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

This instruction is required in all functions.

A

A. Return

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

This is the process of breaking a long complex algorithm into small manageable pieces.

A

D. Divide and conquer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

To insert a graphical image into a world, you create one of these.

A

B. Billboard

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

This property specifies that the object will move with another object.

A

A. vehicle

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

You use this primitive method call to move the camera to a dummy object.

A

C. camera.set point of view to

18
Q

This is what the process of responding to an event is called.

A

C. Handling the event

19
Q

When an Alice world is first created, this is the event for which the only tile appears in the Events Editor.

A

A. When the world starts

20
Q

This is an event handler.

A

B. A method that is executed in response to an event

21
Q

This is what BDE stands for

A

C. Begin, During, End

22
Q

This world function returns a random number.

A

D. random number

23
Q

By default, a random number is between these two values.

A

B. 0 and 1

24
Q

Which of the following characteristics do you not specify with the hebuilder or shebuilder tools?

A

A. Hat

25
Q

You use this statement to display messages in the text console area while a world is running.

A

C. print

26
Q

The first item in a list or array is stored at this position.

A

B. 0

27
Q

This is the size of a list or an array.

A

A. The number of items stored in the list or array

28
Q

This is always the position number of the last item in a list or an array.

A

C. One less than the size of the list or array

29
Q

This instruction steps through a list, one item at a time, performing the same operation on each item in the list.

A

A. For all in order

30
Q

This instruction steps through a list, simultaneously performing the same operation on each item in the list.

A

B. For all together

31
Q

A list has one or more methods for this.

A

D. All of the above

32
Q

A list has one or more methods for this.

A

D. All of the above

33
Q

This event uses a list of objects.

A

C. Let the mouse move <objects></objects>

34
Q

This is true for the size of an array.

A

A. It cannot change while the world is running

35
Q

This is a dynamic data structure.

A

B. List

36
Q

This is what a recursive method does.

A

C. It calls itself

37
Q

Method A calls method B, and then method B calls itself four times. The depth of recursion is which of the following?

A

B. Four

38
Q

This is the part of a problem that can be solved without recursion.

A

A. Base case

39
Q

This is the part of a problem that is solved with recursion.

A

D. Recursion case

40
Q

This is what we must do in the recursive case.

A

B. Reduce the problem to a smaller version of the original problem

41
Q

This is what we must do in the base case.

A

A. Solve the problem without recursion