Download Study Resources for Computer Science An Overview 11th Edition Brookshear Test Bank
Download Study Resources for Computer Science An Overview 11th Edition Brookshear Test Bank
https://testbankfan.com/product/computer-science-an-overview-12th-
edition-brookshear-test-bank/
https://testbankfan.com/product/computer-science-an-overview-12th-
edition-brookshear-solutions-manual/
https://testbankfan.com/product/family-therapy-an-overview-9th-
edition-goldenberg-test-bank/
https://testbankfan.com/product/invitation-to-computer-science-6th-
edition-schneider-test-bank/
Invitation to Computer Science 7th Edition Schneider Test
Bank
https://testbankfan.com/product/invitation-to-computer-science-7th-
edition-schneider-test-bank/
https://testbankfan.com/product/physical-science-11th-edition-tillery-
test-bank/
https://testbankfan.com/product/invitation-to-computer-science-7th-
edition-schneider-solutions-manual/
https://testbankfan.com/product/invitation-to-computer-science-6th-
edition-schneider-solutions-manual/
https://testbankfan.com/product/computer-security-art-and-science-1st-
edition-bishop-solutions-manual/
Test Bank—Chapter Six (Programming Languages)
ANSWER: A
2. Which of the following is an example of a language that is based on the object-oriented paradigm?
ANSWER: D
ANSWER: A
4. Which of the following is not a type of statement found in a typical high-level imperative programming
language?
ANSWER: B
ANSWER: C
ANSWER: C
ANSWER: C
ANSWER: A
ANSWER: B
10. Which of the following is not associated with the concept of data type?
ANSWER: C
ANSWER: A
ANSWER: D
A. 4 B. 5 C. 6 D. 10
ANSWER: B
ANSWER: D
ANSWER: B
16. Which of the following is a means of nullifying conflicts among data types?
ANSWER: C
17. Which of the following is not constructed by a typical compiler?
ANSWER: A
18. Which of the following is a means of defining similar yet different classes in an object-oriented
program?
ANSWER: A
19. Which of the following is not a parse tree of an expression based on the following grammar?
A. B. C.
ANSWER: C
20. Which of the following statements is not a resolvent of the following clauses?
P OR Q OR R P OR T Q OR T R OR T
A. Q OR R OR T B. T OR P C. P OR R OR T D. Q OR T
ANSWER: B
21. Which of the following can Prolog conclude from the following program?
parent(jill, sue).
parent(jill, sally).
parent(john, sue).
parent(john, sally).
sibling(X, Y) :- parent(Z, X), parent(Z, Y).
ANSWER: C
Fill-in-the-blank/Short-answer Questions
1. In contrast to _______________ languages such as English and Spanish, programming languages are
2. List two disadvantages of both machine languages and assembly languages that are overcome by high-
level programming languages.
_____________________________________
_____________________________________
ANSWER: They are machine dependent and they require that algorithms be expressed in small machine-
related steps rather that larger application-oriented steps.
3. Indicate how each of the following types of programming languages is classified in terms of generation
(first generation, second generation, or third generation).
4. List four data types that occur as primitive types in many high-level programming languages.
____________________ ____________________
____________________ ____________________
ANSWER: Possible answers include: integer, real (or float), Boolean, and character.
5. What encoding system is commonly used to encode data of each of the following types?
A. Integer ___________________________
B. Real __________________________
C. Character ___________________________
6. A data structure in which all elements have the same type is called ___________________, whereas a
________________ may have elements of different types.
“2x” + “3x”
________________
ANSWER: “2x3x”
if (X = 5) goto 50
goto 60
50 print the value of Z
goto 100
60 print the value of Y
100 . . .
9. The following is a program segment and the definition of a procedure named sub.
.
.
X 3; procedure sub (Y)
sub (X); Y 5;
print the value of X;
.
.
A. What value will be printed by the program segment if parameters are passed by value?
____________
B. What value will be printed by the program segment if parameters are passed by reference?
____________
ANSWER: A. 3 B. 5
10. The following is a program segment and the definition of a procedure named sub.
. procedure sub
. .
X 8; .
apply procedure sub; X 2;
print the value of X; .
. .
.
____________
B. What value will be printed by the program segment if X is a declared as a local variable
within the procedure?
____________
ANSWER: A. 8 B. 2
_____________________________________________________________________ .
ANSWER: the grammar allows more than one parse tree for a single string
12. List three items of information that would be contained in a typical parser’s symbol table.
________________________
________________________
________________________
ANSWER: Possible answers include: names of variables, data types associated with variables, data
structures associated with variables, and others.
13. Give three examples of key words that are often found in high-level imperative or object-oriented
languages.
ANSWER: Possible answers are numerous and include: if, while, for, class, int, etc.
14. In addition to the procedure’s name, what other information is contained in a typical procedure header?
____________________________________
15. In the context of the object-oriented paradigm, ____________ are templates from which
____________ are constructed. We say that the latter is an instance of the former.
16. In the context of the object-oriented paradigm, a __________________ is an imperative program unit
that describes how an object should react to a particular stimulus.
17. Based on the sketch of a class definition below, which methods can be invoked from outside an
instance of the class?
class Example
{public void method1( )
{ . . . }
private void method2( )
{ . . . }
public void method3( )
{…}
private void method4( )
{ . . .}
}
_________________________________________________________
P OR R OR S
P OR Q
__________________
ANSWER: Q OR R OR S
19. What general rule should be added to the Prolog program below so that Prolog can conclude that ice
cream is better than spinach?
better(icecream, peanutbutter).
better(peanutbutter, spinach).
___________________________________________________________
20. Based on the Prolog program below, what goal should be used to find the siblings of sue?
parent(jill, sue).
parent(jill, sally).
parent(john, sue).
parent(john, sally).
sibling(X, Y) :- parent(Z, X), parent(Z, Y).
_________________________________________
ANSWER: It means that programs written in the language do not refer to properties of a specific machine
and are therefore compatible with any computer.
2. Explain the distinction between the imperative and declarative programming paradigms.
ANSWER: The imperative paradigm requires that a programmer describe an algorithm for solving the
problem at hand. The declarative paradigm requires that the programmer describe the problem.
3. Explain why the generation approach to classifying programming languages fails to capture the full
scope of today’s languages.
ANSWER: The generation approach fails to reflect the array of distinct programming paradigms.
4. Explain the distinction between translating a program (in a high-level language) and interpreting the
program.
5. Why is the straightforward “goto” statement no longer popular in high-level programming languages?
ANSWER: Its use led to poorly structured programs that were hard to understand.
ANSWER: A formal parameter is a term used in a subprogram unit to refer to data that will be given to the
subprogram when it is executed. An actual parameter is the data that is given to the subprogram unit when
it is executed. (A formal parameter is a “place holder” that is “filled in” with an actual parameter when the
subprogram unit is executed.)
ANSWER: A procedure returns values via parameters and global variables whereas a function returns a
value as “the value of the function.”
9. Based on the grammar below, draw a parse tree showing that the string “drip drip drip” is a Leak.
ANSWER:
10. Show that the grammar below is ambiguous by drawing two distinct parse trees for the string “drip drip
drip.”
ANSWER: A constructor is a special “method” that is executed when an object is first constructed,
normally for the purpose of performing initialization activities.
12. Briefly describe the task of each of the following.
A. Lexical analyzer
B. Parser
C. Code Generator
13. Explain why key words in a programming language are often reserved words.
ANSWER: Key words are used to help the parser identify grammatical structures in a program. Thus, using
these words are used for other purposes could confuse the parser.
Exploring the Variety of Random
Documents with Different Content
head o’er muckle ye ken,” after a course of haggis washed down
with sparkling wines and old port.
“Tell me what a man eats,” said Brillat Savarin, “and I’ll tell you what
he is.”
Her Majesty
Duke of Wellington
An esteemed friend who has seen better days, sends word how to
dine a man, his wife, and three children for 7½d. He heads his letter
Prison Fare.
Choufleur aû Gratin.
Green-Pea Soup is made in precisely the same way; but the peas will
not need soaking beforehand, and thrifty housewives put in the
shells as well.
Harmless and nutritious a vegetable as the Bean would appear to be,
it did not altogether find favour with the ancients. Pythagoras, who
had quaint ideas on the subject of the human soul, forbade his
disciples to eat beans, because they were generated in the foul ooze
out of which man was created. Lucian, who had a vivid imagination,
describes a philosopher in Hades who was particularly hard on the
bean, to eat which he declared was as great a crime as to eat one’s
father’s head. And yet Lucian was accounted a man of common
sense in his time. The Romans only ate beans at funerals, being
under the idea that the souls of the dead abode in the vegetable.
According to tradition, the “caller herrin’” hawked in the streets of
Edinburgh were once known as “lives o’ men,” from the risks run by
the fishermen. And the Romans introduced the bean into England by
way of cheering up our blue forefathers. In the Roman festival of
Lemuralia, the father of the family was accustomed to throw black
beans over his head, whilst repeating an incantation. This ceremony
probably inspired Lucian’s philosopher—for whom, however, every
allowance should be made, when we come to consider his place of
residence—with his jaundiced views of the Faba vulgaris. Curiously
enough, amongst the vulgar folk, at the present day, there would
seem to be some sort of prejudice against the vegetable; or why
should “I’ll give him beans” be a synonymous threat with “I’ll do him
all the mischief I can?”
There is plenty of nourishment in a bean; that is the opinion of the
entire medical faculty. And whilst beans and bacon make a favourite
summer repast for the farm-labourer and his family, the dish is also
(at the commencement of the bean season) to be met with at the
tables of the wealthy. The aroma of the flower of the broad bean
was once compared, in one of John Leech’s studies in Punch, to “the
most delicious ’air oil,” but, apart from this fragrance, there is but
little sentiment about the Faba vulgaris. A much more graceful
vegetable is the Phaseolus vulgaris, the kidney, or, as the idiotic
French call it, the haricot bean. It is just as sensible to call a leg of
Welsh mutton a pré salé, or salt meadow. No well-behaved hashed
venison introduces himself to our notice unless accompanied by a
dish of kidney beans. And few people in Europe besides Frenchmen
and convicts eat the dried seeds of this form of bean, which is
frequently sown in suburban gardens to form a fence to keep out
cats. But the suburban cat knows a trick worth a dozen of that one;
and no bean that was ever born will arrest his progress, or turn him
from his evil ways. It is criminal to smother the kidney bean with
melted butter at table. A little oil, vinegar, and pepper agree with
him much better.
In the great continent of America, the kidney-bean seed, dried, is
freely partaken of. Pork and “Borston” beans, in fact, form the
national dish, and right good it is. But do not attempt any violent
exercise after eating the same. The Mexicans are the largest bean-
eaters in the world. They fry the vegetables in oil or stew them with
peppers and onions, and these frijoles form the principal sustenance
of the lower orders. An English “bean feast” (Vulg. beano) is a feast
at which no beans, and not many other things, are eaten. The
intelligent foreigner may take it that beano simply means the
worship of Bacchus.
With the exception of the onion there is no more useful aid to
cookery of all sorts than the lowly carrot, which was introduced into
England—no, not by the Romans—from Holland, in the sixteenth
century. And the ladies who attended the court of Charles I. were in
the habit of wearing carrot leaves in the hair, and on their court
robes, instead of feathers. A similar fashion might be revived at the
present epoch, with advantage to the banking account of vile man.
As the Flemish gardeners brought over the roots, we should not
despise carrots cooked in the Flemish way. Simmer some young
carrots in butter, with pepper and salt. Add cream (or milk and yolk
of eggs), a pinch of sugar, and a little chopped parsley.
H.R.H. the Prince of Wales, according to report, invariably eats
carrot soup on the 26th of August. The French call it “Crécy” soup,
because their best carrots grow there; and Crécy it may be
remembered was also the scene of a great battle, when one
Englishman proved better than five Frenchmen. In this battle the
Black Prince performed prodigies of valour, afterwards assuming the
crest of the late Bohemian King—three ostrich feathers (surely these
should be carrot tops?) with the motto “Ich Dien.”
Crécy Soup.
Tomato
Tomate au Gratin:
Cut open the tops and scoop out the pulp. Pass it through a
sieve, to clear away the pips, and mix with it either a modicum
of butter, or oil, some chopped shalot and garlic, with pepper
and salt. Simmer the mixture for a quarter of an hour, then stir
in some bread-crumbs, previously soaked in broth, and some
yolks of egg. When cold, fill the tomato skins with the mixture,
shake some fine bread raspings over each, and bake in quick
oven for ten or twelve minutes.
The
Turnip
Spinach
Onion.
Garlic
(or gar-leek, the original onion), the Egyptians got hold of the tear-
provoker and cultivated it 2000 years before the Christian era. So
that few of the mortals of whom we have ever read can have been
ignorant of the uses of the onion, or gar-leek. But knowledge and
practice have enabled modern gardeners to produce larger bulbs
than even the most imaginative of the ancients can have dreamt of.
To mention all the uses to which the onion is put in the kitchen
would be to write a book too weighty for any known motive power
to convey to the British Museum; but it may be briefly observed of
the juice of the Cepa that it is invaluable for almost any purpose,
from flavouring a dish fit to set before a king, to the alleviation of
the inflammation caused by the poison-bearing needle which the
restless wasp keeps for use within his, or her, tail. In fact, the
inhabited portion of the globe had better be without noses than
without onions.
Like the tomato, Celery is a “hextra”—and a very important one. If
you buy the heads at half-a-crown per hundred and sell them at
threepence a portion, it will not exercise your calculating powers to
discover the profits which can be made out of this simple root.
Celery is simply cultivated “smallage”; a weed which has existed in
Britain since the age of ice. It was the Italians who made the
discovery that educated smallage would become celery; and it is
worthy of note that their forefathers, the conquerors of the world,
with the Greeks, seem to have known “no touch of it”—as a relish,
at all events; though some writers will have it that the “Apium,” with
which the victors at the Isthmian and other games were crowned
was not parsley but the leaf of the celery plant. But what does it
matter? Celery is invaluable as a flavourer, and when properly
cultivated, and not stringy, a most delightful and satisfactory
substance to bite. In fact a pretty woman never shows to more
advantage than when nibbling a crisp, “short” head of celery—
provided she possess pretty teeth.
With boiled turkey, or ditto pheasant, celery sauce is de rigueur; and
it should be flavoured slightly with slices of onion, an ounce of butter
being allowed to every head of celery. The French are fond of it
stewed; and as long as the flavour of the gravy, or jus, does not
disguise the flavour of the celery, it is excellent when thus treated.
Its merits in a salad will be touched upon in another chapter.
The Parsnip is a native of England, where it is chiefly used to make
an inferior kind of spirit, or a dreadful brand of wine. Otherwise few
people would trouble to cultivate the parsnip; for we can’t be having
boiled pork or salt fish for dinner every day. The Vegetable Marrow is
a member of the pumpkin family and is a comparatively tasteless
occupant of the garden, its appearance in which heralds the
departure of summer. In the suburbs, if you want to annoy the
people next door, you cannot do better than put in a marrow plant
or two. If they come to anything, and get plenty of water, they will
crawl all over your neighbour’s premises; and unless he is fond of
the breed, and cuts and cooks them, they make him mad. The frugal
housewife, blessed with a large family, makes jam of the surplus
marrows; but I prefer a conserve of apricot, gooseberry, or
greengage. Another purpose to which to put this vegetable is—
Scoop out the seeds, after cutting it in half, lengthways. Fill the
space with minced veal (cooked), small cubes of bacon, and
plenty of seasoning—some people add the yoke of an egg—put
on the other half marrow, and bake for half-an-hour.
This Baked Marrow is a cheap and homely dish which, like many
another savoury dish, seldom finds its way to the rich man’s dining-
room.
The Artichoke is a species of thistle; and the man who pays the usual
high-toned restaurant prices for the pleasure of eating such insipid
food, is an—never mind what. Boil the thing in salt and water, and
dip the ends of the leaves in oil and vinegar, or Holland sauce,
before eating. Then you will enjoy the really fine flavour of the—oil
and vinegar, or Holland sauce.
The so-called Jerusalem Artichoke is really a species of sunflower. Its
tuber is not a universal favourite, though it possesses far from a
coarse flavour. The plant has nothing whatever to do with Jerusalem,
and never had. Put a tuber or two into your garden, and you will
have Jerusalem artichokes as long as you live on those premises. For
the vegetable will stay with you as long as the gout, or the rate-
gatherer. Pheasants are particularly partial to this sort of crop.
By far the best vegetable production of the gorgeous East is the
Brinjal
’Tis oval in shape, and about the size of a hen’s egg, the surface
being purple in colour. It is usually cut in twain and done “on the
grating”; I have met something very like the brinjal in Covent
Garden; but can find no record of the vegetable’s pedigree in any
book.
Although there are still many vegetarian restaurants in our large
towns, the prejudice against animal food is, happily, dying out; and
if ridicule could kill, we should not hear much more of the “cranks”
who with delightful inconsistency, would spurn a collop of beef, and
gorge themselves on milk, in every shape and form. If milk, butter,
and cheese be not animal food I should like to know what is? And it
is as reasonable to ask a man to sustain life on dried peas and
mushrooms as to feed a tiger on cabbages.
Once, and only once, has the writer attempted a
Vegetarian Banquet.
The poor Indian grinds his coriander seeds, green ginger, and other
ingredients between two large flat stones; taking a whiff at the
family “hubble-bubble” pipe at intervals. The frugal British housewife
purchases (alleged) curry powder in the warehouse of Italy—where
it may have lived on, like Claudian, “through the centuries”—stirs a
spoonful or two into the hashed mutton, surrounds it with a wall of
clammy rice, and calls it Benares Curry, made from the recipe of a
very dear uncle who met his death while tiger-shooting. And you will
be in the minority if you do not cut this savoury meat with a knife,
and eat potatoes, and very often cabbage, with it. The far-seeing
eating-house keeper corrals a Lascar or a discharged Mehtar into the
firm, gives him his board, a pound a month, and a clean puggaree
and Kummerbund daily, and “stars” him in the bill as an “Indian
chef, fresh from the Chowringhee Club, Calcutta.” And it is part of
the duties of this Oriental—supposed by the unwary to be at least a
prince in his native land—to hand the portions of curry, which he
may or may not have concocted, to the appreciative guests, who
enjoy the repast all the more from having the scent of the Hooghly
brought across the footlights. I was once sadly and solemnly
reproved by the head waiter of a very “swagger” establishment
indeed for sending away, after one little taste, the (alleged) curry
which had been handed me by an exile from Ind, in snow-white
raiment.
“You really ought to have eaten that, sir,” said the waiter, “for that
man’s family have been celebrated curry-makers for generations.”
I smole a broad smile. In the Land of the Moguls the very babies
who roll in the dust know the secret of curry-making. But that “that
man” had had any hand in the horrible concoction placed before me
I still resolutely decline to believe. And how can a man be cook and
waiter at the same time? The “native curry-maker,” depend on it, is
more or less of a fraud; and his aid is only invoked as an excuse for
overcharging.
At the Oriental Club are served, or used to be served, really excellent
curries, assorted; for as there be more ways than one of killing a
cat, so are there more curries than one. The French turn out a
horrible mixture, with parsley and mushrooms in it, which they call
kari; it is called by a still worse name on the Boulevards, and the
children of our lively neighbours are frequently threatened with it by
their nurses.
On the whole, the East Indian method is the best; and the most
philanthropic curry I ever tasted was one which my own Khitmughar
had just prepared, with infinite pains, for his own consumption. The
poor heathen had prospected a feast, as it was one of his numerous
“big days”; so, despising the homely dhal, on the which, with a plate
of rice and a modicum of rancid butter, he was wont to sustain
existence, he had manufactured a savoury mess of pottage, the
looks of which gratified me. So, at the risk of starting another
Mutiny, it was ordained that the slave should serve the refection at
the table of the “protector of the poor.” And a pukkha curry it was,
too. Another dish of native manufacture with which the writer
became acquainted was a
Parsee Curry.
The eminent firm of Jehangeer on one occasion presented a petition
to the commanding-officer that they might be allowed to supply a
special curry to the mess one guest-night. The request was probably
made as an inducement to some of the young officers to pay a little
on account of their “owings” to the firm; but it is to be feared that
no special vote of thanks followed the sampling of that special curry.
It was a curry! I tasted it for a week (as the Frenchman did the soup
of Swindon); and the Parsee chef must have upset the entire
contents of the spice-box into it. I never felt more like murder than
when the hotel cook in Manchester put nutmeg in the oyster sauce;
but after that curry, the strangling of the entire firm of Jehangeer
would, in our cantonments, at all events, have been brought in
“justifiable homicide.”
“Oyster sauce” recalls a quaint simile I once heard a bookmaker
make use of. He was talking of one of his aristocratic debtors, whom
he described as sure to pay up, if you could only get hold of him.
“But mark you,” continued the layer of odds, “he’s just about as easy
to get hold of as the oyster in the sauce, at one of our moonicipal
banquets!” But return we to our coriander seeds. There is absolutely
no reason why the frugal housewife in this country should not make
her own curry powder from day to day, as it may be required. Here
is an average Indian recipe; but it must be remembered that in the
gorgeous East tastes vary as much as elsewhere, and that Bengal,
Bombay, Madras (including Burmah), Ceylon, and the Straits
Settlements, have all different methods of preparing a curry.
What to Curry.
A mistaken notion has prevailed for some time amongst men and
women who write books, that the Indian curry mixture is almost red-
hot to the taste. As a matter of fact it is of a far milder nature than
many I have tasted “on this side.” Also the Anglo-Indian does not
sustain life entirely on food flavoured with turmeric and garlic. In
fact, during a stay of seven years in the gorgeous East, the writer’s
experience was that not one in ten touched curry at the dinner
table. At second breakfast—otherwise known as “tiffin”—it was a
favoured dish; but the stuff prepared for the meal of the day—or the
bulk thereof—usually went to gratify the voracious appetite of the
“mehters,” the Hindus who swept out the mess-rooms, and whose
lowness of “caste” allowed them to eat “anything.” An eccentric meal
was the mehter’s dinner. Into the empty preserved-meat tin which
he brought round to the back door I have seen emptied such
assorted pabulum as mock turtle soup, lobster salad, plum pudding
and custard, curry, and (of course), the surplus vilolif; and in a few
seconds he was squatting on his heels, and spading into the mixture
with both hands.
In the Bengal Presidency cocoa-nut is freely used with a curry
dressing; and as some men have as great a horror of this addition,
as of oil in a salad, it is as well to consult the tastes of your guests
beforehand.
A Prawn Curry I have seen made in Calcutta as follows, the
proportions of spices, etc., being specially written down by a
munshi:—
But the champion of curries ever sampled by the writer was a dry
curry—a decided improvement on those usually served in the Madras
Presidency—and the recipe (which has been already published in the
Sporting Times and Lady’s Pictorial), only came into the writer’s
possession some years after he had quitted the land of temples.
Dry Curry.