Professional Documents
Culture Documents
Test Bank For Programming Logic and Design Comprehensive 7th Edition Joyce Farrell 1111969752 9781111969752
Test Bank For Programming Logic and Design Comprehensive 7th Edition Joyce Farrell 1111969752 9781111969752
TRUE/FALSE
1. A variable can hold more than one value at any given moment in time.
2. Because one memory location can be used repeatedly with different values, you can write program
instructions once and then use them for thousands of separate calculations
3. In many programming languages, if you declare a variable and do not initialize it, the variable contains
an unknown value until it is assigned a value.
4. Variable names can be more than one word with blanks between the words.
5. The assignment operator has left-to-right-to-left associativity, which means that the value of the
expression to the left of the assignment operator is evaluated first and that the result is assigned to the
operand on the right.
6. A string variable can hold digits such as phone numbers and zip codes.
10. Most modern programming languages require that program statements be placed in specific columns.
MULTIPLE CHOICE
1. When you write programs, you work with data in three different forms: .
a. values; variables, or named values; and unnamed values
b. variables; named constants; and named memory
c. variables; literals, or unnamed constants; and named constants
d. variations; transliterals, or unnamed constants; and named values
ANS: C PTS: 1 REF: 38
3. Fractional numeric variables that contain a decimal point are known as variables.
a. partial c. integer
b. string d. floating-point
ANS: D PTS: 1 REF: 38
4. In most programming languages, before you can use any variable, you must include a for it.
a. declaration c. header
b. definition d. proclamation
ANS: A PTS: 1 REF: 39
5. The process of naming program variables and assigning a type to them is called variables.
a. initializing c. identifying
b. declaring d. proclaiming
ANS: B PTS: 1 REF: 39
a. initializing c. defining
b. declaring d. identifying
ANS: A PTS: 1 REF: 40
8. When the variable starts with a lowercase letter and any subsequent word begins with an uppercase
letter, this is called .
a. Hungarian notation c. camel casing
b. Pascal casing d. Turing notation
ANS: C PTS: 1 REF: 41
9. When the first letter of a variable name is uppercase, as in HourlyWage, the format is known as
casing.
a. Hungarian notation c. camel casing
b. Pascal casing d. Turing notation
ANS: B PTS: 1 REF: 41
10. is where a variable’s data type or other information is stored as part of the name.
a. Hungarian notation c. Turing notation
b. Pascal case d. Camel case
ANS: A PTS: 1 REF: 41
12. A(n) is similar to a variable, except it can be assigned a value only once.
a. unnamed constant c. named constant
b. literal d. constant
ANS: C PTS: 1 REF: 44
13. The dictate the order in which operations in the same statement are carried out.
a. rules of precedence c. operation rules
b. statement rules d. rules of arithmetic
ANS: A PTS: 1 REF: 46
14. Depending on the programming language being used, modules are also known as .
a. subroutines, procedures, or methods c. tasks, functions, or methods
b. subroutines, code bits, or methods d. procedures, functions, or hierarchy
ANS: A PTS: 1 REF: 48
15. The process of breaking down a large program into modules is called .
a. decomposition c. unification
b. modularization d. orientation
ANS: B PTS: 1 REF: 49
16. is the process of paying attention to important properties while ignoring nonessential details.
a. Abstraction c. Abbreviation
b. Modularization d. Decomposition
ANS: A PTS: 1 REF: 49
17. Programmers say the statements that are contained in a module have been .
a. embedded c. encapsulated
b. decomposed d. modularized
ANS: C PTS: 1 REF: 55
18. Programmers say that variables and constants declared within a module are only within that
module.
a. abstracted c. in scope
b. out of scope d. in reference
ANS: C PTS: 1 REF: 57
20. The mainline logic of almost every procedural computer program consists of these three distinct parts:
.
a. housekeeping tasks, processing tasks, and end-of-job tasks
b. clearing tasks, detail loop tasks, and end-of-job tasks
c. housekeeping tasks, detail loop tasks, and end-of-job tasks
d. housekeeping tasks, detail loop tasks, and math tasks
ANS: C PTS: 1 REF: 57-58
21. When a program has several modules calling other modules, programmers often use a program ,
which operates similarly to an organizational chart, to show the overall picture of how modules are
related to one another.
a. hierarchy chart c. flow chart
b. tree chart d. data diagram
ANS: A PTS: 1 REF: 61
22. As programs become larger and more complicated, the need for good planning and
design .
a. decreases c. is not necessary
b. is inefficient d. increases
ANS: D PTS: 1 REF: 63
23. An is most often represented by a three-sided box that is connected to the step it references by a
dashed line.
a. abstraction symbol c. abbreviation symbol
b. annotation symbol d. enumeration symbol
ANS: B PTS: 1 REF: 64
25. A variable is not used for input or output, but instead is just a working variable that you use
during a program’s execution.
a. programming c. temporary
b. throw away d. calculating
ANS: C PTS: 1 REF: 68
COMPLETION
ANS: integer
PTS: 1 REF: 38
ANS: initializing
PTS: 1 REF: 40
3. Each programming language has a few reserved that are not allowed as
variable names because they are part of the language’s syntax.
ANS:
keywords
key words
PTS: 1 REF: 41
4. tasks include any steps you must perform at the beginning of a program to get
ready for the rest of the program.
ANS:
Housekeeping
House-keeping
House keeping
housekeeping
house-keeping
house keeping
PTS: 1 REF: 57
5. Program are written explanations that are not part of the program logic but
that serve as documentation for readers of the program.
Another document from Scribd.com that is
random and unrelated content:
abundant. Wild-cat banking has disappeared. A simple book entry
between merchants is as good as a promissory note. The integrity of
merchandise now is a trade custom. Vulgar misrepresentations have
ceased save in the slums of business. The practice of making open prices
to all buyers alike, wholesale and retail, is universal. It is no longer
possible to print railroad shares surreptitiously overnight and flood the
Stock Exchange with them the next morning, as once happened in Erie.
Nowhere is character more esteemed than in business.
And yet, in spite of all this and parallel with it, runs a bitter feud
between society and business. People are continually acting upon big
business through the agencies of government to make it behave. What is
the explanation?
Well, in the first place, the improvement in commercial honesty has
been owing not so much to ethical enlightenment as to internal necessity.
Big business must do its work on credit; there is no other way. Therefore
credit is a sacred thing, to be preserved by all means. Men know that
unless they are scrupulous in fulfilling their obligations toward it, the
system will collapse. As the use of credit increases the code of business
become more rigid. It must. One who breaks faith with the code is not
merely dishonest, man to man; he is an enemy of credit.
If a stock-market coterie of this day could print Erie shares without
notice and sell them the public would suffer of course but Wall Street
would suffer much more. Its own affairs would fall into hopeless
disorder. That kind of thing cannot happen again. The code has been
improved. You now may be sure that anything you buy on the Stock
Exchange has been regularly issued and listed. No institution is more
jealous of the integrity of its transactions—transactions as such.
Purchases and sales involving millions are consummated with a nod of
the head and simple dishonesty is unknown. Nevertheless, it is a
notorious fact that the amount of money nowadays lost on the Stock
Exchange by the unwary public is vastly greater than in Jay Gould’s
time. There is, you see, an important difference between formal and
moral honesty.
Secondly, business morality is a term without meaning. There is no
such thing. Business is neither moral nor immoral. It represents man’s
acquisitive instinct acting outside of humanistic motives. Morals are
personal and social. Business is impersonal and unsocial.
So far we come clear. Only now, what shall be said of the man in
business? He is not a race apart. He may be any of us. How then shall we
account for the fact that those evils and tyrannies of big business with
which the Congress, the Interstate Commerce Commission, the
Department of Justice, the Federal Trade Board, and other agencies of
the social will keep open war are not inhibited at the head by an innate
social sense? Does the business man lose that sense? Or by reason of the
material in which he works does he become an unsocial being? No. The
answer is that the kind of business we now are talking about is not
conducted by men. It is conducted by corporations.
A thing of policy purely, with only legal responsibilities and no
personality, free from hope of heaven or fear of hell, the corporation is
both a perfect instrument for the impersonal ends of business and a cave
of refuge for the conscience. Business by corporations is highly
responsible in all that pertains to business. Business by corporations is in
all ethical respects anonymous. A corporation does many things which
no one of its directors would do as an individual. The head of a
corporation says: “If it were my own business, I should handle this
labour problem very differently. But it isn’t. I am a trustee, answerable to
five thousand stockholders for the security of their dividends.” Each of
the five thousand stockholders says: “It isn’t my business. I am merely
one of a great number of stockholders. What can I do about it?”
Nobody is personally responsible.
More than two-thirds of our national wealth is owned by
corporations. They control at some point every process of economic life.
Their power is so great that many have wondered whether in time it
might not overwhelm popular government. Yet in all this realm of power
there is nowhere that sense of personal moral liability which is
acknowledged between men and without which civilized human
relationships would become utterly impossible. A corporation is like a
State in this respect: it cannot, if it would, make moral decisions. The
right to do that is not delegated by people to a State nor by stockholders
to a corporation. Both therefore are limited to material decisions.
It is probably owing as much to the power-thirsty, law-baiting
temperament of the American in business as to the magnitude of the
work to be done that the use of the corporation, like the use of labour-
saving machinery, has been carried further here than in any other
country. Railroads naturally were the first great corporations. The
amount of capital required to build a railroad is beyond the resources of
any small group of individuals; it must be gathered from a large number,
who become shareholders. The original railroads were subsidized by the
government with loans of money and enormous grants of land. Industrial
and trading corporations came later. For a long time America was to all
corporations a Garden of Eden. They were encouraged, not precisely that
they were presumed to be innocent but because they were indispensable.
Then they ate of the Tree of Political Power and the feud was on. When
people began really to fear them their roots were already very deep and
touched nearly everything that was solid. The sinister alliance between
big business and high finance was accomplished.
One of the absurdities of the case was and is that any State according
to its own laws may grant corporation-charters which carry rights of
eminent domain in all other states. The Standard Oil Company was once
dissolved in Ohio. It took out a new charter in New Jersey, and went on
as before, even in Ohio.
Every attempt to reform their oppressive ways by law they have
resisted under the constitution as an attack upon the rights of property.
And there has always been much confusion as to what the law was. In
one case it was construed by the United States Supreme Court to mean
that bigness itself, the mere power of evil, was illegal whether it had
been exercised or not; in another, that each instance must be treated on
its merits by a rule of reason, and, in still another, that the potential
power to restrain trade in a monopolistic manner was not in itself illegal
provided it had never been used.
Nevertheless the doubt as to which should control the other—the
State the corporations or the corporations the State—has been resolved.
Gradually the authority of the State has been asserted. The hand of the
corporation in national politics is branded. The Federal Government’s
control over the rates and practices of the railroads is complete; so
likewise is the control of many of the several separate States over the
rates and practices of public-utility corporations. Federal authority over
the tradeways of the great industrial and trading corporations whose
operations are either so large or so essential, to economic life as to
become clothed with public interest is far advanced; and supervision of
profits is beginning.
Now what manner of profit and loss account may we write with
American business?
Given to begin with an environment superb, it has made wealth
available to an aggregate extent hitherto unimaginable in the world. But
in doing this it has created a conscious, implacable proletariat in revolt
against private profit.
In production it has brought about a marvellous economy of human
effort. At the same time it has created colossal forms of social waste. It
wastes the spirit by depriving the individual of that sense of personal
achievement, that feeling of participation in the final result, which is the
whole joy of craftsmanship, so that the mind is bored and the heart is
seared. It wastes all things prodigally in the effort to create new and
extravagant wants, reserving its most dazzling rewards for him that can
make two glittering baubles to sell where only one was sold before. It
wastes the living machine in recurring periods of frightful and
unnecessary idleness.
For the distribution of goods it has perfected a web of exchange, so
elaborate that the breaking of one strand is a disaster and yet so
trustworthy that we take its conveniences every day for granted and
never worry. But the adjustment of supply to demand is so rude and
uncontrolled that we suffer periodic economic calamities, extreme trade
depression, and social distress, because there has been an over-
production of some things at a price-impasse between producer and
consumer.
In the field of finance and credit it has evolved a mechanism of the
highest dynamic intensity known; yet the speculative abuse of credit is
an unmitigated scandal, and nothing whatever has been done to eliminate
or diminish those alternations of high and low prices, inflation and
deflation, which produce panics and perilous political disorder. On the
contrary, business continues fast in the antique superstition that such
things happen in obedience to inexorable laws.
In the Great War American business amazed the world, itself
included. In 1914 the United States was a debtor nation, owing Europe 3
billions of dollars. By the end of 1920 we were the largest creditor nation
on earth, other nations owing us 15 billions. This means simply that in
six years this country produced in excess of its own needs and sent
abroad commodities amounting to 18 billions of dollars. In 1921, to the
naïve astonishment of business, the foreign demand for American goods
slumped because foreign countries had not the means to go on buying at
any such rate. The result was an acute panic in prices here, trade
prostration, unemployment, and sounds of despair. The case was stated
by leaders of business and finance in these ominous terms: “America is
over-equipped. It has the capacity to produce more of everything than it
needs. Therefore unless we continuously sell our surplus abroad, unless
the American government will lend foreign countries the credit with
which to buy our excess production, prosperity is shattered. Factories
will shut up, fields will lie fallow, labour will suffer for want of work.
Moreover, we are threatened with a deluge of foreign goods, for
presently the countries that owe us 18 billions of dollars will be trying to
pay us with commodities. If we open our markets to their goods our own
industries will be ruined. So we must have high tariffs to protect
American producers from the competition of foreign merchandise.”
Ruined by over-plenty!
We are equipped to produce more of the goods that satisfy human
wants than we can use, our command over the labour of foreign
countries by reason of the debt they owe us is enormous, and business
desponds.
Attend. To keep our prosperity we must sell away our surplus, or if
necessary give it away to foreign countries on credit, and then protect
ourselves against their efforts to repay us! The simple absurdity of this
proposition is self-evident. We mention it only for what it signifies. And
it signifies that business is a blind, momentous sequence, with
extravagant reflex powers of accommodation and extension and almost
no faculty of original imagination.
American business despairing at over-production and the American
Indian shivering on top of the Pennsylvania coalfields—these are twin
ironies.
John Law’s Mississippi Bubble dream three centuries ago was a
phantasy of escape from the boredom of toil. The bubble itself has been
captured. That is the story of American business. But who has escaped,
save always a few at the expense of many? There may be in fact no other
way. Still, the phantasy will not lie. And nobody knows for sure what
will happen when business is no longer a feudal-minded thing, with
rights and institutions apart, seeking its own profit as the consummate
end, and perceives itself in the light of a subordinate human function,
justified by service.
G G
ENGINEERING
AMERICAN engineering made its beginning almost immediately
after the end of the War for Independence. The pursuits of the colonists
under British domination were mainly agricultural. Manufacturing was
systematically thwarted in order that the Colonies might become a
market for the finished goods of England. Objection to this form of
sabotage subsequently developed into one of the main causes of the
Revolutionary War. It was but natural, therefore, as soon as the artificial
restrictions imposed upon Colonial enterprise were removed, for the new
citizens of America to devise machinery, build roads and canals, and
plan cities.
The early engineers who carried on this work were seldom formally
trained. They were little more than higher types of artisans. It was only
after thirty-odd years of discussion and agitation that the first scientific
schools were established in this country—two in number. And it was
only after the enactment of the Morrill Act by Congress (1862) that
formal engineering training as we know it to-day was put on a firm
national basis. By 1870, 866 engineers had been graduated from
American technical schools and colleges. The real advent of the typical
American engineer, however, has only occurred since 1870. At present
he is being supplied to the industries of the country at the rate of 5,000 a
year.
The coming of the formally trained technologist or scientist of
industry lagged somewhat behind the development of the industrial
revolution. This was particularly true in America. Originally all attention
was centered on the training of so-called civil engineers, i.e., canal,
bridge, road, dam and building designers and constructors. The rapid rise
of the mechanical arts after the Civil War focused attention on the
training of engineers expert in manufacturing. To-day the mechanical
and electrical engineers are more numerous than any other group and
have far outstripped the civil engineers.
The original function of the engineer, especially in the first days of
his systematic training, was to deal scientifically with purely mechanical
problems. Thus the oft quoted definition of the British Institution of
Civil Engineers that “Engineering is the art of directing the great sources
of power in nature for the use and convenience of man” reveals quite
clearly the legitimate field within which the engineer was supposed to
operate. He was to harness the untamed energies of nature. That this
conception was then sufficient, and that the careers of most engineers
were shaped accordingly, is hardly to be disputed. Nor, judging from the
achievement of American engineers in the last fifty years, can it be
contended that their function was conceived in too narrow a light.
Undoubtedly, the problems of mechanical production, power-creation
and transmission, bridge and building construction, and railway and
marine transportation, during this period were largely material ones, and
the opportunities for their solution were especially good. To these the
engineers directed their attention. Thanks to their training, technique, and
accumulated experience, they became more and more successful in
solving them. At the same time, their relative freedom of thought and
action with reference to technological problems brought them into more
or less coherent groups which, as time went on, began to conceive a
larger function for the engineer—service to society as a whole rather
than the solving of mere concrete, specific difficulties.
For while the material problems of production are undoubtedly as
important as ever, the present-day industrial system has begun to reveal
new problems which the engineer in America has, to a limited extent,
come to realize must be faced. These new problems are not material in
the old sense of the word; they concern themselves with the control and
administration of the units of our producing system. Their nature is
psychological and economic.
Certain groups in the American engineering profession have become
quite conscious that these deeper problems are not being solved; at the
same time they consider it a necessary duty to help in their solution,
inasmuch as the engineer, they feel, is peculiarly fitted to see his way
clearly through them. Thus is being split off from the main body of old-
line engineers, a new wing not so much concerned with wringing power
from nature as with adjusting power to legitimate social needs. As
against the old engineer, concerned primarily with design and
construction, there is to be recognized the new engineer, concerned
mainly with industrial management.
Unfortunately, however, a strict evaluation of the engineer’s status
with reference to the influence he may have on the solution of these
social and economic problems causes serious doubts to arise regarding
his ultimate possibilities in this field. Despite his great value and
recognized indispensability as a technologist, expert in problems of
materials and processes of manufacture, he can at best but serve in an
advisory capacity on questions affecting the division of the national
surplus or the control of industry. Nevertheless, it is of fundamental
significance that the American engineering profession has of late
considerably widened the scope of the British Institution of Civil
Engineers’ definition of engineering, namely, to the effect that
“Engineering is the science of controlling the forces and utilizing the
materials of nature for the benefit of man and the art of organizing and
of directing human activities in connection therewith.” The implications
of this much broader definition, if widely accepted, will bring the
American engineers sooner or later squarely before a fundamental issue.
The ideal of service is profoundly inherent in the profession of
engineering. But so, also, is the ideal of creative work. The achievements
of engineering enterprise are easily visualized and understood, and from
them the engineer is wont to derive a great deal of satisfaction. Recently,
however, the exactions of the modern complex economic system, in
which the engineer finds himself relatively unimportant compared with,
say, the financier, have contrived to rob him of this satisfaction. And as
his creative instincts have been thwarted, he has turned upon business
enterprise itself a sharp and inquiring eye. From isolated criticisms of
wastes and inefficiencies in industry, for instance, he has not found it a
long or difficult step to the investigation of industry on a national basis
for the purpose of exposing technical and managerial shortcomings.
It appears, however, that the majority of American engineers to-day
believe that their position as a class is such that they can effectively
maintain an impartial position when differences which arise between
large economic groups of society such as those of the merchant, the
manufacturer, the labourer, the farmer, although these differences
frequently lead to economic waste and loss. At all events, it is on this
basis that attempts are being made to formulate a general policy for
engineers as a class to pursue. It is very doubtful, however, whether a
group such as the engineers, constituting the “indispensable general staff
of industry,” can long take an impartial attitude towards two such
conflicting forces as capital and labour so long as they (the engineers)
adhere to the ideal of maximum service and efficiency. The pickets of the
fence may eventually prove unduly sharp.
A minority group which believes otherwise has already organized
into an international federation of technicians affiliated with the standard
organized labour movement of America. This group holds that the
engineer is a wage-earner like all other industrial workers, and that his
economic welfare in many instances is no better than that of ordinary
wage-earners. In addition, this group maintains that in the last analysis it
is flatly impossible for engineers to take an impartial attitude in the
struggle between capital and labour. Hence they advocate the engineer
affiliating with the organized labour movement like other wage earners
and, in times of crisis, throwing his influence with the workers of
industry.
The organized labour movement of America has indicated in clear
terms its estimate of the American engineer’s true value and opportunity.
The American Federation of Labour in 1919 issued the following
statement: