Get C++ Programming From Problem Analysis to Program Design 8th Edition Malik Test Bank free all chapters
Get C++ Programming From Problem Analysis to Program Design 8th Edition Malik Test Bank free all chapters
https://testbankdeal.com/product/c-programming-from-problem-analysis-
to-program-design-8th-edition-malik-solutions-manual/
testbankdeal.com
https://testbankdeal.com/product/c-programming-from-problem-analysis-
to-program-design-7th-edition-malik-test-bank/
testbankdeal.com
https://testbankdeal.com/product/c-programming-from-problem-analysis-
to-program-design-6th-edition-malik-test-bank/
testbankdeal.com
https://testbankdeal.com/product/mathematics-for-elementary-school-
teachers-6th-edition-bassarear-solutions-manual/
testbankdeal.com
Network Management Principles and Practices 2nd Edition
Subramanian Solutions Manual
https://testbankdeal.com/product/network-management-principles-and-
practices-2nd-edition-subramanian-solutions-manual/
testbankdeal.com
https://testbankdeal.com/product/abnormal-psychology-16th-edition-
butcher-test-bank/
testbankdeal.com
https://testbankdeal.com/product/operations-management-processes-and-
supply-chains-12th-edition-krajewski-solutions-manual/
testbankdeal.com
https://testbankdeal.com/product/microbiology-fundamentals-a-clinical-
approach-3rd-edition-cowan-test-bank/
testbankdeal.com
https://testbankdeal.com/product/illustrated-microsoft-office-365-and-
office-2016-fundamentals-1st-edition-hunt-solutions-manual/
testbankdeal.com
Issues in Financial Accounting 15th Edition Henderson Test
Bank
https://testbankdeal.com/product/issues-in-financial-accounting-15th-
edition-henderson-test-bank/
testbankdeal.com
Name: Class: Date:
Chapter 10
1. A class is an example of a structured data type.
a. True
b. False
ANSWER: True
POINTS: 1
REFERENCES: 652
QUESTION TYPE: True / False
HAS VARIABLES: False
DATE CREATED: 10/5/2016 1:41 PM
DATE MODIFIED: 10/5/2016 1:41 PM
3. If the heading of a member function of a class ends with the word const, then the function member cannot modify the
private member variables, but it can modify the public member variables.
a. True
b. False
ANSWER: False
POINTS: 1
REFERENCES: 655
QUESTION TYPE: True / False
HAS VARIABLES: False
DATE CREATED: 10/5/2016 1:41 PM
DATE MODIFIED: 10/5/2016 1:41 PM
Chapter 10
DATE MODIFIED: 10/5/2016 1:41 PM
private:
int x;
};
myClass myObject;
6. If an object is declared in the definition of a member function of the class, then the object can access both the public
and private members of the class.
a. True
b. False
ANSWER: True
POINTS: 1
REFERENCES: 657
QUESTION TYPE: True / False
HAS VARIABLES: False
DATE CREATED: 10/5/2016 1:41 PM
DATE MODIFIED: 10/5/2016 1:41 PM
7. If an object is created in a user program, then the object can access both the public and private members of the
class.
a. True
b. False
ANSWER: False
POINTS: 1
Chapter 10
REFERENCES: 657
QUESTION TYPE: True / False
HAS VARIABLES: False
DATE CREATED: 10/5/2016 1:41 PM
DATE MODIFIED: 10/5/2016 1:41 PM
8. You can use arithmetic operators to perform arithmetic operations on class objects.
a. True
b. False
ANSWER: False
POINTS: 1
REFERENCES: 659
QUESTION TYPE: True / False
HAS VARIABLES: False
DATE CREATED: 10/5/2016 1:41 PM
DATE MODIFIED: 10/5/2016 1:41 PM
10. The public members of a class must be declared before the private members.
a. True
b. False
ANSWER: False
POINTS: 1
REFERENCES: 670
QUESTION TYPE: True / False
HAS VARIABLES: False
DATE CREATED: 10/5/2016 1:41 PM
DATE MODIFIED: 10/5/2016 1:41 PM
11. The components of a class are called the ____ of the class.
a. elements b. members
c. objects d. properties
ANSWER: b
Copyright Cengage Learning. Powered by Cognero. Page 3
Name: Class: Date:
Chapter 10
POINTS: 1
REFERENCES: 652
QUESTION TYPE: Multiple Choice
HAS VARIABLES: False
DATE CREATED: 10/5/2016 1:41 PM
DATE MODIFIED: 10/5/2016 1:41 PM
a. class studentType
{
public:
void setData(string, double, int);
private:
string name;
};
b. class studentType
{
public:
void setData(string, double, int);
void print() const;
private:
string name;
double gpa;
}
c. class studentType
{
public void setData(string, double, int);
private string name;
};
d. studentType class
{
public: void setData(string, double, int);
private: string name;
};
ANSWER: a
POINTS: 1
REFERENCES: 654
QUESTION TYPE: Multiple Choice
HAS VARIABLES: False
DATE CREATED: 10/5/2016 1:41 PM
DATE MODIFIED: 10/5/2016 1:41 PM
13. If a member of a class is ____, you cannot access it outside the class.
Copyright Cengage Learning. Powered by Cognero. Page 4
Name: Class: Date:
Chapter 10
a. public b. automatic
c. private d. static
ANSWER: c
POINTS: 1
REFERENCES: 654
QUESTION TYPE: Multiple Choice
HAS VARIABLES: False
DATE CREATED: 10/5/2016 1:41 PM
DATE MODIFIED: 10/5/2016 1:41 PM
14. A class and its members can be described graphically using a notation known as the ____ notation.
a. OON b. OOD
c. UML d. OOP
ANSWER: c
POINTS: 1
REFERENCES: 656
QUESTION TYPE: Multiple Choice
HAS VARIABLES: False
DATE CREATED: 10/5/2016 1:41 PM
DATE MODIFIED: 10/5/2016 1:41 PM
clockType
-hr: int
-min: int
-sec: int
+setTime(int, int, int): void
+getTime(int&, int&, int&) const: void
+printTime() const: void
+incrementSeconds(): int
+incrementMinutes(): int
+incrementHours(): int
+equalTime(const clockType&) const: bool
15. The word ____ at the end of several the member functions in the accompanying figure class clockType specifies
that these functions cannot modify the member variables of a clockType object.
a. static b. const
c. automatic d. private
ANSWER: b
POINTS: 1
REFERENCES: 655
QUESTION TYPE: Multiple Choice
HAS VARIABLES: False
PREFACE NAME: clockType definition
DATE CREATED: 10/5/2016 1:41 PM
DATE MODIFIED: 10/5/2016 1:41 PM
Copyright Cengage Learning. Powered by Cognero. Page 5
Name: Class: Date:
Chapter 10
16. Consider the UML class diagram shown in the accompanying figure. Which of the following is the name of the class?
a. clock b. clockType
c. Type d. +clockType
ANSWER: b
POINTS: 1
REFERENCES: 656
QUESTION TYPE: Multiple Choice
HAS VARIABLES: False
PREFACE NAME: clockType definition
DATE CREATED: 10/5/2016 1:41 PM
DATE MODIFIED: 10/5/2016 1:41 PM
17. Consider the UML class diagram shown in the accompanying figure. According to the UML class diagram, how many
private members are in the class?
a. none b. zero
c. two d. three
ANSWER: d
POINTS: 1
REFERENCES: 656
QUESTION TYPE: Multiple Choice
HAS VARIABLES: False
PREFACE NAME: clockType definition
DATE CREATED: 10/5/2016 1:41 PM
DATE MODIFIED: 10/5/2016 1:41 PM
18. A ____ sign in front of a member name on a UML diagram indicates that this member is a public member.
a. + b. -
c. # d. $
ANSWER: a
POINTS: 1
REFERENCES: 656
QUESTION TYPE: Multiple Choice
HAS VARIABLES: False
DATE CREATED: 10/5/2016 1:41 PM
DATE MODIFIED: 10/5/2016 1:41 PM
19. A ____ sign in front of a member name on a UML diagram indicates that this member is a protected member.
a. + b. -
c. # d. $
ANSWER: c
POINTS: 1
REFERENCES: 656
Copyright Cengage Learning. Powered by Cognero. Page 6
Name: Class: Date:
Chapter 10
QUESTION TYPE: Multiple Choice
HAS VARIABLES: False
DATE CREATED: 10/5/2016 1:41 PM
DATE MODIFIED: 10/5/2016 1:41 PM
class rectangleType
{
public:
void setLengthWidth(double x, double y);
//Postcondition: length = x; width = y;
void print() const;
//Output length and width;
double area();
//Calculate and return the area of the rectangle;
double perimeter();
//Calculate and return the parameter;
rectangleType();
//Postcondition: length = 0; width = 0;
rectangleType(double x, double y);
//Postcondition: length = x; width = y;
private:
double length;
double width;
};
20. Consider the accompanying class definition. Which of the following variable declarations is correct?
a. rectangle rectangleType;
b. class rectangleType rectangle;
c. rectangleType rectangle;
d. rectangle rectangleType.area;
ANSWER: c
POINTS: 1
REFERENCES: 657
QUESTION TYPE: Multiple Choice
HAS VARIABLES: False
PREFACE NAME: rectangleType class
DATE CREATED: 10/5/2016 1:41 PM
DATE MODIFIED: 10/5/2016 1:41 PM
rectangleType bigRect;
Chapter 10
POINTS: 1
REFERENCES: 657
QUESTION TYPE: Multiple Choice
HAS VARIABLES: False
PREFACE NAME: rectangleType class
DATE CREATED: 10/5/2016 1:41 PM
DATE MODIFIED: 10/5/2016 1:41 PM
22. Consider the accompanying class definition, and the object declaration:
rectangleType bigRect(14,10);
24. A class object can be ____. That is, it is created each time the control reaches its declaration, and destroyed when
the control exits the surrounding block.
a. static b. automatic
c. local d. public
ANSWER: b
POINTS: 1
Chapter 10
REFERENCES: 660
QUESTION TYPE: Multiple Choice
HAS VARIABLES: False
DATE CREATED: 10/5/2016 1:41 PM
DATE MODIFIED: 10/5/2016 1:41 PM
25. A class object can be ____. That is, it can be created once, when the control reaches its declaration, and destroyed
when the program terminates.
a. static b. automatic
c. local d. public
ANSWER: a
POINTS: 1
REFERENCES: 660
QUESTION TYPE: Multiple Choice
HAS VARIABLES: False
DATE CREATED: 10/5/2016 1:41 PM
DATE MODIFIED: 10/5/2016 1:41 PM
26. In C++, you can pass a variable by reference and still prevent the function from changing its value by using the
keyword ____ in the formal parameter declaration.
a. automatic b. private
c. static d. const
ANSWER: d
POINTS: 1
REFERENCES: 660
QUESTION TYPE: Multiple Choice
HAS VARIABLES: False
DATE CREATED: 10/5/2016 1:41 PM
DATE MODIFIED: 10/5/2016 1:41 PM
28. A member function of a class that only accesses the value(s) of the data member(s) is called a(n) ____ function.
a. accessor b. mutator
Chapter 10
c. constructor d. destructor
ANSWER: a
POINTS: 1
REFERENCES: 666
QUESTION TYPE: Multiple Choice
HAS VARIABLES: False
DATE CREATED: 10/5/2016 1:41 PM
DATE MODIFIED: 10/5/2016 1:41 PM
29. To guarantee that the member variables of a class are initialized, you use ____.
a. accessors b. mutators
c. constructors d. destructor
ANSWER: c
POINTS: 1
REFERENCES: 671
QUESTION TYPE: Multiple Choice
HAS VARIABLES: False
DATE CREATED: 10/5/2016 1:41 PM
DATE MODIFIED: 10/5/2016 1:41 PM
class secretType
{
public:
static int count;
static int z;
secretType();
secretType(int a);
void print();
static void incrementY();
private:
int x;
static int y;
};
secretType::secretType()
{
x = 1;
}
secretType::secretType(int a)
{
x = a;
}
void secretType::print()
{
Copyright Cengage Learning. Powered by Cognero. Page 10
Visit https://testbankdead.com
now to explore a rich
collection of testbank,
solution manual and enjoy
exciting offers!
Name: Class: Date:
Chapter 10
cout << "x = " << x << ", y = " << y
<< "z = " << z
<< ", count = " << count << endl;
}
30. Consider the accompanying class and member functions definitions. How many constructors are present in the class
definition?
a. none b. one
c. two d. three
ANSWER: c
POINTS: 1
REFERENCES: 672
QUESTION TYPE: Multiple Choice
HAS VARIABLES: False
PREFACE NAME: secretType class
DATE CREATED: 10/5/2016 1:41 PM
DATE MODIFIED: 10/5/2016 1:41 PM
32. A destructor has the character ____, followed by the name of the class.
a. . b. ::
c. # d. ˜
ANSWER: d
POINTS: 1
REFERENCES: 681
QUESTION TYPE: Multiple Choice
HAS VARIABLES: False
DATE CREATED: 10/5/2016 1:41 PM
DATE MODIFIED: 10/5/2016 1:41 PM
Chapter 10
33. What does ADT stand for?
a. abstract definition type b. asynchronous data transfer
c. abstract data type d. alternative definition type
ANSWER: c
POINTS: 1
REFERENCES: 682
QUESTION TYPE: Multiple Choice
HAS VARIABLES: False
DATE CREATED: 10/5/2016 1:41 PM
DATE MODIFIED: 10/5/2016 1:41 PM
35. If a function of a class is static, it is declared in the class definition using the keyword static in its ____.
a. return type b. parameters
c. heading d. main function
ANSWER: c
POINTS: 1
REFERENCES: 701
QUESTION TYPE: Multiple Choice
HAS VARIABLES: False
DATE CREATED: 10/5/2016 1:41 PM
DATE MODIFIED: 10/5/2016 1:41 PM
36. With ____________________ functions, the definitions of the member functions are placed in the implementations
file.
ANSWER: inline
POINTS: 1
REFERENCES: 700
QUESTION TYPE: Completion
HAS VARIABLES: False
DATE CREATED: 10/5/2016 1:41 PM
Copyright Cengage Learning. Powered by Cognero. Page 12
Name: Class: Date:
Chapter 10
DATE MODIFIED: 10/30/2016 12:22 PM
37. If a class object is passed by ____________________, the contents of the member variables of the actual parameter
are copied into the corresponding member variables of the formal parameter.
ANSWER: value
POINTS: 1
REFERENCES: 660
QUESTION TYPE: Completion
HAS VARIABLES: False
DATE CREATED: 10/5/2016 1:41 PM
DATE MODIFIED: 10/5/2016 1:41 PM
38. Non-static member variables of a class are called the ____________________ variables of the class.
ANSWER: instance
POINTS: 1
REFERENCES: 666
QUESTION TYPE: Completion
HAS VARIABLES: False
DATE CREATED: 10/5/2016 1:41 PM
DATE MODIFIED: 10/5/2016 1:41 PM
39. A program or software that uses and manipulates the objects of a class is called a(n) ____________________ of that
class.
ANSWER: client
POINTS: 1
REFERENCES: 666
QUESTION TYPE: Completion
HAS VARIABLES: False
DATE CREATED: 10/5/2016 1:41 PM
DATE MODIFIED: 10/5/2016 1:41 PM
40. A(n) ____________________ function of a class changes the values of the member variable(s) of the class.
ANSWER: mutator
POINTS: 1
REFERENCES: 666
QUESTION TYPE: Completion
HAS VARIABLES: False
DATE CREATED: 10/5/2016 1:41 PM
DATE MODIFIED: 10/5/2016 1:41 PM
41. A(n) ____________________ contains the definitions of the functions to implement the operations of an object.
ANSWER: implementation file
POINTS: 1
REFERENCES: 686
Copyright Cengage Learning. Powered by Cognero. Page 13
Name: Class: Date:
Chapter 10
QUESTION TYPE: Completion
HAS VARIABLES: False
DATE CREATED: 10/5/2016 1:41 PM
DATE MODIFIED: 10/5/2016 1:41 PM
43. A(n) ____________________ is a statement specifying the condition(s) that must be true before the function is called.
ANSWER: precondition
POINTS: 1
REFERENCES: 687
QUESTION TYPE: Completion
HAS VARIABLES: False
DATE CREATED: 10/5/2016 1:41 PM
DATE MODIFIED: 10/5/2016 1:41 PM
V.
"Scratch, scratch, scratch,
My labour never flags;
And what are its wages?—a carcass raw—
Lint, plaisters, and swathing rags,
This tortured head, and this body flayed,
Dyspepsia and gloom alway,
And a brain so blank, each ninny I thank
Who drones me through the day.
VI.
"Itch, itch, itch,
When good dinners glad the sight,
And scratch, scratch, scratch,
When I'm longing to bite, bite, bite,
When under silver roofs
Rich viands my servants bring,
As if to show me their dainty shapes,
And twit me for lingering.
VII.
"Oh! but to breathe the breath
Of the cowslip and primrose sweet
Of the cowslip and primrose sweet,
Where the sky above one's head
Is not of this melting heat;
For only one short hour
To feel as I used to feel
Before I knew Calcutta's suns
Flay men as men the eel.
VIII.
"Oh! but for one short hour
A respite just to snatch!
No blessed leisure for love or lark—
But only time to scratch.
Though goulard water might ease my pain
The antidote I dread,
An idle day might affect my pay,
And physic claims a bed."
IX.
With fingers never at rest,
With cuticle measly red,
A heat-oppress'd victim capered about,
Itching from ankles to head.
Scratch, scratch, scratch,
At a rate few North-Britons could beat,
And still with a voice of dolorous pitch
(Would that its tone could cure the itch!)
Thus sang he of "The Prickly Heat."
There was another parody of Hood's Song of the Shirt, written by Mr.
Clement Scott, entitled The Song of the Clerk. The Editor of this
collection would be glad to know when, and in what work it
appeared.
I remember, I remember,
Ere my childhood flitted by,
It was cold then in December,
And was warmer in July.
In the winter there were freezings—
In the summer there were thaws;
But the weather isn't now at all
Like what it used to was!
* * * *
THOMAS HOOD.
* * * *
When Mr. Henry Irving produced The Iron Chest, at the Lyceum
Theatre, the Editor of The World offered two prizes for the best two
parodies on the subject, the model chosen being Hood's Dream of
Eugene Aram. The successful parodies were printed in The World,
October 22, 1879:—
FIRST PRIZE.
'TWAS in the Strand, a great demand
For seats was quite the rule;
The pit and gallery were crammed,
The stalls and boxes full.
One man remained who could not find
A solitary stool.
Q.
SECOND PRIZE.
THE sky was clear; no ripple marked
The course of silver Tyne;
And all was still, save for the bells
On the necks of the grazing kine.
On his fair demesne Sir Edward looked,
Last of an ancient line.
PORTIONISTA.
* * * * *
C. S.
* * * *
* * * *
II
In France they called them Troubadours,
Or Menestrels, by turns;
The Scandinavians called them Scalds,
The Scotchmen call theirs Burns.
III.
A strange coincidence is this,
Both names implying heat;
But had the Scotchmen call'd theirs Scald.
'Twere title more complete.
IV.
For why call'd BURNS 'tis hard to say
(Except all sense to slaughter);
Scald was the name he should have had,
Being always in hot water.
V.
For he was poor,—his natal hut
Was built of mud, they say;
But though the hut was built of mud,
He was no common clay.
y
VI.
But though of clay he was (a fate
Each child of earth must share),
As well as being a child of earth,
He was a child of Ayr.
VII.
And though he could not vaunt his house,
Nor boast his birth's gentility,
Nature upon the boy bestow'd
Her patent of nobility.
VIII.
It needed not for him his race
In heralds' books should shine;
What pride of ancestry compares
With his illustrious line.
IX.
So he, with heaven-ennobled soul,
All heralds held in scorn,
Save one, the oldest of them all,—
"The herald of the morn."
X.
Call'd by his clarion, up rose he,
True liege of Nature's throne,
Fields to invest, and mountain crest
With blazon of his own.
XI.
His Vert, the morning's dewy green,
His Purpure, evening's close,
His Azure, the unclouded sky,
His Gules, "the red, red rose."
XII.
His Argent sparkled in the streams
That flash'd through birken bowers;
His Or was in the autumn leaves
That fell in golden showers.
XIII.
Silver and gold of other sort
The poet had but little;
But he had more of rarer store,—
His heart's undaunted mettle.
XIV.
And yet his heart was gentle, too,—
Sweet woman could enslave him;
And from the shafts of Cupid's bow
Even Armour[6] could not save him.
XV.
And if that Armour could not save
From shafts that chance might wield,
What wonder that the poet wise
Cared little for a shield.
Cared little for a shield.
XVI.
And Sable, too, and Argent (which
For colours heralds write)
In BURNS' uncompromising hands
Were honest black and white.
XVII.
And in that honest black and white
He wrote his verses bold;
And though he sent them far abroad,
Home truths they always told.
XVIII.
And so for "honest poverty"
He sent a brilliant page down;
And, to do battle for the poor,
The gauger threw his gauge down.
XIX.
For him the garb of "hodden gray"
Than tabards had more charms;
He took the part of sleeveless coats
Against the Coats of Arms.
XX.
And although they of Oxford may
Sneer at his want of knowledge,
He had enough of wit at least,
To beat the Heralds' College.
To beat the Heralds College.
XXI.
The growing brotherhood of his kind
He clearly, proudly saw that,
When launching from his lustrous mind,
"A man's a man for a' that!"
II.
Those women, ah, those women! They were white,
Blue, green, and grey,—all hues, save those of nature,
Bony of frame, and dim and dull of sight,
And parlous tall of stature.
III.
I could no more; I veiled my wearied eyes.
I said, "Is this indeed the High Ideal?
If so, give me plain faces, common skies,
The homely and the real."
———♦———
Bret Harte.
The humorous writings of this author are as widely read, and as
keenly appreciated, in England as in the United States, and when the
prose portion of this collection is reached his Sensation Novels
Condensed will be fully considered. In these he has admirably hit off
the peculiarities of style of such varied writers as Miss Braddon,
Victor Hugo, Charles Lever, Lord Lytton, Alexander Dumas, F. Cooper,
Captain Marryat, Charles Dickens, Charlotte Brontë, and Wilkie
Collins; whilst in Lothaw he produced a clever little parody of Lord
Beaconsfield's Lothair.
Bret Harte has ably described both the comic and the pathetic sides
of the wild life of the Californian miners, with which he is thoroughly
familiar; and his best known poems deal with phases of life in that
part of the world, where the Chinese element enters largely into the
population. For convenience of comparison, the original "Heathen
Chinee" is given below, followed by the parodies:—
BRET HARTE.
THE HEATHEN PASS-EE.
Being the Story of a Pass Examination.
BY BRED HARD.
WHICH I wish to remark,
And my language is plain,
That for plots that are dark
And not always in vain,
The Heathen Pass-ee is peculiar,
And the same I would rise to explain.
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