Test Bank for C++ Programming: From Problem Analysis to Program Design, 6th Edition – D.S. Malik download
Test Bank for C++ Programming: From Problem Analysis to Program Design, 6th Edition – D.S. Malik download
https://testbankmall.com/product/test-bank-for-c-programming-from-
problem-analysis-to-program-design-6th-edition-d-s-malik/
https://testbankmall.com/product/solution-manual-for-c-programming-
from-problem-analysis-to-program-design-6th-edition-d-s-malik/
https://testbankmall.com/product/c-programming-from-problem-analysis-
to-program-design-8th-edition-malik-solutions-manual/
https://testbankmall.com/product/solution-manual-for-c-programming-
program-design-including-data-structures-6th-edition-d-s-malik/
https://testbankmall.com/product/test-bank-for-advanced-
accounting-14th-edition-joe-ben-hoyle-thomas-schaefer-timothy-
doupnik-3/
Test Bank for Horngren’s Cost Accounting, 17th Edition,
Srikant M. Datar Madhav V. Rajan
https://testbankmall.com/product/test-bank-for-horngrens-cost-
accounting-17th-edition-srikant-m-datar-madhav-v-rajan/
https://testbankmall.com/product/test-bank-for-womens-lives-a-
psychological-exploration-4th-edition-claire-a-etaugh-judith-s-
bridges/
https://testbankmall.com/product/solution-manual-for-financial-
markets-and-institutions-7th-edition-by-saunders/
https://testbankmall.com/product/test-bank-for-human-resource-
management-1st-edition-david-lepak/
https://testbankmall.com/product/solution-manual-for-principles-of-
geotechnical-engineering-8th-edition/
MULTIPLE CHOICE
1. The ____ rules of a programming language tell you which statements are legal, or accepted by the
programming language.
a. semantic c. syntax
b. logical d. grammatical
ANS: C PTS: 1 REF: 34
8. The value of the expression 33/10, assuming both values are integral data types, is ____.
a. 0.3 c. 3.0
b. 3 d. 3.3
ANS: B PTS: 1 REF: 43-44
13. In a C++ program, one and two are double variables and input values are 10.5 and 30.6.
After the statement cin >> one >> two; executes, ____.
a. one = 10.5, two = 10.5 c. one = 30.6, two = 30.6
b. one = 10.5, two = 30.6 d. one = 11, two = 31
ANS: B PTS: 1 REF: 64
14. Suppose that count is an int variable and count = 1. After the statement count++;
executes, the value of count is ____.
a. 1 c. 3
b. 2 d. 4
ANS: B PTS: 1 REF: 70
15. Suppose that alpha and beta are int variables. The statement alpha = --beta; is equivalent
to the statement(s) ____.
a. alpha = 1 - beta;
b. alpha = beta - 1;
c. beta = beta - 1;
alpha = beta;
d. alpha = beta;
beta = beta - 1;
ANS: C PTS: 1 REF: 70-71
16. Suppose that alpha and beta are int variables. The statement alpha = beta--; is equivalent
to the statement(s) ____.
a. alpha = 1 - beta;
b. alpha = beta - 1;
c. beta = beta - 1;
alpha = beta;
d. alpha = beta;
beta = beta - 1;
ANS: D PTS: 1 REF: 70-71
17. Suppose that alpha and beta are int variables. The statement alpha = beta++; is equivalent
to the statement(s) ____.
a. alpha = 1 + beta;
b. alpha = alpha + beta;
c. alpha = beta;
beta = beta + 1;
d. beta = beta + 1;
alpha = beta;
ANS: C PTS: 1 REF: 70-71
18. Suppose that alpha and beta are int variables. The statement alpha = ++beta; is equivalent
to the statement(s) ____.
a. beta = beta + 1;
alpha = beta;
b. alpha = beta;
beta = beta + 1;
c. alpha = alpha + beta;
d. alpha = beta + 1;
ANS: A PTS: 1 REF: 70-71
// Insertion Point 1
int main()
{
//Insertion Point 2
float r = 2.0;
float area;
area = PI * r * r;
22. ____ are executable statements that inform the user what to do.
a. Variables c. Named constants
b. Prompt lines d. Expressions
ANS: B PTS: 1 REF: 91
24. Suppose that alpha and beta are int variables and alpha = 5 and beta = 10. After
the statement alpha *= beta; executes, ____.
a. alpha = 5 c. alpha = 50
b. alpha = 10 d. alpha = 50.0
ANS: C PTS: 1 REF: 94
25. Suppose that sum and num are int variables and sum = 5 and num = 10. After the
statement sum += num executes, ____.
a. sum = 0 c. sum = 10
b. sum = 5 d. sum = 15
ANS: D PTS: 1 REF: 95
COMPLETION
ANS:
Programming
programming
PTS: 1 REF: 28
ANS: variable
PTS: 1 REF: 33
PTS: 1 REF: 34
4. ____________________ functions are those that have already been written and are provided as part of
the system.
ANS:
Predefined
predefined
Standard
standard
PTS: 1 REF: 34
ANS:
Semantic
semantic
PTS: 1 REF: 34
6. ____________________ can be used to identify the authors of the program, give the date when the
program is written or modified, give a brief explanation of the program, and explain the meaning of
key statements in a program.
ANS:
Comments
comments
PTS: 1 REF: 34
7. The smallest individual unit of a program written in any language is called a(n)
____________________.
ANS: token
PTS: 1 REF: 35
8. In a C++ program, ____________________ are used to separate special symbols, reserved words, and
identifiers.
ANS:
whitespaces
whitespace
white spaces
white space
PTS: 1 REF: 37
9. The ____________________ type is C++ ’s method for allowing programmers to create their own
simple data types.
ANS: enumeration
PTS: 1 REF: 38
10. The memory space for a(n) ____________________ data value is 64 bytes.
PTS: 1 REF: 39
ANS: precision
PTS: 1 REF: 42
12. When a value of one data type is automatically changed to another data type, a(n)
____________________ type coercion is said to have occurred.
ANS: implicit
PTS: 1 REF: 51
ANS: string
PTS: 1 REF: 53
14. In C++, you can use a(n) ____________________ to instruct a program to mark those memory
locations in which data is fixed throughout program execution.
ANS:
named constant
constant
PTS: 1 REF: 55
15. A data type is called ____________________ if the variable or named constant of that type can store
only one value at a time.
ANS: simple
PTS: 1 REF: 57
Random documents with unrelated
content Scribd suggests to you:
NATHANIEL HAWTHORNE
Writing was only one of the interests of Mérimée's life; only one of
the innumerable tasks he set himself. He learnt half a dozen
languages without being a mere linguist. He travelled in half a dozen
countries without being a traveller. He was extremely erudite, but
never a bookish scholar. He fulfilled with enthusiasm his duties as
Inspector of Ancient Monuments without lapsing into a dusty-handed
antiquary. He saw much of the fashionable life of Paris without being
a man of the world. He was a courtier without being nothing but a
courtier, and could accomplish a state mission without turning into a
diplomatist. He studied 'la théologie, la tactique, la poliorcétique,
l'architecture, l'épigraphie, la numismatique, la magie et la cuisine,'
without being solely a theologian, a tactician, a specialist in sieges,
an architect, a decipherer of inscriptions, a coin collector, a wizard,
or an undiluted cook. No more was he a writer, as Dumas, Hazlitt,
Hawthorne, and Keats were writers. On no shore did he burn his
boats. His character was as various as his activities. He was
sensualist and sentimentalist, dandy and Bohemian. Evenings begun
in the salon of Mme. de Boigne or at the Hôtel Castellane were, his
biographer tells us, finished behind the scenes at the Opera. He
wrote delightful love-letters, but whole series of his letters to his
friends are unfitted for print by consistent indecency. He read his
tales to his Empress, and told them in the gipsy tongue by the
camp-fires of Andalusian muleteers. His experiments in literature
were analogous to his experiments in cooking. Both were
expressions of an intense curiosity about life and the methods of life,
and a thirst for personal practical efficiency in them all. Never had
man more facets in which to see the world. It is important in this
essay, that considers only one of them, not to forget that there were
others.
It is indeed not easy to see more than one facet of
The imaginary
author of his
a man's personality at once, and difficult not to
tales. assume that this one facet is the whole. The curés
of the old churches in France who saw Mérimée
busied in protecting the ancient buildings from ruin and restoration
would have been amazed by the witty dandy of the dinners in the
Café de la Rotonde, or by the author of Colomba. Each one of such a
man's expressions suggests a complete portrait, but only the
composite picture tells the truth. It is difficult not to reason from his
work and build up an imaginary author—a discreet, slightly ironical
person, who smiles only with the corners of his mouth, never laughs,
never weeps, modestly disclaims any very personal connection with
his tales, and is careful to seem as little moved as may be by the
terrible or mysterious things he sets before us. This imaginary polite
person, who represented Mérimée in conversation as well as in
books, is not Mérimée, but, just now, as I see him quietly smiling in
the air before me, I know who he is. He is the conventional
raconteur, whose manner every Englishman assumes in the telling of
anecdote or ghost story.
Perhaps each nation has its own. Perhaps each
Printed and
spoken stories.
nation adopts an attitude for anecdote peculiar to
its own genius. The French at any rate is very
different from the English. The Frenchman will gesticulate in his tale,
suit the expression of his face to its emotions, and try, ingratiatingly,
to win our indulgence for his story, that becomes, as he tells it, part
of himself. The Englishman, more tenacious of his dignity, less willing
to hazard it for an effect, throws all responsibility upon the thing
itself. In England, the distinction between printed story-telling and
story-telling by word of mouth is more marked than elsewhere. The
object of both is to interest and move us, but, while the literary artist
makes no bones about it, and takes every advantage possible, giving
the setting of his tale, its colour scheme, its scent, its atmosphere,
the plain Englishman shrinks from all assumption of craftsmanship,
sets out his facts bare, rough like uncut stones, and repudiates by a
purposely disordered language, perhaps by a few words of slang,
any desire of competition with the professional.[9] And we, the
audience, allow ourselves to be moved more readily by an amateur
than by a man who avows his intention of moving us. The avowed
intention provokes a kind of hostility; it is a declaration of war, an
open announcement of a plan to usurp the throne of our own mind,
and to order the sensations we like to think we can control. We are
more lenient with the amateur; we wish to save his face; politeness
and good-fellowship are traitors in our citadel, and we conspire with
the enemy to compass our own yielding.
Mérimée gives his tales no more background than
Mérimée's
adoption of the
an Englishman could put without immodesty into an
after-dinner conversation. He does not decorate
conventions of them with words, nor try to suggest atmosphere by
anecdote.
rhythm or any other of the subtler uses of language.
He does not laugh at his jokes, nor, in moments of pathos, show any
mist in his eyes. The only openly personal touches in his stories are
those sentences of irony as poignant as those of another great
conversationalist, whose Modest Proposal for the eating of little
children is scarcely more cruel than Mateo Falcone. His style is
without felicities. It has none of the Oriental pomp of Gautier's
prose, none of the torrential eloquence of Hugo's; but its limitations
are its virtues. Pomp is the ruin of a plain fact as of a plain man, and
rhetoric rolls facts along too fast to do anything but smooth them.
This style, that seems to disclaim any pretension to be a style at all,
leaves facts unencumbered, with their corners unpolished. It
emphasises Mérimée's continual suggestion that he is not a story-
teller, and so helps to betray us into his power. But I cannot
understand those critics who find it a style of clear glass that shows
us facts through no personality whatever. Always, in reading a
Mérimée, I have an impression of listening to a man who has seen
the world, and was young once upon a time, who loves Brantôme,
and who in another century would have been a friend of Anthony
Hamilton, and perhaps have written or had a minor part in memoirs
like those of the Count Grammont. And this man is the imaginary
mouthpiece of English anecdote, the mask handed from speaker to
speaker at an English dinner-table.
Mérimée himself had something of the appearance
Mérimée's
anglomanie.
of an Englishman; everything except the smile,
according to Taine. No Frenchman can write of him
without referring to his anglomanie. His mother had English
relatives, and Hazlitt, Holcroft, and Hazlitt's worshipped Northcote
were among his father's friends. He was not baptized in the Catholic
religion. He seems to have grown up in an atmosphere not unlike
that of many English intellectual families, and very early made
friends across the Channel for himself. This Englishness perhaps
partly accounts for the peculiar attitude he took as a story-teller, and
also made possible that curious reconciliation between the virtues of
rival schools that the attitude demanded; made possible, that is to
say, the apparent paradox of a man whose subjects were Romantic,
whose style was almost Classical, and whose stories were yet a
prophecy of the Realists. It is not a French characteristic to
recognise virtues in more than one type at once, and to combine
them. 'Le Roi est mort; vive le Roi.' The French invented that saying.
They do not recognise compromises, but are exclusive in their
judgments, and regulate their opinions by general rules. A Romantic
hates all Classicists, a Realist finds his worst term of opprobrium in
the word Romantic. An Englishman, on the other hand, does not
think of regulating his affections or actions by a theory. If he has
principles, he locks them up with his black clothes for use on special
occasions. He keeps a sturdy affection for Oliver Cromwell, without
letting his love for the Commonwealth abate in the least his loyalty
to the King. Mérimée seems extraordinarily English in being able to
own Romantic ideals, without using Romantic method.
The conversational story-telling depends for its
The contrast
between his
success, not on the wit or charm of the talker, but
manner and his on the plots of his stories. No more exigent test of
material. the intrinsic power of a tale can be applied than
this, of telling it badly in conversation. A good story
will sometimes gain by the naked recital of its facts; a bad one is
immediately betrayed. Bad stories, in this sense, are those that
resemble the women of whom Lyly wrote:—'Take from them their
periwigges, their paintings, their Jewells, their rowles, their
boulstrings, and thou shalt soone perceive that a woman is the least
part of hir selfe.' How many times, in repeating to a friend the story
of a book, you have become suddenly aware it was an empty,
worthless thing that, in clothes more gorgeous than it had a right to
wear, had made you its dupe for a moment. Mérimée was compelled
by his method to tell good stories or none. His material, to be
sufficiently strong to stand without support, to be built with rigid
economy, and to make its effects out of its construction, to be told
as if with a desire of making no impression, and to make an
impression all the stronger for such telling, could not be of a light or
delicate nature. His events had to be striking, visible, conclusive. He
had to choose stories in which something happened. There is death
in almost every one of his tales. Hence comes the amazing contrast
between his work and that of the Romantics. The large gesture, the
simple violent passions are his as well as theirs, because he needed
them, but, while they matched their subjects in their temperaments,
and wrote of hot blood with pulsing veins, everything in Mérimée's
stories is vivid and passionate except the author. The atmosphere of
his tales is not warm or moist, but extraordinarily rarified. In that
clear air his colours seem almost white. If they were not so brilliant
we should not perceive them at all. Even his women are chosen for
the attitude. The women a man loves are usually reflected in his
work. But Mérimée's women are the women of Romance, dying for
love or for hate, ready at any moment to throw their emotions into
dramatic action, while the women he loved were capricious,
whimsical, tender seldom, outrées never. The writer needed
picturesque women as clear as facts. The man loved women who
never betrayed themselves, but were sufficiently elusive to give him
an Epicurean pleasure in pursuing them.
The art of Mérimée's tales is one of expository
An art of
construction.
construction. He was compelled by his self-denials
to be as conscious an artist as Poe. He is like a good
chess-player who surrenders many pieces, and is forced to make
most wonderful play with the few that remain. His effects are got
from the material of his tales, not superimposed on the vital stuff
like the front of a Venetian palace on the plain wall. He takes his
dramatic material, and sets it before us in his undecorated style, so
that no morsel of its vitality is wasted, smothering no wild gesture in
elaborate drapery, but cutting it out so nakedly that every quivering
sinew can be seen. His art has been compared to drawing, but it is
more like sculpture. His stories are so cleanly carved out of existence
that they are 'without deception.' We can examine them from above
and from below, in a dozen different lights. There is no point of view
from which the artist begs us to refrain. Behind a drawing there is a
bare sheet. Behind a story of Mérimée's there is the other side.
His art is more like painting in those few tales of
Pointillism in
facts.
the marvellous that are his ghost stories, as the
others are his anecdotes. Mérimée had the
archæologist's hatred of the mysterious, and the artist's delight in
creating it. He reconciled the two by producing mysterious effects by
statements of the utmost clarity, the very clarity of the statements
throwing the reader off his guard so that he does not perceive the
purposeful skill with which they are chosen and put together. There
is a school of painting in France, whose followers call themselves
Pointillists; they get their effects by laying spots of simple colours
side by side, each one separate, each one though in the right
position with regard to other spots of other colours placed in its
neighbourhood. At a sufficient distance they merge luminously into
the less simple colours of the picture. Mérimée's treatment of the
marvellous was not unlike this. The vague mystery of La Vénus d'Ille
is not reflected by any vagueness or mystery in the telling of the
tale. It is impossible to point to the single sentence, the single
paragraph that makes the mystery mysterious. You cannot find them
because they do not exist. Instead, there are a hundred morsels of
fact. Not one of them is incredible; not one is without a reasonable
explanation if an explanation is necessary. And yet all these
concrete, simple facts combine imperceptibly in producing the
extraordinary supernatural feeling of the tale. Compare this negative
manner of treating a miracle with the frank, positive fairy-tale of
Gautier's Arria Marcella. The effects of both tales are perfectly
achieved, but Arria Marcella belongs to written story-telling. We
believe in her because Gautier wishes us to believe, and uses every
means of colour and rhythm and sensual suggestion to compel his
readers to subject their imaginations to his own. The Venus belongs
to story-telling by word of mouth. Hers is a ghost story whose
shudder we covet, and experience, in spite of ourselves, in spite of
the half-incredulous story-teller, by virtue of those simple facts so
cunningly put together.
But to write analytically of such stories is to write with compass and
rule, dully, awkwardly, technically, badly. It is impossible to express
the excellence of a bridge except by showing how
Strength or
charm.
perfectly its curves represent the principles of its
design, and to talk like an architect of the method of
its building. And that is so very inadequate. It is easy to write of
warmth, of delicacy, of sweetness; there is nothing harder in the
world than to write of the icy strength that is shown not in action
but in construction. And although there is a real charm about the
shy, active, intellectual man who made them, a charm that is shown
in his love-letters, yet there is no charm at all about Mérimée's
stories. The difference between them and such tales as Nathaniel
Hawthorne's is that between the little Grecian lady in baked clay,
who stands upon my mantelpiece, still removing with what grace of
curved body and neck and delicate arm the thorn that pricked her
tiny foot some thousand years ago, and the copy of an Egyptian
god, standing upright, one straight leg advanced, his jackal head set
square upon his shoulders, his arms stiff at his sides, his legs like
pillars, so strong in the restraint of every line that to look at him is a
bracing of the muscles. There is no charm in him, no grace, no
delicacy, and he needs neither delicacy, grace, nor charm. Erect in
his own economy of strength he has an implacable, strenuous power
that any added tenderness would weaken and perhaps destroy.
FLAUBERT
FLAUBERT
'I am the last of the fathers of the church,' said Flaubert, and on this
text his niece remarks that 'with his long chestnut coat, and little
black silk skull-cap, he had something the air of one of the Port-
Royal solitaries.' The metaphor is accurately chosen. Flaubert lived in
an atmosphere of monastic devotion to his art, and the solitaries of
Port-Royal were not more constant than he to their intellectual
preoccupations. A man of excessive openness to sensation, he fled it
and was fascinated by it. He would take ever so little of the world
and torture himself with its examination because it hurt him to look
at it. Life, and especially that life whose sensitiveness was so slight
as, in comparison with his own, to have no existence, brought him
continual pain. 'La bêtise entre mes pores.' Stupidity touching him
anywhere made him shrink like a snail touched with a feather. He
had recoquillements, shrinkings up, when with his dearest friends,
and it was pain to him to be recalled to ordinary existence. He
escaped from modernity in dreams of the Orient, but was continually
drawn back by memory of the unhappiness that was waiting for him,
to the contemplation of those ordinary people whose slightest act,
as he imagined it, struck such a grating discord with himself. An
exuberant life like Gautier's was impossible to such a man. He could
not be so gregarious a recluse as Balzac. He had to fashion a
peculiar retreat, a room with two windows, from one of which he
could see the stars, and from the other watch and listen to the
people whom he hated and found so efficient as the instruments of
his self torture. He found the seclusion he desired in a most absolute
devotion to the art of literature, which was in his hands the art of
making beauty out of pain. Pain, self-inflicted, was at the starting-
point of all his works, and in most of them went with him step by
step throughout.
GUSTAVE FLAUBERT
A NOTE ON DE MAUPASSANT
De Maupassant for seven years submitted all he wrote to
Flaubert's criticism. If we add to the preceding essay some
sentences from Flaubert's correspondence, it will be easy to
imagine the lines that criticism must have taken, and interesting
to compare them with the resulting craftsman.
'I love above all the nervous phrase, substantial, clear, with
strong muscles and browned skin. I love masculine phrases not
feminine.
'What dull stupidity it is always to praise the lie, and to say that
poetry lives on illusion: as if disillusion were not a hundred
times more poetic.
'Find out what is really your nature, and be in harmony with it.
Sibi constat said Horace. All is there.
'Work, above all think, condense your thought; you know that
beautiful fragments are worthless; unity, unity is everything.
'The author in his work ought to be like God in the Universe,
present everywhere and visible nowhere.
'Fine subjects make mediocre works.'
These sentences might well be taken as de Maupassant's
inspiration. De Maupassant, a man of powerful mind, with
Flaubert's example before him, makes each of his tales a
rounded unity, and a thing outside himself, and yet a thing that
no one else could have written. He shunned fine subjects. His
stories are like sections of life prepared for examination, and in
looking at them we are flattered into thinking that we have
clearer eyes than usual. He chooses some quite ordinary
incident, and by working up selected details of it, turns it into a
story as exciting to the curiosity as a detective puzzle. He allows
no abstract feminine-phrased discourses on the psychology of
his characters: he does not take advantage of their confessions.
Their psychology is manifested in things said and in things
done. The works, as in life, are hidden in the fourth dimension,
where we cannot see them.
La Rendezvous, a tiny story of seven pages, will illustrate his
methods. The chosen incident is that of a woman going to see
her lover, meeting some one else on the way, and going off with
him instead. That is all. Let us see how de Maupassant works it
out. Here is his first paragraph:
'Her hat on her head, her cloak on her back, a black veil across
her face, another in her pocket, which she would put on over
the first as soon as she was in the guilty cab, she was tapping
the point of her boot with the end of her umbrella, and stayed
sitting in her room, unable to make up her mind to go out to
keep the appointment.'
The whole of her indecision is expressed before it is explained.
Then there is a paragraph that lets us know that she had been
keeping the appointment regularly for two years, and we
sympathise with her a little. A description of her room follows,
made by mention of a clock ticking the seconds, a half-read
book on a rosewood desk, and a perfume. The clock strikes and
she goes out, lying to the servant. We watch her, loitering on
the way, telling herself that the Vicomte awaiting her would be
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.
testbankmall.com