Deck 4: Algorithms
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/50
Play
Full screen (f)
Deck 4: Algorithms
1
Algorithms contain the steps necessary to complete a particular task or solve a particular problem.
True
2
Methods are not algorithms.
False
3
Algorithms are sequential in nature, forming a kind of sequential logic.
True
4
Sequential logic forms patterns, which can be understood as the elements of logical structure.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
5
A programmer who is familiar with the design patterns of logical structure can more easily create and edit software.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
6
In the 1980s, two Italian mathematicians, Corrado Böhm and Giuseppe Jacopini, showed that algorithms are composed of three major structures: linear sequences, branching routines, and threads.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
7
Böhm and Jacopini used a simple system of flowcharting with two symbols: ovals to show each step in an algorithm, and diamond-shaped boxes to show what they called a logical predicative.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
8
To say that one thing is "predicated" on another means that one thing is determined by another.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
9
The path through an algorithm each time it is executed is determined by the state of the true or false conditions in the algorithm at that time.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
10
Flowcharts are designed to show the possible paths through an algorithm.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
11
There should only be one terminator at the beginning of an algorithm and one terminator at the end of an algorithm.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
12
Usually terminators are labeled with the words "start" or "stop," or sometimes "begin" or "end."
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
13
The most notable characteristic of a linear sequence is that it has one branching routine.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
14
It is possible to rewrite each multiple branching routine as a collection of binary branching routines.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
15
The question "Which pair of shoes would you like?", is an example of a binary question.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
16
A repetition sequence forms a loop in an algorithm, which can be represented on a flowchart.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
17
In a posttest loop, the test to determine whether or not to continue executing the loop comes before any other instructions that are to be repeated.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
18
A counter causes a process to be repeated until a condition or marker is encountered.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
19
Alice has a special LOOP instruction for programming count-controlled loops.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
20
A count-controlled loop is a special case of a sentinel loop, in which the sentinel involves a counter, but the term "sentinel loop" is generally used to refer only to loops that are not count-controlled.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
21
Alice's LOOP instruction allows us to use a negative increment.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
22
The process of running multiple threads is called repetition.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
23
The LOOP instruction in Alice is really intended to be used only in situations where the programmer wants to make something happen a certain number of times, such as jumping five times.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
24
Whenever a more sophisticated loop is called for, such as one that counts backward, it is best to create your own version of a count-controlled loop with a FOR instruction.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
25
A count-controlled loop has a value or condition that tells a loop when to stop executing.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
26
Böhm and Jacopini used a system they called ____ to describe their work.
A) UML
B) flow diagrams
C) data flow
D) ER diagrams
A) UML
B) flow diagrams
C) data flow
D) ER diagrams
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
27
A(n) ____ is a diagram that shows the structure of an algorithm.
A) ER
B) UML
C) data chart
D) flowchart
A) ER
B) UML
C) data chart
D) flowchart
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
28
The ____ symbol for a logical predicative is called a decision diamond, a decision box, or a conditional.
A) line
B) oval
C) diamond
D) rectangle
A) line
B) oval
C) diamond
D) rectangle
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
29
On a flowchart, the ____ shape is called a terminator.
A) line
B) diamond
C) oval
D) rectangle
A) line
B) diamond
C) oval
D) rectangle
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
30
The simplest element of logical structure in an algorithm is a ____, in which one instruction follows another as if in a straight line.
A) repetition sequence
B) linear sequence
C) binary bypass
D) selection sequence
A) repetition sequence
B) linear sequence
C) binary bypass
D) selection sequence
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
31
A ____ occurs whenever the path or flow of sequential logic in an algorithm splits into two or more paths.
A) branching routine
B) binary branch
C) binary bypass
D) parallel routine
A) branching routine
B) binary branch
C) binary bypass
D) parallel routine
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
32
In a branching routine, each path is called a ____.
A) sequence
B) breakpoint
C) branch
D) bypass
A) sequence
B) breakpoint
C) branch
D) bypass
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
33
Branching routines are also known as ____.
A) repetition sequences
B) loops
C) binary choices
D) selection sequences
A) repetition sequences
B) loops
C) binary choices
D) selection sequences
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
34
If there are two possible paths in an algorithm, then the routine is known as ____.
A) binary branching
B) double branching
C) multiple branching
D) parallel branching
A) binary branching
B) double branching
C) multiple branching
D) parallel branching
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
35
If there are more than two paths in an algorithm, then it is called ____.
A) multiple branching
B) parallel branching
C) repetitive branching
D) binary branching
A) multiple branching
B) parallel branching
C) repetitive branching
D) binary branching
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
36
The question "What flavor ice cream would you like?," is an example of ____.
A) multiple branching
B) parallel branching
C) repetitive branching
D) binary branching
A) multiple branching
B) parallel branching
C) repetitive branching
D) binary branching
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
37
The question"Would you like vanilla ice cream?" is an example of ____.
A) multiple branching
B) parallel branching
C) repetitive branching
D) binary branching
A) multiple branching
B) parallel branching
C) repetitive branching
D) binary branching
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
38
In a ____, an instruction is either executed or bypassed.
A) structured language
B) binary bypass
C) binary choice
D) selection sequence
A) structured language
B) binary bypass
C) binary choice
D) selection sequence
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
39
In a ____, one of two instructions is chosen.
A) posttest loop
B) binary bypass
C) binary choice
D) pretest loop
A) posttest loop
B) binary bypass
C) binary choice
D) pretest loop
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
40
The term ____ comes from the fact that it looks something like the code in a computer programming language, but not quite.
A) pseudocode
B) pidgin code
C) machine code
D) interpretive code
A) pseudocode
B) pidgin code
C) machine code
D) interpretive code
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
41
Sometimes computer programmers use a more formal language, called ____ to describe algorithms.
A) procedural language
B) modular language
C) structured language
D) machine language
A) procedural language
B) modular language
C) structured language
D) machine language
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
42
In pseudocode, a ____ is equivalent to an IF/THEN instruction of the form IF (condition) THEN (instruction).
A) sentinel loop
B) control variable
C) branch
D) bypass
A) sentinel loop
B) control variable
C) branch
D) bypass
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
43
A ____ is equivalent to an IF (condition) THEN (instruction A) ELSE (instruction B).
A) sentinel loop
B) binary choice
C) control variable
D) posttest loop
A) sentinel loop
B) binary choice
C) control variable
D) posttest loop
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
44
A ____ occurs when an algorithm branches backward to a previous instruction, and then repeats part of the algorithm.
A) repetition sequence
B) branching routine
C) linear sequence
D) selection sequence
A) repetition sequence
B) branching routine
C) linear sequence
D) selection sequence
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
45
A(n) ____ is a variable whose value controls whether or not a selection sequence will be executed.
A) local variable
B) thread
C) instance variable
D) control variable
A) local variable
B) thread
C) instance variable
D) control variable
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
46
In a ____, the test to determine whether or not to go though the loop comes before the block of code to be executed.
A) pretest loop
B) posttest loop
C) binary bypass
D) binary choice
A) pretest loop
B) posttest loop
C) binary bypass
D) binary choice
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
47
A(n) ____ causes a process to be repeated a specific number of times.
A) sentinel
B) thread
C) count-controlled loop
D) parallel algorithm
A) sentinel
B) thread
C) count-controlled loop
D) parallel algorithm
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
48
In a count-controlled loop, the control variable is a called a ____.
A) sentinel
B) thread
C) counter
D) final value
A) sentinel
B) thread
C) counter
D) final value
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
49
It is possible for one computer, or several computers working together, to work on several parts of an algorithm at the same time. Each path of logic that is being executed is called a(n) ____ of sequential logic.
A) thread
B) branch
C) bypass
D) algorithm
A) thread
B) branch
C) bypass
D) algorithm
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
50
Algorithms that run multiple threads at the same time are called ____.
A) posttest loops
B) count-controlled loops
C) parallel algorithms
D) sentinel loops
A) posttest loops
B) count-controlled loops
C) parallel algorithms
D) sentinel loops
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck