100% found this document useful (42 votes)
301 views10 pages

Invitation To Computer Science 7th Edition Schneider Test Bank

Test Bank

Uploaded by

diane
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (42 votes)
301 views10 pages

Invitation To Computer Science 7th Edition Schneider Test Bank

Test Bank

Uploaded by

diane
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Test Bank for Invitation to Computer Science 7th Edition Schneider

1305075773 9781305075771
Full link download:
Test Bank:
https://testbankpack.com/p/test-bank-for-
invitation-to-computer-science-7th-edition-schneider-1305075773-9781305075771/

Solution Manual:
https://testbankpack.com/p/solution-manual-for-
invitation-to-computer-science-7th-edition-schneider-1305075773-9781305075771/

Name: Class: Date:

Chapter 02: Algorithm Discovery and Design


1. An unstructured, “free-flowing” writing style should be used for writing algorithms.
a. True
b. False
ANSWER: False
POINTS: 1
REFERENCES: 44

2. With a natural language, different readers can interpret the same sentence in totally different ways.
a. True
b. False
ANSWER: True
POINTS: 1
REFERENCES: 45

3. Java and C++ are examples of pseudocode languages.


a. True
b. False
ANSWER: False
POINTS: 1
REFERENCES: 46

4. The three basic sequential operations are called addition, multiplication, and exponentiation.
a. True
b. False
ANSWER: False
POINTS: 1
REFERENCES: 47

5. Input and output enable the computing agent to communicate with the outside world.
a. True
b. False
ANSWER: True
POINTS: 1
REFERENCES: 49

6. The if/then/else operation allows you to select exactly one of three alternatives.
a. True
b. False
ANSWER: False
POINTS: 1
REFERENCES: 51

7. One of the most powerful features of a computer is its ability to handle


loops. a. True
Cengage Learning Testing, Powered by Cognero Page 1
Name: Class: Date:

Chapter 02: Algorithm Discovery and Design


b. False
ANSWER:True
POINTS:1
REFERENCES: 53

8. Having an infinite loop in an algorithm is an error.


a. True
b. False
ANSWER: True
POINTS: 1
REFERENCES: 54

9. Once an algorithm has been developed, it may itself be used in the construction of other algorithms.
a. True
b. False
ANSWER: True
POINTS: 1
REFERENCES: 70

10. Pattern matching can only be applied to graphics and pictures.


a. True
b. False
ANSWER: False
POINTS: 1
REFERENCES: 77

11. Natural language is a set of English language constructs designed to resemble the statements in a
programming language but that do not actually run on a computer.
ANSWER:False - Pseudocode
POINTS:1
REFERENCES: 47

12. Pseudocode is a formal language with rigidly standardized syntactic rules and regulations.

ANSWER:False - is not, isn’t


POINTS:1
REFERENCES: 47

13. A(n) control algorithm executes its instructions in a straight line from top to bottom and then stops.

ANSWER:False - sequential, straight-line


POINTS:1
REFERENCES: 51

14. The use of high-level instructions during the design process is an example of abstraction.
Cengage Learning Testing, Powered by Cognero Page 2
Name: Class: Date:

Chapter 02: Algorithm Discovery and Design

ANSWER: True
POINTS: 1
REFERENCES: 80

15. The process of searching for a special pattern of symbols within a larger collection of information is called object
matching.
ANSWER:False - pattern
POINTS:1
REFERENCES: 77

16. During the initial phases of design, we should be thinking and writing at a highly level.
ANSWER:abstract
POINTS:1
REFERENCES: 46

17. is sometimes called a programming language without any details.


ANSWER: Pseudocode
POINTS: 1
REFERENCES: 47

18. operations allow us to alter the normal sequential flow of control in an algorithm.
ANSWER:Control
POINTS:1
REFERENCES: 51

19. In a(n) loop, it is possible for the loop body to never be executed.
ANSWER: pretest
POINTS: 1
REFERENCES: 57

20. The process of finding a solution to a given problem is called discovery.


ANSWER:algorithm
POINTS:1
REFERENCES: 65

21. is an example of a natural language.


a. C b. Java
c. English d. Perl
ANSWER: c
POINTS: 1
REFERENCES: 44

22. In the line of code, “Set the value of Area to length*width”, “Area” is a .
a. value b. variable
Cengage Learning Testing, Powered by Cognero Page 3
Name: Class: Date:

Chapter 02: Algorithm Discovery and Design


c. constant d. primitive
ANSWER: b
POINTS: 1
REFERENCES: 48

23. A(n) is a named storage location that can hold a data value.
a. expression b. variable
c. computation d. constant
ANSWER: b
POINTS: 1
REFERENCES: 48

24. operations provide the computing agent with data values from the outside world that it may then use in
later instructions.
a. Ingoing b. Outgoing
c. Input d. Output
ANSWER: c
POINTS: 1
REFERENCES: 49

25. operations send results from the computing agent to the outside world.
a. Input b. Put
c. Send d. Output
ANSWER: d
POINTS: 1
REFERENCES: 49

26. A purely algorithm is sometimes termed a straight-line algorithm.


a. sequential b. conditional
c. iterative d. control
ANSWER: a
POINTS: 1
REFERENCES: 51

27. Together, conditional and iterative operations are called operations.


a. sequential b. control
c. hierarchical d. dynamic
ANSWER: b
POINTS: 1
REFERENCES: 51

28. statements are the “question-asking” operations of an algorithm.


a. Primitive b. Iterative
c. Sequential d. Conditional
Cengage Learning Testing, Powered by Cognero Page 4
Name: Class: Date:

Chapter 02: Algorithm Discovery and Design


ANSWER: d
POINTS: 1
REFERENCES: 51

29. A is the repetition of a block of instructions.


a. cycle b. nucleus
c. matrix d. loop
ANSWER: d
POINTS: 1
REFERENCES: 53

30. An algorithm can fall into an infinite loop when .


a. the input operations are missing
b. the algorithm uses more than one loop
c. the output operations are missing
d. the continuation condition of the loop never becomes false
ANSWER:d
POINTS:1
REFERENCES: 54
31. In a pretest loop, the continuation condition is tested at the through the loop.

a. beginning of each pass b. beginning of only the first pass


c. end of each pass d. end of only the last pass
ANSWER: a
POINTS: 1
REFERENCES: 57

32. The loop is an example of a posttest loop.


a. do/while b. do
c. while d. if/then/else
ANSWER: a
POINTS: 1
REFERENCES: 57

33. To create a loop that executes exactly b times, we create a .


a. control object b. counting method
c. counter d. variable
ANSWER: c
POINTS: 1
REFERENCES: 61

34. “Print the value of product” is an example of a(n) operation.


a. sequential b. conditional
c. input d. output
Cengage Learning Testing, Powered by Cognero Page 5
Name: Class: Date:

Chapter 02: Algorithm Discovery and Design


ANSWER: d
POINTS: 1
REFERENCES: 63

35. The technique of looking at all the items in a list, starting at the beginning of the list, one at a time, until we either find
what we are looking for or come to the end of the list is called search.
a. sequential b. control
c. iterative d. random
ANSWER: a
POINTS: 1
REFERENCES: 66

36. The selection of an algorithm to solve a problem is greatly influenced by the way the input for that problem are
organized.
a. words b. data
c. solutions d. pseudocode
ANSWER: b
POINTS: 1
REFERENCES: 69

37. A(n) is a collection of useful, prewritten algorithms.


a. primitive b. binary
c. set d. library
ANSWER: d
POINTS: 1
REFERENCES: 71

38. In order to implement a “find” functionality in a word processor, one would have to design a algorithm.
a. pattern matching b. natural language
c. sequential d. do-while
ANSWER: a
POINTS: 1
REFERENCES: 77

39. Which statement exemplifies abstraction?


a. The president of General Motors views the company in terms of every worker, every supplier, and every car.
b. The president of General Motors views the company in terms of its corporate divisions and high-level policy
issues.
c. A good approach to algorithm design and software development is to focus on how we might actually
implement a particular operation.
d. A convenient way to view the hardware component called “memory” is to focus on the billions of electronic
devices that go into constructing a memory unit.
ANSWER: b
POINTS: 1

Cengage Learning Testing, Powered by Cognero Page 6


Name: Class: Date:

Chapter 02: Algorithm Discovery and Design


REFERENCES: 81

40. Viewing an operation at a high level of abstraction and fleshing out the details of its implementation at a later time is
known as design.
a. bottom-up b. top-down
c. increasing size d. increasing depth
ANSWER: b
POINTS: 1
REFERENCES: 81

41. Briefly describe what pseudocode is and is not.


ANSWER: Pseudocode is not a precise set of notational rules to be memorized and rigidly followed. It is a flexible
notation that can be adjusted to fit your own view about how best to express ideas and algorithms.
POINTS: 1
REFERENCES: 48
TOPICS: Critical Thinking

42. Under what circumstances would the body of a pretest loop never be executed?
ANSWER: With a pretest loop, the continuation condition is tested at the beginning of each pass through the loop,
and therefore it is possible for the loop body never to be executed. This would happen if the continuation
condition were initially false.
POINTS: 1
REFERENCES: 57
TOPICS: Critical Thinking

43. Briefly define the concept of iteration


ANSWER: The powerful algorithmic concept of iteration means that instead of writing instruction 10,000 separate
times, it is far better to write it only once and indicate that it is to be repetitively executed 10,000 times,
or however many times it takes to obtain the answer.
POINTS: 1
REFERENCES: 67
TOPICS: Critical Thinking

44. What is the definition of a library in terms of algorithms?


ANSWER: In the world of algorithms, a library is a collection of useful, prewritten algorithms, which are an
important tool in the design and development of algorithms.
POINTS: 1
REFERENCES: 71
TOPICS: Critical Thinking

45. What is pattern matching?


ANSWER: Pattern matching is the process of searching for a special pattern of symbols within a larger collection of
information.
POINTS: 1
REFERENCES: 77

Cengage Learning Testing, Powered by Cognero Page 7


Name: Class: Date:

Chapter 02: Algorithm Discovery and Design


TOPICS: Critical Thinking

46. What is the problem with using natural language to represent algorithms?
ANSWER: Natural language can be extremely verbose, causing the resulting algorithms to be rambling,
unstructured, and hard to follow. An unstructured, “free-flowing” writing style might be wonderful for
novels and essays, but it is horrible for algorithms. The lack of structure makes it difficult for the reader
to locate specific sections of the algorithm because they are buried inside the text. For example, without
any clues to guide us, such as indentation, line numbering, or highlighting, locating the beginning of a
loop can be a daunting and time-consuming task. A second problem is that natural language is too “rich”
in interpretation and meaning. Natural language frequently relies on either context or a reader’s
experiences to give precise meaning to a word or phrase. This permits different readers to interpret the
same sentence in totally different ways. This may be acceptable, even desirable, when writing poetry or
fiction, but it is disastrous when creating algorithms that must always execute in the same way and
produce identical results.
POINTS: 1
REFERENCES: 44-46
TOPICS: Critical Thinking

47. What is the problem with using high-level programming languages to represent algorithms?
ANSWER: As an algorithmic design language, this notation is also seriously flawed. During the initial phases of
design, we should be thinking and writing at a highly abstract level. Using a programming language to
express our design forces us to deal immediately with detailed language issues, such as punctuation,
grammar, and syntax. These technical details clutter our thoughts and at this point in the solution process
are totally out of place. When creating algorithms, a programmer should no more worry about
semicolons and capitalization than a novelist should worry about typography and cover design when
writing the first draft.
POINTS: 1
REFERENCES: 46-47
TOPICS: Critical Thinking

48. What is pseudocode and why is it well-suited for representing algorithms?


ANSWER: Most computer scientists use a notation called pseudocode to design and represent algorithms. This is a
set of English language constructs designed to resemble statements in a programming language but that
do not actually run on a computer. Pseudocode represents a compromise between the two extremes of
natural and formal languages. It is simple, highly readable, and has virtually no grammatical rules. (In
fact, pseudocode is sometimes called a programming language without the details.) However, because it
contains only statements that have a well-defined structure, it is easier to visualize the organization of a
pseudocode algorithm than one represented as long, rambling natural-language paragraphs. In addition,
because pseudocode closely resembles many popular programming languages, the subsequent translation
of the algorithm into a computer program is relatively simple. Pseudocode is not a formal language with
rigidly standardized syntactic and semantic rules and regulations. On the contrary, it is an informal
design notation used solely to express algorithms. One of the nice features of pseudocode is that you can
adapt it to your own personal way of thinking and problem solving.
POINTS: 1
REFERENCES: 47
TOPICS: Critical Thinking

49. Explain the importance of the concept of building blocks in the use of algorithms.
Cengage Learning Testing, Powered by Cognero Page 8
Name: Class: Date:

Chapter 02: Algorithm Discovery and Design


ANSWER: The use of a “building-block” component is a very important concept in computer science. You might
think that every algorithm you write must be built from only the most elementary and basic of
primitives. However, once an algorithm has been developed, it may itself be used in the construction of
other, more complex algorithms. This is similar to what a builder does when constructing a home from
prefabricated units rather than bricks and boards. Our problem-solving task need not always begin at the
beginning but can instead build on ideas and results that have come before. Every algorithm that we
create becomes, in a sense, a primitive operation of our computing agent and can be used as part of the
solution to other problems. That is why a collection of useful, prewritten algorithms, called a library, is
such an important tool in the design and development of algorithms.
POINTS: 1
REFERENCES: 71
TOPICS: Critical Thinking

50. Discuss in detail the application of pattern matching to the mapping of the human genome.
ANSWER: One of the most interesting and exciting applications of pattern matching is assisting microbiologists and
geneticists studying and mapping the human genome, the basis for all human life. The human genome is
composed of a sequence of approximately 3.5 billion nucleotides, each of which can be one of only four
different chemical compounds. These compounds (adenine, cytosine, thymine, guanine) are usually
referred to by the first letter of their chemical names: A, C, T, and G. Thus, the basis for our existence
can be rendered in a very large “text file” written in a four-letter alphabet (e.g., T C G G A C T A A C A
TCGGGATCGAGATG…)

Sequences of these nucleotides are called genes. There are about 25,000 genes in the human genome,
and they determine virtually all of our physical characteristics—sex, race, eye color, hair color, and
height, to name just a few. Genes are also an important factor in the occurrence of certain diseases. A
missing or flawed nucleotide can result in one of a number of serious genetic disorders, such as Down
syndrome or Tay-Sachs disease. To help find a cure for these diseases, researchers are attempting to
locate individual genes that, when exhibiting a certain defect, cause a specific malady. A gene is
typically composed of thousands of nucleotides, and researchers generally do not know the entire
sequence. However, they may know what a small portion of the gene—say, a few hundred nucleotides—
looks like. Therefore, to search for one particular gene, they must match the sequence of nucleotides that
they do know, called a probe, against the entire 3.5 billion-element genome to locate every occurrence of
that probe. From this matching information, researchers hope to isolate specific genes. When a match is
found, researchers examine the nucleotides located before and after the probe to see whether they have
located the desired gene and, if so, to see whether the gene is defective. Physicians hope someday to be
able to “clip out” a bad sequence and insert in its place a correct sequence.
POINTS: 1
REFERENCES: 77-78
TOPICS: Critical Thinking

Cengage Learning Testing, Powered by Cognero Page 9

You might also like