Shared Flashcard Set

Details

Object Oriented Concepts
ooc
263
Computer Science
Undergraduate 2
10/09/2011

Additional Computer Science Flashcards

 


 

Cards

Term
computer
Definition
device that follows intructions for manipulating and storing informations
Term
computer program
Definition
set of instructions that the computer follows to perform a task
Term
algorithm
Definition
set of well-defined logical steps that must be taken in order to perform a task
Term
machine language
Definition
only language that computers understand
Term
why programming languages were invented
Definition
because computers only understand machne language (binary numbers) - to make programming easier
Term
how do you control the speed at which a world is played?
Definition
use the speed slider control on the world running... window
Term
what part of the alice environment displays a view of the world as seen through the camera?
Definition
the World View window
Term
what part of the Alice environment displays a list of the objects in the world?
Definition
the object tree
Term
Properties
Definition
Values that specify an object's characteristics
Term
opacity
Definition
property that determes whether you can see through an object
Term
method
Definition
a set of programming statements that an object can execute
Term
class
Definition
description of a particular type of object
Term
what is a class similar to?
Definition
a blueprint and instances of the class are similar to houses built from a blueprint. The blueprint itself is not a house, but a detailed description of a house.
Term
Where are classes stored?
Definition
in Alice galleries
Term
When you click the Add Objects button, what mode does Alice go into?
Definition
scene editor mode
Term
after finding the class you want in one of the Alice galleries, describe two ways to add an instance of the class to the world
Definition
click the class thumbname, and then on the information window for the class, click the Add instance to world button. Or click and dtrage the class thumbnail from the gallery into the world.
Term
What are two ways to select an object in the Alice environment?
Definition
Click the object in the World View window Or click the object's tile in the Object Tree.
Term
What appears around an object in the World View window when you select the object?
Definition
A yellow bounding box
Term
Would the word dog be the name of a class, or the name of an object? How can you tell?
Definition
It would be the name of an object because by convention the names of objects begin with a lowercase letter and names of classes begin with an uppercase letter.
Term
In what area of the Alice environment do you select an object's properties?
Definition
Details Panel
Term
What dimensions do two-dimensional objects have? What dimensions do three-dimensional objects have?
Definition
Two-dimensional objects have height and width; three-dimensional objects have height, width, and depth.
Term
In what directions may an object in a two-dimensional world move? In what directions may an object in a three-dimensional world move?
Definition
An object in a two-dimensional world can move up, down, left, and right; an object in a three-dimensional world can move up, down, left, right, forward, and backward.
Term
What are the seven mouse mode buttons?
Definition
Move Freely, Move Up and Down, Turn Left and Right, Turn Forwarde and Backward, Tumble, Resize, and Copy.
Term
Why would you want to know where an object's center point is before you rotate the object?
Definition
Because an object rotates around its center point.
Term
When you select an object you see three axes displayed in the vicinity of the object. These axes indicate the object's orientation. In what direction does each of the axes point?
Definition
The green axis points in the object's direction, the blue axis points in the object's forward direction, and the magenta axis points in the object's right direction.
Term
What four views do you see when in quad view mode.
Definition
World View, Top, Right, and Front.
Term
Which mouse mode button is not displayed when in the quad view mode? Why is the button not displayed?
Definition
The Move Up and Down button is not displayed in quad view mode because the right and front viewing windows support up and down movement. If you want to move an object up or down while in quad mode, simply select the Move Objects Freely button and then move the object up or down in the right view or the front view.
Term
Definition
They indicate a position, using the X, Y, and Z axes. The first number (5) is the X coordinate, the second number (0) is the Y coordinate, and the third number (1) is the Z coordinate.
Term
What a computer device does
Definition
follows instructions to perform a task
Term
program
Definition
set of instructions that the computer follows
Term
algorithm
Definition
set of well-defined logical steps that must be taken in order to perform a task
Term
machine language
Definition
the only language that a computer understands
Term
binary
Definition
a number that consists of only 1s and 0s
Term
keywords
Definition
words that made up a programming language
Term
syntax
Definition
set of rules that must be stricgtly followed when writing a program
Term
syntax error
Definition
if a program contains even one of these, it cannot be translated into an executable program.
Term
object tree
Definition
part of the Alice environment that holds a list of all the objects in the world
Term
each object in an Alice world has these, which are values that specify the object's characteristics
Definition
properties
Term
set of statements that an object can execute
Definition
methods
Term
description of a particular type of object; you can think of it as a blueprint that objects may be created from
Definition
class
Term
in programming terminology, this is what objects are also called
Definition
instances of a class
Term
yellow box that appears around an object to indicate that it is selected
Definition
bounding box
Term
the part of the Alice environment where an object's properties are displayed
Definition
property view window
Term
this is how many degrees of freedom objects in a 3D world have
Definition
six
Term
this is what an object turns around when you rotate it
Definition
the object's center point
Term
when an object is selected you see three axes displayed in or near the object, which indicate the object's orientation. this is the direction in which the blue axis points.
Definition
forward
Term
argument
Definition
any piece of information that a method requires in order for it to execute
Term
custom method
Definition
a method that only objects of a specific class have
Term
in an alice world you have an object named hare. the hare object has a method named move. How would you write the method name using dot notation?
Definition
hare.move
Term
what causes a method to be executed automatically when a world is played?
Definition
the method name is specified in the event tile that reads WHEN THE WORLD STARTS, DO
Term
primative method
Definition
built-in method for performing basic actions.  all objects in an alice world have them.
Term
how do you see a list of the primative methods that an object has?
Definition
first selct the object.  then, in the details panel, select the methods tab to display a list of tiles representing the object's methods.
Term
when specifying a distance for the move method, what happens when you select OTHER... from the menu?  when would you use this selection?
Definition
when you select OTHER... the custom number keypad appears.  you would use this selection when you need to specify a distance that does not appear on the menu
Term
if a fellow classmate has placed an instruction in the method editor.  you ask her what the method does, and she says "It calls another method."  What does she mean by that?
Definition
she means it executes another method
Term
argument
Definition
any piece of informations that a method requires in order for it to execute
Term
custom method
Definition
a method that only objects of a specific class have.  not all classes provide custom methods.
Term
how can you see a list of the custom methods that a class has?
Definition
if a class provides custom methods, you can see a list of those methods in the class's information window.  also, when you add an instance of the class to the world and then select that object, tiles representing its custom methods (if it has any) appear above the tiles for the primitive methods in the details panel.
Term
camelCase
Definition
begin the name with lowercase letters.  the first character of the second and subsequent words is written in uppercase.
Term
PascalCase
Definition
first letter of each workd is uppercase
Term
what case convention is used for object and method names?
Definition
camelCase
Term
what case convetion is used for class names?
Definition
PascalCase
Term
why is it important that you give meaningful names to objects?
Definition
object's name should reflect the object's purpose or role in the world.  as a result it's easier for anyone reading your code to understand the purpose of the object.
Term
name 3 testing criteria
Definition
does the intended task.  doesn't have any logical errors, which cause undesired results.  works efficiently, without performing unnecessary steps.
Term
what are the steps in the program development cycle?
Definition
design the program.  write the methods, test the methods, debug the methods.
Term
what are two tools that you can use to break down a problem into a series of steps?
Definition
flowchart and psuedo code
Term
logical error
Definition
mistake that does not prevent the program from running, but causes it to produce incorrect results.
Term
when testing a method, what are the 3 criteria that you should make sure the method meets?
Definition
does the intended task, doesn't have any logical errors, and it works efficiently, without performing unnecessary steps
Term
purpose of comments
Definition
help anyone reading the program's code to understand the instructions.
Term
what are comments
Definition
notes of explanation that the programmer inserts into a program to explain what the code does.
Term
what is the center of the world?
Definition
0,0,0
Term
what is the DO TOGETHER?
Definition
structure that can be used to execute a set of instructions at the same time.
Term
how do you cause insturctions to execute simultaneously?
Definition
place the instructions inside a DO TOGETHER structure
Term
how do you cause some of the instructions in a DO TOGETHER structure to be executed in order?
Definition
by pacing those instructions inside a DO IN ORDER structure, which is placed inside the DO TOGEHER structure
Term
piece of information that a method requres in order forf it to execute
Definition
arguement
Term
method that only objects of a specific class have
Definition
custom
Term
case convention in which object names and method names should be written
Definition
camelCase
Term
naming convention in whcih class names are written
Definition
PascalCase
Term
explain dot notation
Definition

on the left side of the dot is the name of the object that the method belongs to.  on the right side of the dot is the name of the method. 

 

example: world.my first method indicates that my first method is the name of the method and world is the name of the object that the method belongs to.

Term
variable
Definition
named storage location in memory
Term
variable area
Definition
section of the method editor that contains the variable tile
Term
variable declaration
Definition
statement that creates a variable
Term
set instructions
Definition
store values in a variable (also called variable assignments)
Term
what 3 things must you specify when creating a new variable?
Definition
name, type, initial value
Term
what do the characters 123 appearing on a variable tile tell you?
Definition
numeric
Term
hoe do you create a set instruction for a variable?
Definition
drag variable tile into method editor. select set value.
Term
function
Definition
special type of method that returns a value back to the instruction that called the function
Term
what it the difference between a method and a function?
Definition
a function returns a value, a method does not
Term
how do you see a list of the functions that an object has?
Definition
select object, then function tab
Term
what are the three primative world funcgtions that ask the user to input a value?
Definition
ask user for a number, yes or no, string
Term
what does the primitive distance to function do?
Definition
returns an object's distance from another object, measured in meters.
Term
math expression
Definition
performs a calculation and returns a value
Term
operands
Definition
the values on the right and left of the opererator
Term
what does a math expression do?
Definition
performs a calculation and returns a value
Term
what is a collision
Definition
collision occurs when two graphical objects come into contact with each other
Term
string
Definition
sequence of characters
Term
what is a string?
Definition
sequence of characters
Term
if you want to display the contents of a number in a speech or thought bubble, what must you do?
Definition
use "as a string" function
Term
what a local variable belongs to
Definition
method
Term
this is what an insturction that sets a variable to a value is often called
Definition
variable assignment
Term
world function that allows the user to enter a number and returns that number
Definition
ask user for a number
Term
primitive function that returns the distance from one object's center point to another object's center point
Definition
distance to
Term
world function allows the user to enter a string and returns that string
Definition
ask user for a string
Term
what world function do you use to join two strings?
Definition
the A JOINED WITH B function
Term
boolean function
Definition
function that reurns either true or false
Term
dual-alternative decision structure
Definition
has two possible paths of executions - one for true, one for false
Term
single-alternative decision structure
Definition
empty else part
Term
sequence structure
Definition
set of instructions that are executed in sequence, order they appear
Term
decision structure
Definition
structure that can execute a set of instructions only under certain circumstances
Term
how do you create a single-alternative decision structure
Definition
create an if/else insturction with an empty else part
Term
what is a nested if/else instruction?
Definition
an if/else instructin that is inside of another if/else instruction
Term
where are the relational operators located in alice?
Definition
in the world object's function list, under the math category
Term
what is the difference between the BOTH A AND B operator and the EITHER A OR B, OR BOTH operator?
Definition
both A AND B operator, both a dn b must be true in order for the complex condition to be true.  In the either a or b, or both operator, the complex condition is true if either a or b is true or both are true
Term
loop - what kind of structure?
Definition
repetion structure
Term
repetion structure
Definition
loop
Term
in the method editor how do you see the code that works with a loop instruction's counter variable?
Definition
by clicking the SHOW COMPLICATED VERSION button
Term
what is an infinite loop?
Definition
an infinite loop is a loop that repeats an infinite number of times
Term
what is the name of the loop instruction's counter variable?
Definition
index (variable)
Term
why is the WHILE instruction considered a conditional loop?
Definition
it is controlled by a condition
Term
what causes the while loop to stop repeating
Definition
when the condition is tested and found to be false
Term
why is the while loop called a pretest loop?
Definition
because it tests its condition before it performs a repetition
Term
the if/else instruction tests a condition that must be of this type
Definition
boolean
Term
an if/else instruction that has an empty else part is they type of structure
Definition
single-alternative decision structure
Term
an if/else that is inside another if/else is said to be ...
Definition
nested
Term
instruction used to repeat other instructions a specific number of times
Definition
loop
Term
type of variable that the loop insturction uses internally
Definition
counter
Term
this instruction is a count controlled loop
Definition
loop
Term
this instruction is a conditional loop
Definition
while
Term
Once you have added custome class-level methods to an object, what should you do in order to dreate other objects like it?
Definition
save object to a new class
Term
qhwn you save an object to a new class, what will the new class be named?
Definition
same name as the oject, except that the first character will be changed to uppercas
Term
afterf you have created a new class, how do you add instances of it to an alice world?
Definition
click FILE, then IMPORT
Term
in inheritance you have a general class and a specialized class. which of these classes inherits methods and properties from the other?
Definition
the specialized class inherites methods and properties from the general class
Term
why is it a bod idea to call one object's class-level method from another object's class-level method?
Definition
if the other object does not exist, an error will occur, and you cannot be sure that the other object will always exist in every world
Term
why do you sometimes need to refine an algorithm?
Definition
sometimes an algorithm does not have enough detail to be translated into programming instructions
Term
why should you avoid putting too many instructions in a method?
Definition
iF A METHOD IS TOO LONG IT WILL BE HARD TO UNDERSTAND. A BETTER APPROACH IS TO BREAK IT INTO MULIPLE methods
Term
how can you immediately execute any of an object's primative methods
Definition
by right-clicking the object (or its tile in the object tree) and the selecting methods from the menu that appears. Another menu appears showing a list of all the primitive methods. you select a method from that menu, specify its arguments, and then immediately see the method execut in the world view window. you can undo.
Term
what is an argument?
Definition
a value passed into a method
Term
what is a parameter?
Definition
a special variable that hold the argument being passed into a method
Term
how do you create a parameter in a method?
Definition
open the method in the method editor and then clock the CREATE NEW PARAMETER button
Term
if you create a parameter in a method, what will be required each time you call the method?
Definition
an arguement will be required
Term
a property is really what type of variable?
Definition
a propery is really a class-level variable
Term
how do you create a class-level variable in an object?
Definition
by selecting the object and clicking the CREATE NEW VARIABLE button in the details panel, under the properties tab
Term
waht is a function?
Definition
a method that returns a value back to the instruction that called it
Term
if you increment a property or variable, what are you doing?
Definition
adding to the value in the property of value
Term
what instructions is required in all functions? what does this instruction do?
Definition
a RETURN instructions is required in all functions. It returns a value back to the instructions that called the function.
Term
what is a world-level method?
Definition
a method written in the world object
Term
what is the process of divide and conquer?
Definition
instead of writing one long world-level method you can write several smaller methods that each performs a specific part of the task. These smaller methods can then be executed in the desired order to perform the operation.
Term
how can methods help you to reuse code?
Definition
you can write a method to perform a task one and then call it (reuse it) each time you need to perform the task.
Term
what is a world-level variable? how do you create one?
Definition
a world-level variable is a variable that belongs to the world object. just a class-level variables act a properties for an object, world-level variables act a properties for the world. a world-level variable exists as long as the world is running and is available to all methods in the world. creating a world-level variable is similar to creating a class-level variable. you take the following steps: 1. select the world object in the object tree. 2. select the properties tab in the details panel. 3. click the create new variable button in the details panel. 4. the CREATE NEW VARIABLE dialog box will appear. In the dialog box, you enter a name for the variable and selct a type. when you clock OK, the variable will be created and you will see its tile in the details panel, under the properties tab.
Term
how do you insert a graphical image into an alice world?
Definition
you make a billboard and load the file that contains the graphic image
Term
you have object a and object b in an alice world. you want object a to move automatically with object b. how do you accomplish this?
Definition
you set object a's vehicle property to object b
Term
when you execute objet a'ds turn method, and use the more... editing tag to set the asSeenBy argument to object b, what effect does this have on the action that is performed?
Definition
object a will turn around object b's center point.
Term
what is a pose?
Definition
pose is an object's position that is captured, and can then be restored when the world is played
Term
what is a dummy object?
Definition
an invisible object that you place at a location in the world. you can then move to camera to the dummy object
Term
if you want to add a new behavior to an object, you add this type of method to it.
Definition
class-level
Term
after you have saved an object to a new class, you do this to add an instance of it to a world
Definition
click FILE, then IMPORT
Term
in this process, the programmer goes through each step in an algoristhm, expanding it until it has enough detail to be translated into actual instructions.
Definition
step-wise refinement
Term
this is a special variable that holds an arguemnt being passed into a method
Definition
parameter
Term
in alice, a property is really one of these
Definition
a class-level variable
Term
this instruction is required in all functions
Definition
return
Term
this process of breaking a long complex algorithm into small manageable pieces
Definition
divide and conquer
Term
to insert a graphical image into a world, you create one of these
Definition
billboard
Term
this property specifies that the object will move with another object
Definition
vehicle
Term
you use this primitive method call to move the camera to a dummy object
Definition
call camera.set point of view to primitive method and pass the desired dummy object as the arguement
Term
event
Definition
an action that takes place while a world is playing
Term
event handlers
Definition
methods to perform the actions that you wnat to take place in response to an event
Term
handling the event
Definition
the process of responding to an event
Term
a method that is executed in response to an event
Definition
event handler
Term
how to create specialized events
Definition
create the general event first, and then right-click the event tile and select change to on the menu
Term
event
Definition
an action that takes place while a program is running
Term
when a world i s first created what event tile appears in the events editor?
Definition
"when the world starts"
Term
how do you specifiy a different event to be automatically executed when the world starts?
Definition
in the event tile for the when the world starts event, click the down-arrow that appears next to the method name and select a different method
Term
how do you create a new event tile in the events editor?
Definition
you click the create new event button at the top of the events editor.  a menu of available events will appear.  you select the event that you want to handle from this menu.  a tile for the event will then be created in the events editor.
Term
what is the difference between a while a key is pressed event and a when a key is pressed event?
Definition
the while a key is pressed event occures as long as the user holds down a key.  THis is different from the when a key is typed event, which occurs only when the user releases a key.
Term
how do you create a while a key is pressed event?
Definition
first create a tile for the when a key is typed event.  then right-click the tile and from the menus that appear select change to, and while a key is pressed.
Term
in a BDE event, what does B, D, and E stand for?
Definition
begin, during, and end
Term
what is the difference between a while the mouse is clicked on something event and a when the mouse is clicked on something event?
Definition
the while the mouse is pressed on something event occurs as long as the user holds down the mouse button.  this is different from the when the mouse is clicked on something event, which occurs only when the user clicks the mouse button.
Term
the name of the world functions that returns a random number
Definition
random number
Term
by default, a random number is between these two values
Definition
0 and 1
Term
you use this statement to display messages in the text console area while a world is running
Definition
print
Term
Which of the following statements is useful for debugging a program?
A) Debug
B) Display
C) Print
D) Write
E) None of these
Definition
PRINT
Term
The create new event button is located in the:
A) Details Panel
B) Events Editor
C) Method Editor
D) Object Editor
E) None of these
Definition
B) Events Editor
Term
Which of the following events should be used to enable the user to move the camera around by dragging the mouse around in the world?
A) Let the mouse move the camera
B) When a key is typed
C) When the mouse is clicked on something
D) When the world starts
E) None of these
Definition
A) Let the mouse move the camera
Term
Which of the following parts of a BDE event should be used for code that should continue to execute as long as the event continues to occur?
A) Begin
B) During
C) End
D) While
E) None of these
Definition
B) During
Term
5.
What are the two ways to associate a sound with an object?
A) Get sound and import sound
B) Get sound and record sound
C) Import sound and record sound
D) Make sound and get sound
E) None of these
Definition
C) Import sound and record sound
Term
When the world starts is an example of which of the following:
A) An event
B) An event handler
C) A method
D) A function
E) None of these
Definition
A) An event
Term
7.
What method is used to play a sound?
A) Make sound
B) Play song
C) Play sound
D) Play
E) None of these
Definition
C) Play sound
Term
BDE events have three parts: Begin, During, and End.
A) True
B) False
Definition
A) True
Term
9.
Another term for the method that executes in response to a particular event is:
A) Event
B) Event handler
C) Property
D) Function
E) None of these
Definition
B) Event handler
Term
Which of the following parts of a BDE event should be used for code that should execute once when the event stops?
A) Begin
B) During
C) End
D) Stop
E) None of these
Definition
C) End
Term
Which of the following events should be used to cause a method to execute when a condition you have specified becomes true?
A) While something is true
B) When something becomes true
C) When a key is typed
D) When a variable changes
E) None of these
Definition
B) When something becomes true
Term
12.
When a world is first created, the only tile that appears in the Events Editor is for the When the world starts event.
A) True
B) False
Definition
A) True
Term
Which of the following is a BDE event?
A) Let the mouse move the camera
B) Let the arrow keys move
C) When a key is typed
D) While a key is pressed
E) None of these
Definition
D) While a key is pressed
Term
Which of the following events should be used to enable the user to move Alice forward by clicking the up arrow key?
A) Let the mouse move the camera
B) Let the arrow keys move
C) When a key is typed
D) When the world starts
E) None of these
Definition
B) Let the arrow keys move
Term
The random number function is a world-level function.
A) True
B) False
Definition
A) True
Term
Which of the following events should be used to cause a method to execute when a world is played?
A) Let the mouse move the camera
B) Play World
C) When the program starts
D) When the world starts
E) None of these
Definition
D) When the world starts
Term
Which of the following parts of a BDE event should be used for code that should execute once when the event first occurs?
A) Begin
B) During
C) End
D) Start
E) None of these
Definition
A) Begin
Term
The When a key is typed event can only be used to respond to letters and/or numbers being typed.
A) True
B) False
Definition
B) False
Term
What tools can be used to design your own people objects?
A) Alice builders
B) Character builders
C) Gallery builders
D) People builders
E) None of these
Definition
B) Character builders
Term
what is a data structure?
Definition
a mechanism for storing data and organizing it in some way
Term
what is the position number of the first item in a list?
Definition
0
Term
what is the size of a list?
Definition
the number of items stored in the list
Term
Describe the For all in order and For all together instructions.
Definition
The For all in order instruction steps through the list, one item at a time, performing the same operation on each item. The For all together instruction performs the same operation on all the items in a list simultaneously.
Term
Describe the methods tht Alice provides for inserting items into a list.
Definition
The Insert at beginning of list method inserts an item at the beginning of a list, whih is position 0. The other items are shifted toward the end of the list. The Insert at position of list method inserts an item at a specific position, indicated by index. The item currently at that position, and all subsequent items, will be shifted toward the end of the list.
Term
When you drag a list tile and drop it on top of a placeholder in an instructin, a menu will appear. What will be on the menu?
Definition
Some of the list functions; the list functins that will appear in the menu will be those with a return type that is compatible with the placeholder.
Term
Describe the methods that Alice provides for removing items from a list.
Definition
The remove item from beginning of list method removes the item at position 0 from the list. (This item is not removed from the world, only from the list.) THe remaining items are shifted toward the beginning of the list. The remove item form position of list method removes item at specific position, indicated by index. (This item is not removed from the world, only from the list.) The subsequent items are shifted toward the beginning of the list. The remove all items from list method removes all items from the list. (The items are not removed from the world, only from the list.)
Term
In what ways are arrays and lists similar?
Definition
The items in an array and a list are stored in a sequence. Each item's position in both data structures is numbered, with the first item at position 0, the secon item is at position 1, and so forth.
Term
In what ways are arrays and lists different?
Definition
One difference isthat an array has a fixed size. While the world is running, the size of an array cannot be changed. Consequently, you cannot add more items to an array than it can hold. Another way that an array is different from a list is that the items stored in an array do not automatically shift their positions when an item is inserted into an array. When you insert an item into an array at a specific position, it replaces an item that is currently in an array by replacing it with some other value.
Term
What two instructions does Alice provide for lists, but not for arrays?
Definition
The For all in order and For all together instructions that work with lists do not work with arrays.
Term
If you wish to step through an array, performing an operation on each item, what type of instruction would you create?
Definition
A Loop instruction that executes once for each item in the array. You use the complicated version of the loop, and you use the loop's index variable to specify an array item.
Term
What is an ArrayVisualization object? How is it useful for learning to program with arrays?
Definition
An ArrayVisualization object is used to visualize how an array works. It has numbered squares that represent the elements in an array. You can add other objets to the elements in the ArrayVisualization and they will appear in the squares. This gives you a way of seeing how an array works.
Term
How do you randomly select an item in an array?
Definition
Generate a random number to use as an index. You use the world-level random number function to do this. The minimum value of the random number should be 0 and the maximum value should be the size of the array. Also, the random number should be an integer. You can use the random number function's more... editing tag to set these constraints.
Term
What are the data structures in Alice?
Definition
Lists and arrays
Term
What is a list?
Definition
a container that holds a group of items. The items are stored in a sequence where one item is considered to come after the other. Each item's positon is numbered. The first item in the list is at position 0, the second item is at position 1, and so forth.
Term
Indexes
Definition
The position numbers of items in list or elements in arrays
Term
What is the size of a list?
Definition
the number of items that are stored in the list
Term
Explain how a list is a dynamic data structure
Definition
after you have created a list, the world can execute code that adds items to it and/or removes items from it. The list automatically expands as items are added to it, and automatically shrinks as items are removed from it.
Term
This instruction steps through a list, one item at a time, performing the same operation on each item in the list
Definition
For all in order
Term
This instructin steps through a list, simultaneously performing the same operation on each item in the list.
Definition
For all together
Term
What is the term for a stored group of items that has a fixed size so new items cannot be added while the world is running?
A) array
B) index
C) list
D) data structure
E) None of these
Definition
A) array
Term
2.
Given a list, animalList, that contains the objects: cat, dog, tiger, lion; the function last item from list would return which object?
A) cat
B) dog
C) tiger
D) lion
E) none of these
Definition
D) Lion
Term
What is the term for the section of the create new variable dialog box used to add items to a list?
A) Collection Editor
B) Details Panel
C) List Editor
D) Object Editor
E) None of these
Definition
A) Collection Editor
Term
4.
Which of the following items can be stored in a list?
A) numbers
B) strings
C) objects
D) Boolean values
E) All of these
Definition
E) All of these
Term
The Collection Editor can be used to add elements to an array.
A) True
B) False
Definition
A) True
Term
What is the index of the last position in an array that contains 10 items?
A) 0
B) 1
C) 9
D) 10
E) None of these
Definition
C) 9
Term
7.
Given a list, animalList, that contains the objects: cat, dog, tiger, lion; the function first item from list would return which object?
A) cat
B) dog
C) tiger
D) lion
E) none of these
Definition
A) Cat
Term
8.
What is the term for a stored group of items that can be added to while the world is running?
A) array
B) index
C) list
D) data structure
E) None of these
Definition
C) List
Term
What is the general term for a mechanism for storing and organizing data?
A) array
B) index
C) list
D) data structure
E) None of these
Definition
D) Data Structure
Term
Given an array, animalArray, that contains the objects: cat, dog, tiger, lion; item 3 from animalArray would refer to which object?
A) cat
B) dog
C) tiger
D) lion
E) none of these
Definition
D) Lion
Term
11.
What is the function used to randomly choose an element from an array?
A) first item from list
B) ith item from list
C) random item from list
D) random number
E) none of these
Definition
D) Random Number --- note that alice lists have a random item from list, but arrays have no such function. To do this you use the world-level random number function.
Term
A list is a dynamic data structure.
A) True
B) False
Definition
A) True
Term
What is the function used to randomly choose an element from a list?
A) first item from list
B) ith item from list
C) random item from list
D) random number
Definition
C) random item from list
Term
Which instruction is used when you want all of the elements of a list to execute the same instruction(s) simultaneously?
A) Do together
B) For all in order
C) For all together
D) For all together
E) None of these
Definition
C) For all together
Term
Which instruction is used to step through each element of a list?
A) Do together
B) For all in order
C) For all together
D) Loop
E) None of these
Definition
B) For all in order
Term
Given a list, animalList, that contains the objects: cat, dog, tiger, lion; the function ith item from list, given an index of 1, would return which object?
A) cat
B) dog
C) tiger
D) lion
E) None of these
Definition
B) Dog
Term
What is the index of the first position in an array that contains 10 items?
A) 0
B) 1
C) 9
D) 10
E) None of these
Definition
A) 0
Term
18.
What is the function used to choose an element from a list at the specified index number?
A) first item from list
B) ith item from list
C) last item from list
D) random item from list
E) none of these
Definition
B) ith item from list
Term
19.
Which instruction is used to step through each element of an array?
A) Do together
B) For all in order
C) For all together
D) loop
E) None of these
Definition
D) loop
Term
What is the term typically used to refer to the position number of a list or array?
A) array
B) index
C) list
D) data structure
E) none of these
Definition
B) index
Term
base case
Definition
a case in which the problem can be solved without recursion
Term
recursive case
Definition
a case in which the problem must be broken down into a smaller problem and solved with recursion
Term
what causes a recursive algorithm to stop calling itself
Definition
reaching the base case
Term
this is what a reursive method does
Definition
it calls itself
Term
Method A calls method B, and then method B calls itself four times. The depth of recursion is which of the following?
one
four
five or
nine?
Definition
4
Term
depth of recursion
Definition
the number of times that a method calls itself (not called from another method)
Term
this is what we must do in the recursive case
Definition
reduce the problem to a smaller version of the original problem
Term
What is the term for the aspect of a recursive problem that can be solved without recursion?
A) base case
B) ending case
C) final case
D) recursive case
E) none of these
Definition
A) base case
Term
What is the term for the aspect of a recursive problem that can be solved without recursion?
A) base case
B) ending case
C) final case
D) recursive case
E) none of these
Definition
A) base case
Term
What is the term for the aspect of a recursive problem that can be solved without recursion?
A) base case
B) ending case
C) final case
D) recursive case
E) none of these
Definition
A) base case
Term
What is the term for the aspect of a recursive problem that can be solved without recursion?
A) base case
B) ending case
C) final case
D) recursive case
E) none of these
Definition
A) base case
Term
What is the term for the aspect of a recursive problem that can be solved without recursion?
A) base case
B) ending case
C) final case
D) recursive case
E) none of these
Definition
A) base case
Term
What is the term for the aspect of a recursive problem that can be solved without recursion?
A) base case
B) ending case
C) final case
D) recursive case
E) none of these
Definition
A) base case
Term
What is the term for the aspect of a recursive problem that can be solved without recursion?
A) base case
B) ending case
C) final case
D) recursive case
E) none of these
Definition
A) base case
Term
What is the term for the aspect of a recursive problem that can be solved without recursion?
A) base case
B) ending case
C) final case
D) recursive case
E) none of these
Definition
A) base case
Term
this is what we must do in the recursive case
Definition
reduce the problem to a smaller version of the original problem
Term
A problem can be solved with recursion if
A) it can be broken down into any set of smaller problems
B) it can be broken down into at least three different subparts
C) it can be broken down into successive smaller problems that are identical to the overall problem
D) it can be solved by any method
Definition
C) it can be broken down into successive smaller problems that are identical to the overall problem
Term
3.
Like a loop, a recursive method must have some way to control the number of times it repeats.
A) True
B) False
Definition
true
Term
The following is an example of a base case for a summation algorithm (the sum of the numbers from 0 to n): If n > 0 then summation(n) = n + summation(n-1)
A) True
B) False
Definition
B) False
Term
What is the term for the aspect of a problem that is reduced to a smaller version of the original problem?
A) base case
B) ending case
C) final case
D) recursive case
E) none of these
Definition
D) recursive case
Term
The number of times a method calls itself is known as the:
A) depth of recursion
B) depth of repetition
C) length of recursion
D) number of repetitions
E) None of these
Definition
A) depth of recursion
Term
Which of the following would be a base case for a summation algorithm (the sum of the numbers from 0 to n)?
A) If n = 0 then summation(n) = 0
B) If n > 5 then summation(n) = 5
C) If n > 0 then summation(n) = getValue(n)
D) If n > 0 then summation(n) = n + summation(n-1)
Definition
A) If n = 0 then summation(n) = 0
Term
Which of the following would be a recursive case for a summation algorithm (the sum of the numbers from 0 to n)?
A) If n = 0 then summation(n) = 0
B) if n > 0 then summation(n) = 5
C) If n > 0 then summation(n) = getValue(n)
D) If n > 0 then summation(n) = n + summation(n-1)
E) none of these
Definition
D) If n > 0 then summation(n) = n + summation(n-1)
Term
When a recursive method ends, control of the program returns to the point:
A) after the recursive method call
B) before the recursive method call
C) before the next method
D) after the next method
E) none of these
Definition
A) after the recursive method call
Term
10.
A method that calls itself is referred to as a(n):
A) depth method
B) iterative method
C) recursive method
D) repetitive method
E) None of these
Definition
C) recursive method
Supporting users have an ad free experience!