Programming Logic and Design Comprehensive 7th Edition Joyce Farrell Test Bank pdf download
Programming Logic and Design Comprehensive 7th Edition Joyce Farrell Test Bank pdf download
https://testbankfan.com/product/programming-logic-and-design-
comprehensive-7th-edition-joyce-farrell-test-bank/
https://testbankfan.com/product/programming-logic-and-design-
comprehensive-7th-edition-joyce-farrell-solutions-manual/
https://testbankfan.com/product/object-oriented-approach-to-
programming-logic-and-design-4th-edition-joyce-farrell-test-bank/
https://testbankfan.com/product/object-oriented-approach-to-
programming-logic-and-design-4th-edition-joyce-farrell-solutions-
manual/
https://testbankfan.com/product/business-law-and-the-regulation-of-
business-11th-edition-mann-solutions-manual/
Invitation To Health 3rd Edition Hales Test Bank
https://testbankfan.com/product/invitation-to-health-3rd-edition-
hales-test-bank/
https://testbankfan.com/product/understanding-medical-surgical-
nursing-4th-edition-williams-test-bank/
https://testbankfan.com/product/m-management-4th-edition-bateman-test-
bank/
https://testbankfan.com/product/management-7th-edition-chuck-williams-
solutions-manual/
https://testbankfan.com/product/contemporary-management-8th-edition-
jones-test-bank/
Understanding Race and Ethnic Relations 5th Edition
Parrillo Test Bank
https://testbankfan.com/product/understanding-race-and-ethnic-
relations-5th-edition-parrillo-test-bank/
Chapter 6: Arrays
TRUE/FALSE
1. Many newer programming languages such as C++, Java, and C# use subscript 1 to access the first
element of the array.
2. You use subscripts 1 through 10 to access the elements in a ten element array.
3. Many newer programming languages such as C++, Java, and C# use the bracket notation for arrays.
7. You can improve the efficiency of a program by leaving a loop as soon as a match is found in the
array.
9. When you have a five element array and use subscript 8, your subscript is said to be out of bounds.
10. The for loop is a good tool when working with arrays because you frequently need to process every
element of an array from beginning to end.
MULTIPLE CHOICE
8. A program contains an array that holds all the names of the days of the week. Which of the following
is true?
a. The highest subscript is 6. c. The lowest subscript is 1.
b. The highest subscript is 7. d. The highest subscript is 12.
ANS: A PTS: 1 REF: 214
12. Named ____ hold values that do not change during a program’s execution.
a. constants c. objects
b. variables d. items
ANS: A PTS: 1 REF: 224
13. Besides making your code easier to modify, using a ____ makes the code easier to understand.
a. standard constant c. literal constant
b. named constant d. named variable
ANS: B PTS: 1 REF: 224
14. One advantage to using a named constant is that the statement becomes ____.
a. self-perpetuating c. self-referencing
b. self-documenting d. self-mitigating
ANS: B PTS: 1 REF: 225
15. When you search through a list from one end to the other, you are performing a ____.
a. linear search c. quadratic search
b. binary search d. single lookup
ANS: A PTS: 1 REF: 226
16. If you declare a variable to be Boolean, you can set its value to ____.
a. any number c. any integer
b. true or false d. 1 or -1
ANS: B PTS: 1 REF: 229
19. Parallel arrays are most useful when value pairs have a(n) ____ relationship.
a. direct c. linked
b. indirect d. tiered
ANS: B PTS: 1 REF: 234
20. A ____ search starts looking in the middle of a sorted list, and then determines whether it should
continue higher or lower.
a. linear c. quadratic
b. binary d. single lookup
ANS: B PTS: 1 REF: 236
21. To search an array for a(n) ____ match, you can store either the highest or lowest value
of each range for comparison.
a. flag c. subscript
b. index d. range
ANS: D PTS: 1 REF: 238-240
23. The number of bytes in an array is always a multiple of the number of ____ in an array.
a. subscripts c. iterators
b. elements d. indexes
ANS: B PTS: 1 REF: 241
24. In every programming language, when you access data stored in an array, it is important to use a ____
containing a value that accesses memory occupied by the array.
a. superscript c. key
b. subscript d. condition
ANS: B PTS: 1 REF: 241
25. When a subscript is not within the range of acceptable subscripts, it is said to be ____.
a. a superscript c. out of bounds
b. flagged d. indexed
ANS: C PTS: 1 REF: 243
COMPLETION
1. Use a(n) ____________________ to indicate the position of a particular item within an array.
ANS: subscript
2. All array elements have the same ____________________ name, but each individual element also has
a unique subscript indicating how far away it is from the first element.
ANS: group
ANS: constants
5. A(n) ____________________ is a variable set to indicate whether some event has occurred.
ANS: flag
MATCHING
ANS:
An array is a series or list of variables in computer memory, all of which have the same name and data
type but are differentiated with special numbers called subscripts. Usually, all the values in an array
have something in common; for example, they might represent a list of employee ID numbers or a list
of prices for items a store sells. A subscript, also called an index, is a number that indicates the
position of a particular item within an array.
Whenever you require multiple storage locations for objects, you are using a real-life counterpart of a
programming array. For example, if you store important papers in a series of file folders and label each
folder with a consecutive letter of the alphabet, then you are using the equivalent of an array.
ANS:
All array elements have the same group name, but each individual element also has a unique subscript
indicating how far away it is from the first element. Therefore, any array’s subscripts are always a
sequence of integers such as 0 through 4 or 0 through 9.
Depending on the syntax rules of the programming language you use, you place the subscript within
parentheses or square brackets following the group name.
ANS:
Learning to use arrays correctly can make many programming tasks far more efficient and
professional. When you understand how to use arrays, you will be able to provide elegant solutions to
problems that otherwise would require tedious programming steps.
ANS:
• To hold the size of an array
• As the array values
• As a subscript
ANS:
The technique for verifying that an item number exists involves setting a subscript to 0 and setting a
flag variable to indicate that you have not yet determined whether the customer’s order is valid. A flag
is a variable that you set to indicate whether some event has occurred; frequently it holds a true or false
value. For example, you can set a string variable named foundIt to “N”, indicating “No”. Then you
compare the customer’s ordered item number to the first item in the array. If the customer-ordered
item matches the first item in the array, you can set the flag variable to “Y”, or any other value that is
not “N”. If the items do not match, you increase the subscript and continue to look down the list of
numbers stored in the array. If you check all six valid item numbers and the customer item matches
none of them, then the flag variable foundIt still holds the value “N”. If the flag variable is “N”
after you have looked through the entire list, you can issue an error message indicating that no match
was ever found.
ANS:
Leaving the loop as soon as a match is found improves the program’s efficiency. The larger the array,
the more beneficial it becomes to exit the searching loop as soon as you find the desired value.
7. Consider a mail-order business in which customers get a discount based on the quantity they order. In
writing a program to compute the discount based on a customer’s order quantity, why is it not a good
idea to construct an array with as many elements as a customer might want to order, and store the
appropriate discount associated with each number?
ANS:
This approach has at least three drawbacks:
• It requires a very large array that uses a lot of memory.
• You must store the same value repeatedly. For example, each of the first nine elements receives the
same value, 0, and each of the next four elements receives the same value, 10.
• How do you know when you have enough array elements? Is a customer order quantity of 75 items
enough? What if a customer orders 100 or 1,000 items? No matter how many elements you place in
the array, there’s always a chance that a customer will order more.
ANS:
When using an array to store range limits, you use a loop to make a series of comparisons that would
otherwise require many separate decisions. The program that determines customer discount rates is
written using fewer instructions than would be required if you did not use an array, and modifications
to your method will be easier to make in the future.
9. What happens when a beginning programmer forgets that array subscripts start with 0?
ANS:
A common error by beginning programmers is to forget that array subscripts start with 0. If you
assume that an array’s first subscript is 1, you will always be “off by one” in your array manipulation.
PTS: 1 REF: 241 TOP: Critical Thinking
10. What happens if a subscript value is negative or higher than the number of elements in an array?
ANS:
Some programming languages will stop execution of the program and issue an error message. Other
programming languages will not issue an error message but will access a value in a memory location
that is outside the area occupied by the array. That area might contain garbage, or worse, it
accidentally might contain the name of an incorrect month. Either way, a logical error occurs.
Language: English
Credits: E-text prepared by Turgut Dincer, Barry Abrahamsen, and the Online
Distributed Proofreading Team (http://www.pgdp.net) from page
images generously made available by Internet Archive
(https://archive.org)
The cover image was created by the transcriber and is placed in the public domain.
EVOLUTION AND ADAPTATION
EVOLUTION
AND ADAPTATION
BY
New York
THE MACMILLAN COMPANY
LONDON: MACMILLAN & CO., Ltd.
1908
Norwood Press
J. S. Cushing Co.—Berwick & Smith Co.
Norwood, Mass., U.S.A.
TO
CHAPTER I
PAGE
The Problem of Adaptation 1
– Structural Adaptations 1
– Adaptations for the Good of the 19
Species
– Organs of Little Use to the 22
Individual
– Changes in the Organism that are 25
of No Use to the Individual or to
the Race
– Comparison with Inorganic 26
Phenomena
CHAPTER II
The Theory of Evolution 30
– Evidence in Favor of the 32
Transmutation Theory
– – Evidence from Classification and 32
from Comparative Anatomy
– – The Geological Evidence 39
– – Evidence from Direct Observation 43
and Experiment
– – Modern Criticism of the Theory of 44
Evolution
CHAPTER III
The Theory of Evolution (continued) 58
– The Evidence from Embryology 58
– – The Recapitulation Theory 58
– Conclusions 84
CHAPTER IV
Darwin’s Theories of Artificial and of 91
Natural Selection
– The Principle of Selection 91
– Variation and Competition in 104
Nature
– The Theory of Natural Selection 116
CHAPTER V
The Theory of Natural Selection 129
(continued)
– Objections to the Theory of Natural 129
Selection
– Sterility between Species 147
– Weismann’s Germinal Selection 154
CHAPTER VI
Darwin’s Theory of Sexual Selection 167
– Sexual Selection 167
– General Criticism of the Theory of 213
Sexual Selection
CHAPTER VII
The Inheritance of Acquired Characters 222
– Lamarck’s Theory 222
– Darwin’s Hypothesis of Pangenesis 233
– The Neo-Lamarckian School 240
CHAPTER VIII
Continuous and Discontinuous Variation 261
and Heredity
CHAPTER IX
Evolution as the Result of External and 300
Internal Factors
– The Effect of External Influences 300
– Responsive Changes in the 319
Organism that adapt it to the New
Environment
– Nägeli’s Perfecting Principle 325
CHAPTER X
The Origin of the Different Kinds of 340
Adaptations
– Form and Symmetry 340
– Mutual Adaptation of Colonial 350
Forms
– Degeneration 352
– Protective Coloration 357
– Sexual Dimorphism and 360
Trimorphism
– Length of Life as an Adaptation 370
– Organs of Extreme Perfection 371
– Secondary Sexual Organs as 372
Adaptations
– Individual Adjustments as 375
Adaptations
– Color Changes as Individual 375
Adaptations
– Increase of Organs through Use 376
and Decrease through Disuse
– Reactions of the Organism to 377
Poisons, etc.
– Regeneration 379
CHAPTER XI
Tropisms and Instincts as Adaptations 382
CHAPTER XII
Sex as an Adaptation 414
– The Different Kinds of Sexual 414
Individuals
– The Determination of Sex 422
– Sex as a Phenomenon of 439
Adaptation
CHAPTER XIII
Summary and General Conclusions 452
INDEX 465
EVOLUTION AND ADAPTATION
CHAPTER I
testbankfan.com