Full download Starting Out with Programming Logic and Design 3rd Edition Tony Gaddis Test Bank pdf docx
Full download Starting Out with Programming Logic and Design 3rd Edition Tony Gaddis Test Bank pdf docx
https://testbankdeal.com/product/starting-out-with-programming-logic-
and-design-3rd-edition-tony-gaddis-solutions-manual/
https://testbankdeal.com/product/starting-out-with-programming-logic-
and-design-4th-edition-tony-gaddis-test-bank/
https://testbankdeal.com/product/starting-out-with-programming-logic-
and-design-4th-edition-tony-gaddis-solutions-manual/
https://testbankdeal.com/product/multicultural-law-enforcement-6th-
edition-shusta-test-bank/
Byrd And Chens Canadian Tax Principles 2011 2012 Edition
Canadian 1st Edition Byrd Test Bank
https://testbankdeal.com/product/byrd-and-chens-canadian-tax-
principles-2011-2012-edition-canadian-1st-edition-byrd-test-bank/
https://testbankdeal.com/product/marketing-research-asia-pacific-4th-
edition-zikmund-solutions-manual/
https://testbankdeal.com/product/real-estate-finance-and-
investments-15th-edition-brueggeman-test-bank/
https://testbankdeal.com/product/absolute-c-5th-edition-savitch-
solutions-manual/
https://testbankdeal.com/product/international-politics-power-and-
purpose-in-global-affairs-3rd-edition-paul-danieri-solutions-manual/
Personal Finance 13th Edition Garman Test Bank
https://testbankdeal.com/product/personal-finance-13th-edition-garman-
test-bank/
Gaddis: Starting Out with Programming Logic & Design Test Bank
Chapter Seven
MULTIPLE CHOICE
1. What is the famous saying among computer programmers that refers to the fact that computers
cannot tell the difference between good and bad data?
a. Garbage input, garbage output
b. Garbage in, garbage out
c. Garbage output is from garbage inputted
d. Garbage out is from garbage in
e. None of the above
ANS: B
2. The purpose of the __________ is to get the first input value for the validation of a loop.
a. GIGO
b. Read
c. Priming read
d. Write
e. None of the above
ANS: C
ANS: A
4. _______________ happens when an input operation attempts to read data, but there is no data
to read.
a. No data
b. Error reading
c. Input error
d. Empty input
e. None of the above
ANS: D
5. Input ______________ is commonly done with a loop that iterates as long as an input variable
contains bad data.
a. Check
b. Validation
c. Examination
d. Priming
e. None of the above
©2013 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved.
Gaddis: Starting Out with Programming Logic & Design Test Bank Chapter Seven 2
ANS: B
ANS: B
7. In addition to using loops to validate data, _____________ can also be used to validate data.
a. String Function
b. Real Function
c. Integer Function
d. Boolean Function
e. None of the above
ANS: D
ANS: D
ANS: D
10. What is the first step to use in detecting data type mismatch errors?
a. Read the input as a string
b. Convert to the desired data type
c. Determine whether it can be converted
d. Display error message
e. None of the above
ANS: A
©2013 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved.
Gaddis: Starting Out with Programming Logic & Design Test Bank Chapter Seven 3
c. Below
d. Inside and before
e. Inside and below
ANS: B
12. Which of the following statements is true about this Boolean expression?
score < 0 AND score > 100
a. This expression is true for numbers between 0 and 100.
b. This expression is true for numbers greater than 100.
c. This expression is true for numbers less than 0.
d. This expression would never be true.
e. None of the above
ANS: D
13. What type of function can be used to see if the password entered has the minimum number of
characters?
a. Mathematical
b. Boolean
c. String
d. Trigonometric
e. None of the above
ANS: C
14. If, when asked for a date of birth, the user enters a future date, this error should be caught by a
____________ check.
a. Date
b. Time
c. Day
d. Reasonableness
e. None of the above
ANS: D
15. Accepting February 29 in only a leap year is a check that is done by a ___________ check.
a. Date
b. Day
c. Month
d. Calendar
e. None of the above
ANS: A
16. Which of the following library functions could be used to validate the length of a string?
a. random
b. isString
©2013 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved.
Gaddis: Starting Out with Programming Logic & Design Test Bank Chapter Seven 4
c. length
d. toUpper
e. None of the above
ANS: C
17. Which of the following library functions could be used to validate that the correct data type was
input for an amount of money?
a. isInteger
b. isString
c. toLower
d. isReal
e. All of the above
ANS: D
18. Which of the following library functions could be used to simplify the process of string
validation?
a. length
b. toUpper
c. isReal
d. isInteger
e. None of the above
ANS: B
TRUE/FALSE
1. True/False: An input validation loop is sometimes called an error handler.
ANS: T
2. True/False: If the user provides bad data as input to a program, the program will correct the
data and produce output.
ANS: F
3. True/False: Programs should be designed such that all input is inspected before it is processed
and bad data is discarded.
ANS: T
ANS: T
©2013 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved.
Gaddis: Starting Out with Programming Logic & Design Test Bank Chapter Seven 5
ANS: T
6. True/False: The empty read is not an obvious input error and is a difficult one to handle.
ANS: F
7. True/False: The practice of anticipating errors that can happen while a program is running and
designing the program to avoid those errors is called defensive programming.
ANS: T
8. True/False: Checking for accuracy of data, even when the user provides the right type of data,
is part of input validation.
ANS: T
ANS: F
10. True/False: When using string input validation it is wise to use the library function to convert the
input to upper case or lowercase so case-sensitive string comparisons can be made.
ANS: T
11. True/False: Input validation is not needed if the program is well designed.
ANS: F
12. True/False: Most programming languages do not provide library functions that can be used for
input validation.
ANS: F
ANS: input
2. __________ programming is the practice of anticipating errors that can happen while a program
is running.
ANS: Defensive
3. The acronym ___________ is used by programmers to refer to the fact that computers cannot
tell difference between good and bad data.
©2013 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved.
Gaddis: Starting Out with Programming Logic & Design Test Bank Chapter Seven 6
ANS: GIGO
4. The input operation that is performed just before a validation loop is known as the _________.
5. The _________________ occurs when the user presses the ENTER key without typing a value
for an input operation.
6. Using a ________________ function many times would simplify the long compound Boolean
expression that is used by a validation loop.
ANS: Boolean
7. To validate if the input data is a valid integer, use the __________ library function.
ANS: isInteger
8. An input validation that accepts strings in mixed case would have incorporated a case-
__________ string comparison operation.
ANS: insensitive
9. The string _________ function plays a role in the string’s validity when a minimum number of
characters are required to be entered.
ANS: length
10. A _________ loop could be used to validate input instead of using the priming read.
ANS: posttest
11. When a payroll program verifies that no value greater than 168 is entered for the number of
hours worked in a week, it is performing a ___________________ check.
12. After the string is read it is determined if it can be converted to the desired data type in a
_____________ error.
13. When a loop rejects any input except the strings “yes” and “no” then it is performing a case-
___________ comparison.
ANS: sensitive
©2013 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved.
Gaddis: Starting Out with Programming Logic & Design Test Bank Chapter Seven 7
ANS: pretest
15. The integrity of a program’s output is only as good as the integrity of the program’s ________.
ANS: input
16. When ____________ data is entered by the user, the program should at least ask the user to
confirm that he or she intended to enter it.
ANS: unreasonable
17. When the user enters a U.S. Address, the value entered as the ________ should be checked to
verify that it is both valid and in the correct format.
18. You should design your programs in such a way that bad ____________ is never accepted.
ANS: input
©2013 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved.
Exploring the Variety of Random
Documents with Different Content
appeal to heaven. In the temple the clack and shuttling of the
machinery were not heard; instead of it there was an automatic
priest magnificently clothed, bowing and posturing to suit the word.
It was only a wax figure containing clockwork controlled by this
great litany machine, but the effect was like life, or rather much
more impressive. There was none of the hawking and hemming of
the human priest, none of his awkward pauses and blowings of the
nose, none of the clumsy gestures or inability to dispose of the
hands; and the voice rang out through the great buildings with a
bell-like clearness and naturalness that would have made the human
voice seem bathos. How feeble and tremulous, I remembered,
buzzed the voices of the priests I had heard intoning in the
cathedrals of Europe! I felt almost ashamed of the memory.
With a whirr and a click the litany machine stopped, and the
processional machine took up the tale. There was more noise and
clang in this, for more force had to be applied; a hundred or more
processions of marionette acolytes and priests through the various
temples of the island were impelled by it. There was a manifest
rhythm in its motions, almost like the sound of a stately minuet. I
saw these processions afterwards; and nothing could exceed the
solemnity of the motions of the man-like fantoccini. I never saw such
an impressive ceremonial; every step, every gesture was in
harmony; there was no unseemly merriment in the eyes or
conversation on the lips of the youthful figures; and the chanting
was so noble and beautiful, filling as it did the whole vast edifice
with its mournful, or jubilant sound. The service was well through
before I had come into the religion factory, and the only other
machine I saw at work was that which produced the music. It was in
an adjoining hall, which was filled with thousands of pipes of the
most varied size and construction. There sat the musician, and the
whole building trembled as the keys were struck. It was intolerable;
the groaning and thunder it produced made the very tips of our ears
to shake. But when delivered by tubes or wires into the vast temples
of the country, nothing could surpass the softness and harmony of
the volume of sound.
One large edifice served for the central section of the town; it was
spacious enough to contain every man, woman, and child that lived
in the district. Each suburb had a smaller temple, yet large enough
to dwarf the cathedrals of England. I was deeply interested in them,
and every weekly festival I visited one or more of them. I was
especially anxious to hear the sermon or prelection. The lay-figure
rose and moved his eyes and lips and his arms and body to suit the
words that were uttered. The whole of the audience was too distant
from it to distinguish the movements; and the wax lifelessness of the
face, which I made out when, after the service, I approached it,
could not have been seen by any of the worshippers, so far aloft was
it perched in a pulpit on the farthest wall. The tones reached every
ear in the huge edifice, and their modulation and expression were
perfect. I conjectured that the sermon had been spoken into some
recorder before, and that this reproduced it by machinery on some
diaphragm in each church, and that over the diaphragm was fixed
some instrument inside the lay-figure for multiplying many times the
volume of the sound.
The illusion was complete. I never heard oratory so impressive, or
religious service so solemnly performed. The sermon was, Blastemo
told me, a discourse on peace as the aim of all mankind. It painted
the horrors of war, and brought out in contrast a portrait of the man
of the millennium, who would have his passions so under control
that nothing would rouse him to anger or strife. It closed with a
vindication of the warlike policy for reaching this great ideal. Nothing
but continual and effective warfare would make men afraid to
quarrel or bring their quarrel to issue. The ebullience of the passions
of the world was to be mastered by fear. When they had brought
warfare to the perfection of destructiveness, all wars would cease;
terror of death would be the universal guiding motive of
communities and individuals. Then would the god of peace have
voice through the whole world, for he would have his mentor in
every human breast in every assembly, the knowledge that any strife
must end in the annihilation of all those who take part in it. The
peroration was fervid in its appeal to the worshippers to pursue
warfare till it should be absolute in its annihilative power.
I was deeply impressed by the whole performance; never did it
approach to that bathos which, I remembered, had so often marred
the services in even the greatest cathedrals and churches of the
various divisions of Christianity. There was no halting in the oratory,
no feebleness of voice, no ridiculous straining of the nervous or
muscular power. There was no hitch in the processions or
ceremonies, nothing pinchbeck or tawdry or mean. The music was
noble, and in its softening and shading as fine as the massing of
tens of thousands of human voices, there was no discord, no jar.
The effect of the whole was uniform, deep, and abiding.
Yet I could not get out of mind the cogs and wheels and keys of
the religion factory, the workmen moving about seeing that the
machinery was well oiled and that it worked without chance of
breakdown, the solitary performer sitting at the keyboard, and the
king’s minister in the royal recess grinding out the service. I
expressed my feelings to Blastemo as we walked away, and he
warmly defended the method of his country. They had had in the
past a priesthood attached to the various temples, but it had been
found that their lives so differed from their teachings that the people
laughed at the whole of religion as a farce. The performances and
discourses were so feeble or extravagant or grotesque that the
buildings were deserted as a rule, or, if one was frequented, it was
by a wild crowd of enthusiasts stirred by some mad preacher to a
crusade against law, order, or progress. The church and religion had
grown a scandal. Women were the only regular worshippers, and
they were in the hands of unscrupulous priests, who used them
against the aims and ideals of the government and the community.
The state tried for a time the effect of adding to the creed a dogma
that the religious efficacy of the services was quite independent of
the character of the priests; it came direct from heaven, and the
pollution of the vessel or channel did not mar the divine influence. It
was all in vain. It did not bring the men to church; and it only
hurried on the degeneracy of the priesthood. The church became
the nest of all the unclean and revolutionary characters in the
community. Again and again it threatened the safety of the state by
instilling a rebellious spirit into the women, and through them into
the youths of the nation during a serious war with a neighbour.
Something had to be done. There were the grand old temples; there
was the litany of the state religion consecrated by long generations
of worshippers; and yet the institution was but a lurking-place for
the indolent and voluptuous and hypocritical and rebellious in
masculine breasts. The endowments had fallen into a hopeless state.
The finances were quite inadequate. The worshippers would not
support their own services.
There was a great statesman at the helm of affairs, the ablest
monarch that had ever been selected by the council of wise warriors.
He saw his opportunity. He happened to have one of the most
original and inventive engineers as his right-hand man for the
manufacture and superintendence of war material. This latter had
landed on the shores of Broolyi they knew not whence. In these
islands they ask no questions but accept what the gods send them.
The two together elaborated the existing religious system. The
dogma that the divine influence was altogether irrespective of the
channel or priest had thoroughly soaked into the natures of the
worshippers from the sermons of the preachers; and it was easy to
turn the flank of the doctrine by showing that automatic priests
would have least effect of all upon the religious elements that came
through them. They would be completely neutral like the air or the
ether through which the gods influenced the minds of men.
There was some talk of rebellion when the system was changed;
but most of the priests were too manifestly disreputable or
characterless to bring much influence to bear. They were banished to
the islands that were occupied by the non-moral religionists, and
were never heard of more. The women were only too glad to see
the services conducted in order and decency, whilst the men saw
with pleasure the rotten finances taken up by the state. It was one
of the most peaceful and natural changes that ever occurred; and
now the temples were filled with men as well as women. The music
was splendid, the ceremonies solemn, the discourses worth listening
to. It cost far less. It was absolutely controlled by the state, and all
throughout the island had the same spiritual fare.
I suggested to Blastemo that there was surely great monotony in
having the same thing year in, year out, every festival. He laughed
at my simplicity. The monarch and the engineer had fully provided
for that feature of human nature which makes it weary of mere
repetition. The finest imaginations of the country were employed in
writing discourses; the best musicians spent most of their time in
composing the hymns and songs; the finest theatrical talent and the
most devout minds combined to make new ceremonies and services.
That was the reason there was not standing room in most of the
temples of the country. Everything was under the eye of the king
and his wise warriors. It was one of the most effective disciplines
that ever state had had in its hands; the state-organised church of
Aleofane was not to be compared to it. The souls of the community
were regimented like their bodies.
I was silenced; but any doubt of the efficacy of the institution was
not dissipated when I heard that it was still comparatively new. The
monarch had not long since died, and the engineer was still living. It
had still to be tested by time, and the attraction of novelty had not
yet worn off. Yet I had to acknowledge that it was a most effective
method of ridding a state church of irregularities and keeping a
strong hand over the minds of the community. Whether it would
allow the civilisation to advance was another question. Originality
would soon be a thing inconceivable in the island, if it were not
already completely dead. Peace in the spiritual world had been
reached, but at the expense of all new thought or individuality of
character.
When I heard that the inventor of this automatic worship was still
alive, I felt eager to see him, certain as I was that he must be a man
of remarkable powers; but I found great difficulty in getting
Blastemo or anyone else to tell me about him. Since the election of
the new monarch, I ascertained by sundry hints, he had been in
exile. Where he was imprisoned I could not find out. His great
capacity and his ever-advancing thought had manifestly aroused the
jealousy of the new occupant of the throne. Hence, I conjectured, it
was that the new arts of war had grown abortive, promise though
they once did to go far towards the ideal of absolute destructiveness
which would lead to universal peace. I saw that he or someone else
had introduced an explosive, which might, with improvements, have
made as effective a means of war as European gunpowder. It had
enabled the last king to batter down the fortress-mansions of his
nobles in the country and drive them to settle round the court and
abandon their continual little internecine wars. Under his successor,
the makers of the explosive had lost its true secret; and the baronial
castles were rebuilding, in spite of the threats of royal displeasure.
This was the meaning of the battle we had seen before arriving at
the harbour; two nobles were settling a quarrel in the old way,
heedless of royal power or judicial courts. Whilst I was in Broolyi I
saw hundreds of quarrels that were settled by duels. The Broolyians
had no control over their tempers, and during the reign of the
explosive they had given free play to them, as they knew that the
result would be no risk of life, but only to property in settlement
before the law-courts. It was like living over a gunpowder magazine,
and I avoided intercourse with these spitfires. Indeed, it was difficult
to conduct without hitch the commonest conversation with
Blastemo, now he had returned to his native fire-damp of an
atmosphere. Nothing but isolated residence in fortified keeps with
miles of morass or mountain or forest between them could ever
insure peace amongst such a people. To think that the name of their
country was “Isle of Peace,” and that the great object of their
worship was the god of peace!
One day I heard of another community off the farther coast of
Broolyi; it was said to exist without government or institutions of any
kind. My curiosity was excited, and, though on inquiry I found that it
was the exile asylum of the archipelago for all who were plagued
with the craze of anarchism, I resolved to see the island for myself.
They could not laugh me out of my determination, and I at last
procured a royal passport that would pass me over the intervening
districts in safety. For the rest I was to look after myself if I ventured
over the channel that lay between the islands. None of the
Broolyians would ever risk their lives in that den of wild beasts,
Kayoss. It had been chosen because of its proximity to the most
warlike people in the archipelago; and, if any of the inhabitants
attempted to leave it, the Broolyians were authorised to shoot them
down. A garrison was regularly established over against it for the
purpose.
I set out, glad to be free from the harassing ceremonial of a
military, machine-like, and yet most capricious-tempered community;
but it was a long and difficult journey, from castle to castle, over
mountain and through forest, often delayed by some local imbroglio
or the jealousy of neighbouring barons. Nothing but the
magnificence of the scenery could compensate for the petty
annoyances that retarded my passage. Everywhere I could see that
the military commonweal was founded on slave labour. The ground
was tilled and the operations of common life were conducted by men
of a different race and climate from the oath-compelling fire-eaters
that ruled the island; and over them stood overseers with whips to
urge their industry. It was a sorry sight; and when I looked into the
faces of the workers, I could distinguish the wreckage of nobler
natures than were to be found in Broolyian breasts. The foreheads
were larger, the skulls more capacious; the eyes were full of a shy
melancholy that seemed to shrink from investigation; they had not
the huge lower jaws of their masters, or the cavernous mouths, or
the red hair. They were now but beasts of burden, and their limbs
were muscular and heavy and their footsteps dragging and torpid;
but there was romance lurking in the refined lineaments and the
occasional grace that shone out here and there amongst them.
Whence they had come and what was their fate I could not
ascertain. That they were not natives I could see; and that it was
inferiority of will rather than inferiority of intellect or imagination or
civilisation that had led to their enslavement to the fiery-willed
Broolyians I could easily conjecture from the ruins of their past that
peeped out through the labour-clotted masks of their rustic or
artisan life.
I had to disguise my interest in them in order to get through the
country. Any sympathy or pity would have roused the savage wills of
their masters and sacrificed my hopes of the future, if not myself, to
the exaggerated Broolyian ideas of rebellion and the punishment it
demanded. Whenever I could, I lay in the shelter of some tree or
coppice, and watched the movements of these interesting relics of a
subjugated civilisation. Perhaps I might be able to do something for
them when I gained a higher platform of vantage.
CHAPTER XXXVII
NOOLA
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
testbankdeal.com