C++ Programming: An Object-Oriented Approach, 1e ISE 1st Edition Behrouz A. Forouzan - eBook PDFinstant download
C++ Programming: An Object-Oriented Approach, 1e ISE 1st Edition Behrouz A. Forouzan - eBook PDFinstant download
https://ebookluna.com/download/c-programming-an-object-oriented-
approach-1e-ise-ebook-pdf/
https://ebookluna.com/product/ebook-pdf-microsoft-visual-c-an-introduction-
to-object-oriented-programming-7th-edition/
https://ebookluna.com/download/foundations-of-computer-science-ebook-pdf/
https://ebookluna.com/download/design-patterns-elements-of-reusable-object-
oriented-software-ebook-pdf/
Data Communications and Networking with TCP/IP Protocol Suite 6th Edition
Behrouz A. Forouzan - eBook PDF
https://ebookluna.com/download/data-communications-and-networking-with-tcp-
ip-protocol-suite-ebook-pdf/
Programming in C 1st Edition - eBook PDF
https://ebookluna.com/download/programming-in-c-ebook-pdf/
Readings from Programming with C++ 1st Edition Kyla Mcmullen - eBook PDF
https://ebookluna.com/download/readings-from-programming-with-c-ebook-
pdf-2/
Readings from Programming with C++ 1st Edition Kyla Mcmullen - eBook PDF
https://ebookluna.com/download/readings-from-programming-with-c-ebook-pdf/
https://ebookluna.com/product/object-relations-theory-and-practice-an-
introduction-ebook-pdf/
https://ebookluna.com/download/principles-of-microeconomics-a-streamlined-
approach-4e-ise-ebook-pdf/
C++ Programming:
An Object-Oriented Approach
Behrouz A. Forouzan
Richard F. Gilberg
C++ PROGRAMMING: AN OBJECT-ORIENTED APPROACH
Published by McGraw-Hill Education, 2 Penn Plaza, New York, NY 10121. Copyright © 2020 by McGraw-Hill Education. All rights
reserved. Printed in the United States of America. No part of this publication may be reproduced or distributed in any form or by any
means, or stored in a database or retrieval system, without the prior written consent of McGraw-Hill Education, including, but not
limited to, in any network or other electronic storage or transmission, or broadcast for distance learning.
Some ancillaries, including electronic and print components, may not be available to customers outside the United States.
1 2 3 4 5 6 7 8 9 LWI 21 20 19
All credits appearing on page or at the end of the book are considered to be an extension of the copyright page.
The Internet addresses listed in the text were accurate at the time of publication. The inclusion of a website does not indicate an endorse-
ment by the authors or McGraw-Hill Education, and McGraw-Hill Education does not guarantee the accuracy of the information presented
at these sites.
mheducation.com/highered
To my wife, Faezeh
Behrouz A. Forouzan
To my wife, Evelyn
Richard F. Gilberg
This page intentionally left blank
Brief Table of Contents
Preface xv
Chapter 1 Introduction to Computers and Programming Languages 1
Chapter 2 Basics of C++ Programming 19
Chapter 3 Expressions and Statements 59
Chapter 4 Selection112
Chapter 5 Repetition158
Chapter 6 Functions208
Chapter 7 User-Defined Types: Classes 273
Chapter 8 Arrays338
Chapter 9 References, Pointers, and Memory Management 380
Chapter 10 Strings443
Chapter 11 Relationships among Classes 496
Chapter 12 Polymorphism and Other Issues 553
Chapter 13 Operator Overloading 597
Chapter 14 Exception Handling 657
Chapter 15 Generic Programming: Templates 693
Chapter 16 Input/Output Streams 716
Chapter 17 Recursion776
Chapter 18 Introduction to Data Structures 813
Chapter 19 Standard Template Library (STL) 852
Chapter 20 Design Patterns Available online
v
Appendixes A-R Available online
Appendix A Unicode
Appendix B Positional Numbering System
Appendix C C++ Expressions and Operators
Appendix D Bitwise Operations
Appendix E Bit Fields
Appendix F Preprocessing
Appendix G Namespaces
Appendix H Ratios
Appendix I Time
Appendix J Lambda Expressions
Appendix K Regular Expressions
Appendix L Smart Pointers
Appendix M Random Number Generation
Appendix N References
Appendix O Move versus Copy
Appendix P A Brief Review of C++ 11
Appendix Q Unified Modeling Language (UML)
Appendix R Bitset
Index 915
Contents
Preface xv
What Is the C++ Language? xv
Why This Book? xv
Appendicesxvi
Instructor Resources xvii
Acknowledgmentsxvii
1
Introduction to Computers and Programming Languages 1
2
Basics of C++ Programming 19
vii
viii Contents
3
Expressions and Statements 59
3.1 Expressions59
3.2 Type Conversion 71
3.3 Order of Evaluation 76
3.4 Overflow and Underflow 81
3.5 Formatting Data 85
3.6 Statements93
3.7 Program Design 98
Key Terms 105
Summary105
Problems106
Programs110
4
Selection 112
5
Repetition 158
5.1 Introduction158
5.2 The while Statement 161
5.3 The for Statement 175
5.4 The do-while Statement 180
5.5 More About Loops 184
5.6 Other Related Statements 188
5.7 Program Design 191
Key Terms 203
Summary203
Problems204
Programs206
Contents ix
6
Functions 208
6.1 Introduction208
6.2 Library Functions 213
6.3 User-Defined Functions 224
6.4 Data Exchange 233
6.5 More About Parameters 244
6.6 Scope and Lifetime 248
6.7 Program Design 256
Key Terms 265
Summary265
Problems266
Programs269
7
User-Defined Types: Classes 273
7.1 Introduction273
7.2 Classes275
7.3 Constructors and Destructors 283
7.4 Instance Members 294
7.5 Static Members 302
7.6 Object-Oriented Programming 311
7.7 Designing Classes 320
Key Terms 332
Summary332
Problems333
Programs335
8
Arrays 338
9
References, Pointers, and Memory Management 380
9.1 References380
9.2 Pointers391
9.3 Arrays and Pointers 405
9.4 Memory Management 414
9.5 Program Design 425
Key Terms 437
Summary437
Problems437
Programs442
10
Strings 443
11
Relationships among Classes 496
11.1 Inheritance496
11.2 Association519
11.3 Dependency528
11.4 Program Design 532
Key Terms 546
Summary546
Problems547
Programs550
12
Polymorphism and Other Issues 553
12.1 Polymorphism553
12.2 Other Issues 567
Contents xi
13
Operator Overloading 597
14
Exception Handling 657
14.1 Introduction657
14.2 Exceptions in Classes 675
14.3 Standard Exception Classes 682
Key Terms 688
Summary688
Problems689
Programs692
15
Generic Programming: Templates 693
16
Input/Output Streams 716
16.1 Introduction716
16.2 Console Streams 720
16.3 File Streams 729
16.4 String Streams 751
16.5 Formatting Data 755
16.6 Program Design 766
Key Terms 773
Summary773
Problems774
Programs774
17
Recursion 776
17.1 Introduction776
17.2 Recursive Sort and Search 792
17.3 Program Design 803
Key Terms 808
Summary808
Problems809
Programs811
18
Introduction to Data Structures 813
18.1 Introduction813
18.2 Singly Linked List 815
18.3 Stacks and Queues 825
18.4 Binary Search Trees 841
Key Terms 849
Summary850
Problems850
Programs851
Contents xiii
19
Standard Template Library (STL) 852
20
Design Patterns Online
20.1 Introduction
20.2 Creational Patterns
20.3 Structural Patterns
20.4 Behavioral Patterns
Key Terms
Summary
Problems
Programs
Online Appendices
Appendix A Unicode
Appendix B Positional Numbering System
Appendix C C++ Expressions and Operators
Appendix D Bitwise Operations
Appendix E Bit Fields
Appendix F Preprocessing
xiv Contents
Appendix G Namespaces
Appendix H Ratios
Appendix I Time
Appendix J Lambda Expressions
Appendix K Regular Expressions
Appendix L Smart Pointers
Appendix M Random Number Generation
Appendix N References
Appendix O Move versus Copy
Appendix P A Brief Review of C++ 11
Appendix Q Unified Modeling Language (UML)
Appendix R Bitset
Index 915
Discovering Diverse Content Through
Random Scribd Documents
Take the Scine of Salt Beefe & so Laye it to the Cutt or sore
For To Heale or Dry Vp a Sore
Take Sallet oyle and Read Lead and boyle it well together and dipe
peces of Lining Cloath in it Keep them for use
For The Ague
Take the Drye shell of a Turtell beat smale & boyled in water while 2
thirds of the water be consumed & drinke of it 2 or 3 times when the
Ague Cometh
Probatum Easte January the 10 1681
The Greene Oyntment that ms Feeld did Vse to make[89]
Jt Cureth all Spraines and Aches Cramps and Scaldings and Cutts
healeth all wounds it doth suple molyfy Ripen & Disolues all Kind of
tumors hot and Cold and it will heale olde Rotten Sores and bites of
Venemos Beasts itch and mangenes and stench bloud it Easeth
Swelling and paines of the head and throate Eyes and Eares Gout
and Seattica and all outward Greefes
Take baye Leaues, Wormwood, Sage, Rue, Cammemoyle, mellelote,
groundsell, Violets, Plantaine, oake buds or Leaues [ ] Suckbery
Pursline, Lettuc, Red colworts, Saint Johns wort, mallows, mullin,
Jsop, Sorrell and Comfrye, yarrow, and Dead Nettles, and Mint,
mugwort, Rose leaues, gather them all in the heat of the Daye, pick
them Cleene but wash them not, Beat them well then take Sheepe
Suett three Pound Picke it Cleene and Shrid it Smale Pound them all
well together, then take 2 quarts of Sallet oyle then work them all
together with your hand till it be a Like then put it in an Earthen Pott
and Couer it Close and Lett it Stand 14 Dayes in a Coule Place then
Sett it ouer a Softe fire and Lett it Boyle 14 howers Stiring it well
then put into it 4 ounces of oyle of Spicke then Straine it through a
Corse Cloath & put it into [ ] Pott and Couer it Cloase and Keepe it
for your vse
For Ye Toothe Ache[90]
Take a Litle Pece of opium as big as a great pinnes head & put it into
the hollow place of the Akeing Tooth & it will giue preasant Ease,
often tryed by me apon many People & neuer fayled
Zerobabel Endecott
Who would know the virtues of the herbs and simples that grew in
the gardens of the Massachusetts Bay? Many herbals have been
compiled and printed, none more enticing than Nicholas Culpepper's
"English Herbals," more truly entitled "The English Physician
Enlarged," and first published in 1653. It had an enormous sale.
Since that year twenty-one different editions have served their day,
the last having been printed at Exeter, N.H., as late as 1824.
Culpepper, the son of a clergyman, was born in London in 1616 and
died when only thirty-eight years old. In that short time, however, he
gained fame as a writer on astrology and medicine. At first
apprenticed to an apothecary, he later set up for himself as a
physician and acquired a high reputation among his patients.
In his catalogue of the simples he premises a few words to the
reader, viz.: "Let a due time be observed (cases of necessity
excepted) in gathering all Simples: for which take these few Rules.
All Roots are of most virtue when the Sap is down in them, viz.
towards the latter end of the summer, or beginning of the spring, for
happily in Winter many of them cannot be found: you may hang up
many of them a drying, by drawing a string through them, and so
keep them a whole year.
"Herbs are to be gathered when they are fullest of juyce, before
they run up to seeds; and if you gather them in a hot sunshine-day,
they will not be so subject to putrifie: the best way to dry them, is in
the Sun, according to Dr. Reason, though not according to Dr.
Tradition: Such Herbs as remain green all the year, or are very full of
juyce, it were a folly to dry at all, but gather them only for present
use, as Houseleek, Scurvy-grass, etc.
"Let flowers be gathered when they are in their prime, in a
sunshine-day, and dryed in the sun. Let seeds be perfectly ripe
before they be gathered.
"Let them be kept in a dry place: for any moysture though it be but
a moist ayr, corrupts them, which if perceived in time, the beames of
the Sun will refresh them again."
Ageratum dryes the brain, helps the green sickness, and profit such
as have a cold or weak Liver: outwardly applyed, it takes away the
hardnesse of the matrix, and fills hollow ulcers with flesh.
Anemone. The juyce snuffed up the nose purgeth the head, it
clenseth filthy ulcers, encreaseth milk in Nurses, and outwardly by
oyntments helps Leprosies.
Asphodel or Daffodil. I know no physicall use of the roots, probably
there is: for I do not believe God created anything of no use.
Balm, outwardly mixed with salt and applied to the neck, helps the
Kings Evil, biting of mad dogs and such as cannot hold their necks
as they should do; inwardly it is an excellent remedy for a cold,
cheers the heart, takes away sorrow, and produces mirth.
Basil gives speedy deliverance to women in travail.
Bedstraw. Stancheth blood: boyled in oyl is good to annoynt a weary
traveller: inwardly it provokes lust.
Borrage, cheers the heart and drooping spirits, helps swooning and
heart qualms.
Briony, both white and black, they purg the flegm and watry
humors, but they trouble the stomack much, they are very good for
dropsies: the white is most in use, and is admirable good for the fits
of the mother; both of them externally used, take away Freckles,
Sun-burning, and Morphew from the face, and clense filthy ulcers: It
is a churlish purge, and being let alone, can do no harm.
Buglosse. Continual eating of it makes the body invincible against
the poyson of Serpents, Toads, Spiders, etc. The rich may make the
Flowers into a conserve, and the herb into a syrup: the poor may
keep it dry: both may keep it as a Jewell.
Burdoc or Clot-bur, helps such as spit blood and matter, bruised and
mixed with salt and applyed to the place, helps the biting of mad
dogs. It expels wind, easeth paines of the teeth, strengthens the
back ... being taken inwardly.
Celondine. The root is manifestly hot and dry, clensing and scouring,
proper for such as have the yellow Jaundice, it opens the
obstructions of the liver, being boiled in White Wine, and if chewed
in the mouth it helps the tooth-ach.
Chamomel is as gallant a medicine against the stone in the bladder
as grows upon the earth. It expels wind, belchings, used in bathes it
helps pains in the sides, gripings and gnawings in the belly.
Chick-weed is cold and moist without any binding, aswages swelling
and comforts the sinews much, and therfore is good for such as are
shrunk up, it helps mangy hands and legs, outwardly applyed in a
pultis.
Cinkfoyl or Five-fingered grass. The root boyled in vinegar is good
against the Shingles, and appeaseth the rage of any fretting sores.
Colts-foot. Admirable for coughs. It is often used taken in a Tobacco-
pipe, being cut and mixed with a little oyl of annis seeds.
Columbines help sore throats and are of a drying, binding quality.
Comfry is excellent for all wounds both internal and externall, for
spitting of blood, Ruptures or Burstness, pains in the Back and
helpeth Hemorrhoyds. The way to use them is to boyle them in
water and drink the decoction.
Cottonweed. Boyled in Ly, it keeps the head from Nits and Lice;
being laid among Cloaths, it Keeps them safe from Moths; taken in a
Tobacco-pipe it helps Coughs of the Lungues, and vehement
headaches.
Dill. It breeds milk in Nurses, staies vomiting, easeth hiccoughs,
aswageth swellings, provoks urin, helps such as are troubled with
the fits of the mother, and digests raw humors.
Dittany, brings away dead children, hastens womens travail, the very
smell of it drives away venemous beasts; it's an admirable remedy
against wounds made with poysoned weapons; it draws out
splinters, broken bones, etc.
Fennel. Encreaseth milk in Nurses, provokes urine, easeth pains in
the Reins, breaks wind, provokes the Terms.
Fleabane. Helps the bitings of venemous beasts. It being burnt, the
smoke of it kills all Gnats and Fleas in the chamber. It is dangerous
for women with child.
Flower-de-luce or water flag, binds, strengthens, stops fluxes of the
belly, a drachm being taken in red wine every morning.
Fumitory helps such as are itchy and scabbed, helps Rickets,
madness, and quartain agues.
Gentian, some call Bald-money, is a notable counter-poyson, it
opens obstructions, helps the bitings of venemous beasts, and mad
dogs, helps digestion, and cleanseth the body of raw humors.
Golden Rod clenseth the Reins, brings away the Gravel; an
admirable herb for wounded people to take inwardly, stops Blood,
etc.
Groundsel helps the Cholick, and pains and gripings in the belly. I
hold it to be a wholsom and harmless purge. Outwardly it easeth
womens breasts that are swollen & inflamed, (or as themselves say)
have gotten an ague in their breasts.
Hellebore. The root of white Hellebore, or sneezwort, being grated &
snuffed up the nose, causeth sneezing, Kills Rats and Mice, being
mixed with their meat. Doctor Bright commends it for such as are
mad through melancholly. If you use it for sneezing, let your head
and neck be wrapped hot for fear of catching cold.
Henbane. Stupifies the senses and therefore not to be taken
inwardly; outwardly applyed to the temple it provokes sleep.
Hops. The young sprouts clense the Blood and cleer the skin, helps
scabs and itch. They are usually boyled and taken as they eat
Sparagus or they may be made into a conserve.
Horehound clenseth the breast and lungs, helps old coughs, easeth
hard labour in child-bearing, brings away the after-birth.
Hysop. Helps Coughs, shortness of Breath, Wheezing, Kills worms in
the body, helps sore throats and noise in the ears.
Knotgrasse helps spitting of blood, stops all fluxes of blood,
gonorrhaea or running of Reins, and is an excellent remedy for hogs
that will not eat their meat.
Lavender. The temples and forehead bathed with the juyce of it, as
also the smell of the herb helps swoonings.
Lavender cotton resists poyson, kills worms.
Lettice. Cools the inflamation of the stomack commonly called heart-
burning, provokes sleep, resists drunkenesse and takes away the ill
effects of it, cools the blood, and breeds milk. It is far wholsommer
eaten boyled than raw.
Liverwort is excellent for inflamations of the Liver and yellow
jaundice.
Lovage cleers the sight, takes away redness and Freckles from the
Face.
Lungwort helps infirmities of the lungs, coughs and shortness of
breath.
Mallows. They are profitable in the stingings of Bees, Wasps, etc.
Inwardly they resist poyson and provoke to stool....
Man Drakes. Fit for no vulgar use, but only to be used in cooling
oyntments.
Marigolds. The leaves loosen the belly and the juyce held in the
mouth helps the toothach.
Marshmallowes are meanly hot, of a digestion softening nature, ease
pains, help bloody fluxes, the stone and gravell; being bruised and
well boiled in milk, and the milk drunk is a gallant remedy for the
gripings of the belly, and the bloddy flux.
Mint. Provokes hunger, is wholesome for the stomack, stays
vomiting, helps sore heads in children. Hinders conception and is
naught for wounded people, they say by reason of an antipathy
between it and Iron.
Mugwort, an herb appropriate to the foeminine sex; it brings down
the terms, brings away birth and afterbirth, easeth pains in the
matrix.
Mullin. Stops fluxes and cures hoarsenesse and such as are broken
winded; the leaves worn in the shooes provokes the Terms,
(especially in such Virgins as never had them) but they must be
worn next their feet.
Nettles. The juyce stops bleeding; they provoke lust exceedingly;
help that troublesome cough that women call Chin-cough. Boyl them
in white wine.
Onions, are extreamly hurtfull for cholerick people, they breed but
little nourishment, and that little is naught; they are bad meat, yet
good physick for flegmatick people, they are opening and provoke
urine, and the terms, if cold be the cause obstructing; bruised and
outwardly applyed they cure the bitings of mad dogs; roasted and
applied they help Boils, and Aposthumes; raw they take the fire out
of burnings; but ordinarily eaten, they cause headach, spoil the
sight, dul the senses and fill the body full of wind.
Orpine for Quinsie in the throat, for which disease it is inferior to
none.
Penyroyal. Strengthens women's backs, provokes the Terms, staies
vomiting, strengthens the brain (yea the very smell of it), breaks
wind, and helps the Vertigo.
Pimpernal, male and foemale. They are of such drawing quality that
they draw thorns and splinters out of the flesh, amend the sight, and
clense Ulcers.
Plantain. A little bit of the root being eaten, instantly staies pains in
the head, even to admirations.
Purslain. Cools hot stomacks, admirable for one that hath his teeth
on edge by eating sowr apples, helps inward inflamations.
Reubarb. It gently purgeth Choller from the stomack & liver, opens
stoppings, withstands the Dropsie, and Hypocondriack Melancholly.
If your body be any strong you may take two drams of it at a time
being sliced thin and steeped all night in white Wine, in the morning
strain it out and drink the white Wine.
Rosemary. Helps stuffings in the head, helps the memory, expels
wind.
Rue, or Herb of Grace. Consumes the seed and is an enemy to
generation, helps difficulty of breathing. It strengthens the heart
exceedingly. There is no better herb than this in Pestilential times.
Sage. It staies abortion, it causeth fruitfullness, it is singular good
for the brain, helps stitches and pains in the sides.
St. Johns Wort. It is as gallant a wound-herb as any is, either given
inwardly or outwardly applied to the wound. It helps the Falling
sickness. Palsie, Cramps and Aches in the joynts.
Savory. Winter savory and summer savory both expell wind gallantly,
and that (they say) is the reason why they are boyled with Pease
and Beans and other such windy things; 'tis a good fashion and pitty
it should be left.
Senna. It cheers the sences, opens obstructions, takes away dulness
of the sight, preserves youth, helps deafness (if purging will help it),
resists resolution of the Nerves, scabs, itch and falling sickness. The
windiness of it is corrected with a little Ginger.
Solomon's Seal. Stamped and boyled in Wine it speedily helps (being
drunk, I mean, for it will not do the deed by looking upon it) all
broken bones, it is of an incredible virtue that way; it quickly takes
away the black and blew marks of blows, being bruised and applyed
to the place.
Sorrel cutteth tough humors, cools the brain, liver and stomack, and
provokes apetite.
Southern-wood or Boy's love, is hot and dry in the third degree,
resists poyson, kills worms, provokes lust; outwardly in plaisters it
dissolves cold swellings, makes hair grow; take not above half a
drachm at a time in powder.
Spinage. I never read any physicall virtues of it.
Spleenwort is excellent good for melancholy people, helps the
stranguary and breaks the Stone in the bladder. Boyl it and drink the
decoction; but because a little boyling will carry away the strength of
it in vapours, let it boyl but very little, and let it stand close stopped
till it be cold before you strain it out; this is the generall rule for all
Simples of this nature.
Spurge. Better let alone that taken inwardly; hair anoynted with the
juyce of it will fall off: it kills fish, being mixed with anything they will
eat, outwardly it takes away Freckles and sunburning.
Sweet-Majorum is an excellent remedy for cold diseases in the brain,
being only smelled to; it helps such as are given to much sighing,
and easeth pains in the belly....
Tansie. The very smell of it staies abortion or miscarriages in
women. The root eaten, is a singular remedy for the Gout; the rich
may bestow the cost to preserve it.
Toad-flax clenses the Reins and Bladder, outwardly it takes away
yellowness and deformity of the skin.
Toads-stools. Whether these be roots or not it matters not much; for
my part I know little need of them, either in food or Physick.
Tyme. Helps coughs and shortness of breath, brings away dead
children and the after birth, helps Sciatica, repels wind in any part of
the Body, resisteth fearfullness and melancholy.
Valerian, white and red, comforts the heart and stirs up lust.
Vervain. A great clenser. Made into an oyntment it is a soveraign
remedy for old headache. It clears the skin and causeth a lovely
color.
Wake-Robins or Cuckow-pints. I know no great good they doe
inwardly taken, unlesse to play the rogue withall, or make sport;
outwardly applyed they take off Scurf, Morphew, or Freckles from
the face, cleer the skin, and cease the pain of the Gout.
Water-Lilies. The roots stop lust. I never dived so deep to find any
other virtue.
Wood Bettony helps the falling sickness, and all headaches comming
of cold, procures apetite, helps sour belchings, helps cramps and
convulsions, helps the Gout, Kills worms, helps bruises, and
cleanseth women after their labor.
Wormwood helps weakness of the stomack, clenses choller, kills
worms, helps surfets, cleers the sight, clenses the Blood, and
secures cloaths from moths.
Yarrow. An healing herb for wounds. Some say the juice snuffed up
the nose, causeth it to bleed, whence it was called Nose-bleed.
CHAPTER XIV
Crimes and Punishments
The men who controlled the affairs of the Massachusetts Bay Colony
at the time of its founding, determined not only that the churches,
but that the government of the commonwealth they were creating,
should be based strictly upon the teachings of the Bible. The charter
provided that the Governor, Deputy Governor and Assistants might
hold courts "for the better ordering of affairs," and so for the first
ten years, the Court of Assistants, as it was styled, exercised the
entire judicial powers of the colony. Its members were known as the
magistrates. During this period but few laws or orders were passed.
When complaints were made, the court, upon a hearing, determined
whether the conduct of the accused had been such as in their
opinion to deserve punishment, and if it had been, then what
punishment should be inflicted. This was done without any regard to
English precedents. There was no defined criminal code, and what
constituted a crime and what its punishment, was entirely within the
discretion of the court. If in doubt as to what should be considered
an offence, the Bible was looked to for guidance. The General Court
itself, from time to time, when in doubt, propounded questions to
the ministers or elders, which they answered in writing, much as the
Attorney General or the Supreme Judicial Court at the present day
may advise.
But the people soon became alarmed at the extent of personal
discretion exercised by the magistrates and so, in 1635, the freemen
demanded a code of written laws and a committee composed of
magistrates and ministers was appointed to draw up the same. It
does not appear that much was accomplished although Winthrop
records that Mr. Cotton of the committee, reported "a copy of Moses
his judicials, compiled in an exact method, which was taken into
further consideration till the next general court." The "judicials,"
however, never were adopted. In 1639 another committee was
directed to peruse all the "models" which had been or should be
presented, "draw them up into one body," and send copies to the
several towns. This was done. In October, 1641, action was taken
which led to a definite and acceptable result. Rev. Nathaniel Ward of
Ipswich, who had been educated for the law and had practiced in
the courts of England, was requested to furnish a copy of the
liberties, etc. and nineteen transcriptions were sent to the several
towns in the Colony. Two months later at the session of the General
Court, this body of laws was voted to stand in force.
This code, known as "the Body of Liberties," comprised about one
hundred laws, civil and criminal. The civil laws were far in advance of
the laws of England at that time, and in substance were
incorporated in every subsequent codification of the laws of the
Colony. Some of them are in force today, and others form the basis
of existing laws. The criminal laws were taken principally from the
Mosaic code and although many of them may seem harsh and cruel
yet, as a whole, they were much milder than the criminal laws of
England at that time. No reference was made to the common law of
England. All legislation in regard to offences was based upon the
Bible, and marginal references to book, chapter and verse were
supplied to guide future action. This Code served its intended
purpose well and remained in force until the arrival of the Province
charter in 1692 save during the short period of the Andros
administration.
The judiciary system of the Colony therefore provided for the
following courts:
First, the Great and General Court which possessed legislative
powers and limited appellate authority from the Court of Assistants.
Second, the Court of Assistants—a Supreme Court or Court of
Appeals that had exclusive jurisdiction in all criminal cases extending
"to life, limb, or banishment," jurisdiction in civil cases in which the
damages amounted to more than £100., and appellate jurisdiction
from the County Quarterly Courts.
Third, County or Inferior Quarterly Courts that had jurisdiction in all
cases and matters not reserved to the Court of Assistants or
conferred upon commissioners of small causes. These courts also
laid out highways, licensed ordinarys, saw that an able ministry was
supported, and had general control of probate matters, and in 1664
were authorized to admit freemen.
The juries were made judges of the law and the fact and when upon
a trial there was insufficient evidence to convict, juries were
authorized to find that there were strong grounds of suspicion, and
accordingly sentence afterwards was given by the Court. In order to
facilitate court proceedings an excellent law was passed in 1656
which authorized the fining of a person 20 shillings an hour for any
time occupied in his plea in excess of one hour.
John Winthrop with his company arrived at Salem in June, 1630, and
ten weeks later the first court in the Colony was held at
Charlestown. The maintenance of the ministry was the first concern,
to be followed by an order regulating the wages of carpenters,
bricklayers, thatchers and other building trades. Thomas Morton at
"Merry Mount" was not forgotten for he was to be sent for "by
processe," and a memorandum is entered to obtain for the next
Court an estimate "of the charges that the Governor hathe beene att
in entertaineing several publique persons since his landing in Newe
England."
At the second meeting of the Court of Assistants, three of the
magistrates were fined a noble apiece for being late at Court and
three weeks later Sir Richard Saltonstall, because of absence, was
fined four bushels of malt. It was at this Court that Thomas Morton
was ordered "sett into the bilbowes" and afterwards sent prisoner
into England by the ship called the Gifte. His goods were ordered
seized and his house burnt to the ground "in the sight of the Indians
for their satisfaction, for many wrongs he hath done them from time
to time." Several towns were christened the names by which they
are still known, and those who had ventured to plant themselves at
Aggawam, now Ipswich, were commanded "forthwith to come
away."
Aside from Morton's offences at Mount Wollaston, nothing of a
criminal nature seems to have been brought to the attention of the
Court until its third session on September 28th. To be sure the
Governor had been consulted by the magistrates of the Colony at
Plymouth concerning the fate of one John Billington of Plymouth
who had murdered his companion John New-Comin. Billington was
hanged, and "so the land was purged from blood."
Unless murder may have been committed at an earlier date by a
member of some crew of unruly fishermen along the coast, this was
the first murder committed in the English settlements about the
Massachusetts Bay. But unfortunately it was not the last. Walter
Bagnell's murder in 1632 was followed by that of John Hobbey and
Mary Schooley in 1637, and the next year Dorothy, the wife of John
Talbie, was hanged for the "unnatural and untimely death of her
daughter Difficult Talby." The daughter's christian name at once
suggests unending possibilities.
In the winter of 1646 a case of infanticide was discovered in Boston.
A daughter of Richard Martin had come up from Casco Bay to enter
into service. She concealed her condition well and only when
accused by a prying midwife was search made and the fact
discovered. She was brought before a jury and caused to touch the
face of the murdered infant, whereupon the blood came fresh into it.
She then confessed. Governor Winthrop relates that at her death,
one morning in March, "after she was turned off and had hung a
space, she spake, and asked what they did mean to do. Then some
stepped up, and turned the knot of the rope backward, and then she
soon died."
This curious "ordeal of touch" had also been applied the previous
year at Agamenticus on the Maine Coast when the wife of one
Cornish, whose bruised body had been found in the river, with her
suspected paramour, was subjected to this supreme test. It is
recorded that the body bled freely when they approached which
caused her to confess not only murder but adultery, both of which
crimes were punishable by death. She was hanged.
Probably the last instance in Massachusetts when this "ordeal of
touch" was inflicted, occurred in a little old meetinghouse in the
parish of West Boxford, in Essex County, one July day in the year
1769. The previous December, Jonathan Ames had married Ruth,
the eldest daughter of the widow Ruth Perley. He took his bride to
the house of his parents, some five miles distant, and lived there. As
in some instances since that time, the mother-in-law soon proved to
be not in full sympathy with the young bride living under her roof. In
May a child was born and a few days after the young mother died
under circumstances which caused suspicion in the neighborhood.
The body was hastily buried, none of the neighbors were invited to
be present, and soon, about the parish, were flying rumors, which a
month later crystalized into a direct accusation and a coroner's
inquest. It was held in the meetinghouse that formerly stood in the
sandy pasture near the old cemetery. The Salem newspaper records
that the building was "much thronged by a promiscuous multitude of
people."
The court opened with prayer, the coroners then gave the jury "their
solemn charge" and then the entire company proceeded, "with
decency and good order," over the winding roadway up the hill to
the burying ground, where for five weeks had lain the body of the
young bride. During the exhumation the crowd surged around the
grave so eagerly that they were only held in check by the promise
that all should have an opportunity to inspect the remains. The
autopsy at the meetinghouse resulted in a report from the jury that
Ruth Ames "came to her death by Felony (that is to say by poison)
given to her by a Person or Persons to us unknown which murder is
against the Peace of our said Lord the King, his Crown and Dignity."
When it was found that no sufficient evidence could be adduced to
hold either the husband of the murdered girl, or his mother, then
was demanded an exhibition of that almost forgotten "ordeal of
touch." The body was laid upon a table with a sheet over it and
Jonathan and his mother were invited to prove their innocence by
this gruesome test. The superstition required the suspected party to
touch the neck of the deceased with the index finger of the left
hand. Blood would immediately follow the touch of the guilty hand,
the whiteness of the sheet of course making it plainly visible. Both
mother and son refused to accept the ordeal. Whether or no they
believed in the superstition, we never shall learn. Fear may have
held them motionless before the accusing eyes. Certainly the
nervous tension at such a time must have been very great.
The Gazette states that the examination gave great occasion to
conclude that they were concerned in the poisoning, and a week
after the inquest they were arrested and confined in the ancient jail
in Salem where the persons accused of witchcraft were imprisoned
many years before. They were indicted and brought to trial. John
Adams, afterwards President of the United States, then thirty-four
years of age, was counsel for the accused. Jonathan Ames turned
King's evidence against his mother. It was midnight before the
counsel began their arguments and two of the three judges were
explicit in summing up the evidence, that there was "a violent
presumption" of guilt, but at nine o'clock in the morning the jury
came in and rendered a verdict of "not guilty." May the result be
attributed to John Adams's eloquence and logic or to the vagaries of
our jury system?
But we are a long way from the third session of the Court of
Assistants held September 28, 1630. Not until this time did the law
begin to reach out for its victims. John Goulworth was ordered
whipped and afterwards set in the stocks for felony, not named. One
other was whipped for a like offence and two Salem men, one of
whom has given us an honored line of descendants, were sentenced
to sit in the stocks for four hours, for being accessory thereunto.
Richard Clough's stock of strong water was ordered seized upon,
because of his selling a great quantity thereof to servants, thereby
causing much disorder. No person was to permit any Indian to use a
gun under a penalty of £10. Indian corn must not be sold or traded
with Indians or sent away without the limits of the Patent. Thomas
Gray was enjoined to remove himself out of the Patent before the
end of March, and the oath was administered to John Woodbury, the
newly elected constable from Salem.
At the next session William Clark, who had been brought to book at
a previous Court for overcharging Mr. Baker for cloth, now was
prohibited cohabitation and frequent keeping company with Mrs.
Freeman and accordingly was placed under bonds for a future
appearance. Three years later this offender became one of the
twelve who went to Agawam and founded the present town of
Ipswich, and ten years later still another William Clark of Ipswich
was sentenced to be whipped "for spying into the chamber of his
master and mistress and reporting what he saw."
November 30, 1630, Sir Richard Saltonstall was fined £5, for
whipping two persons without the presence of another assistant, as
required by law; while Bartholomew Hill was whipped for stealing a
loaf of bread, and John Baker suffered the same penalty for shooting
at wild fowl on the Sabbath Day. And so continues the record of
intermingled punishment and legislation.
The struggling communities that had planted themselves along the
shores of the Massachusetts Bay largely had refused to conform to
the rules and ordinances of the English Church. If the records of the
Quarterly Courts are studied it will be seen that the settlers also
failed to obey the rules and laws laid down by the magistrates of
their own choosing. To be sure there were large numbers of
indentured servants and the rough fishermen along the coastline
have always been unruly. Much also may be attributed to the
primitive and congested life in the new settlements. Simple houses
of but few rooms and accommodating large families, surely are not
conducive to gentle speech or modesty of manners nor to a strict
morality. The craving desire for land holding, and the poorly defined
and easily removed bounds naturally led to frequent actions for
trespass, assault, defamation, slander and debt. The magistrates
exercised unusual care in watching over the religious welfare of the
people and in providing for the ministry. It has been stated
frequently that in the olden times everyone went to church. The size
of the meetinghouses, the isolated location of many of the houses,
the necessary care of the numerous young children, and the
interesting side lights on the manners of the times which appear in
the court papers, all go to prove that the statement must not be
taken literally. Absence from meeting, breaking the Sabbath,
carrying a burden on the Lord's Day, condemning the church,
condemning the ministry, scandalous falling out on the Lord's Day,
slandering the church, and other misdemeanors of a similar
character were frequent. A number of years before the Quakers
appeared in the Colony it was no unusual matter for some one to
disturb the congregation by public speeches either in opposition to
the minister or to some one present. Zaccheus Gould, a very large
landholder, in Topsfield, in the time of the singing the psalm one
Sabbath afternoon sat himself down upon the end of the table about
which the minister and the chief of the people sat, with his hat on
his head and his back toward all the rest of them that sat about the
table and although spoken to altered not his posture; and the
following Sabbath after the congregation was dismissed he haranged
the people and ended by calling goodman Cummings a "proud,
probmatical, base, beggarly, pick thank fellow." Of course the matter
was ventilated in the Salem Court.
At the February 29, 1648, session of the Salem Court eight cases
were tried. A Gloucester man was fined for cursing, saying, "There
are the brethren, the divil scald them." Four servants were fined for
breaking the Sabbath by hunting and killing a raccoon in the time of
the public exercise to the disturbance of the congregation. If the
animal had taken to the deep woods instead of staying near the
meetinghouse the servants might have had their fun without paying
for it. A Marblehead man was fined for sailing his boat loaded with
hay from Gloucester harbor, on the Lord's Day, when the people
were going to the morning exercise. Nicholas Pinion, who worked at
the Saugus Iron works, was presented for absence from meeting
four Lord's Days together, spending his time drinking, and profanely;
and Nicholas Russell of the same locality was fined for spending a
great part of one Lord's day with Pinion in drinking strong water and
cursing and swearing. He also had been spending much time with
Pinion's wife, causing jealousy in the family; and the lady in
question, having broken her bond for good behavior, was ordered to
be severely whipped. The other cases were for swearing, in which
the above named lady was included; for being disguised with drink;
and for living from his wife. And so the Court ended.
A curious instance of Sabbath breaking occurred at Hampton in
1646. Aquila Chase and his wife and David Wheeler were presented
at Ipswich Court for gathering peas on the Sabbath. They were
admonished. The family tradition has it that Aquila returned from
sea that morning and his wife, wishing to supply a delicacy for
dinner, fell into grave error in thus pandering to his unsanctified
appetite.
While we are discussing matters relating to the Sabbath and to the
church it may be well to allude to the ministry. It has been shown
that the first concern of the Court of Assistants was a provision for
the housing and care of the ministry. Much the larger number were
godly men actuated by a sincere desire to serve their people and to
preserve their souls. But many of them were men, not saints, and so
possessed of men's passions and weaknesses. While all exercised
more or less influence over the communities in which they lived, yet
the tangible result must have been negative in some instances. Take
for example the small inland town of Topsfield, settled about 1639.
Rev. William Knight rendered mission service for a short time early in
the 40's and a dozen years later Rev. William Perkins moved into
town from Gloucester. He had been one of the twelve who settled
the town of Ipswich in 1633; afterwards he lived at Weymouth
where he was selectman, representative to the General Court,
captain of the local military company and also a member of the
Ancient and Honorable Artillery Company. He also was schoolmaster
in 1650 and the next year appears at Gloucester as minister, from
which place he soon drifted into Court. Cross suits for defamation
and slander were soon followed by the presentment of Mrs. Holgrave
for unbecoming speeches against Mr. Perkins, saying "if it were not
for the law, shee would never come to the meeting, the teacher was
so dead ... affirming that the teacher was fitter to be a ladys
chamberman, than to be in the pulpit."
Mr. Perkins removed to Topsfield in 1656. The next year he tried to
collect his salary by legal process and again in 1660. Three years
later a church was organized and their first minister was settled. He
was a Scotchman—Rev. Thomas Gilbert. Soon Mr. Perkins was
summoned to Salem Court where Edward Richards declared in court
before Mr. Perkins' face, that the latter being asked whither he was
going, said, to hell, for aught he knew. Of course Mr. Perkins denied
the testimony. Later in the same year he was fined for excessive
drinking, it appearing that he stopped at the Malden ordinary and
called for sack. But goody Hill told him that he had had too much
already and Master Perkins replied, "If you think I am drunk let me
see if I can not goe," and he went tottering about the kitchen and
said the house was so full of pots and kettles that he could hardly
go.
But what of Mr. Gilbert. Three years after his settlement Mr. Perkins
appeared in Court and presented a complaint in twenty-seven
particulars "that in public prayers and sermons, at several times he
uttered speeches of a high nature reproachful and scandalous to the
King's majestie & his government." He was summoned into Court
and bound over in £1000 to the next General Court where eventually
he was solemnly admonished publicly in open court by the Honored
Governor. With twenty-seven particulars, could a Scotchman restrain
his tongue? Mr. Gilbert could not, and shortly Mr. Perkins brought
two complaints of defamation of character. Mr. Gilbert also soon
developed a love of wine for it appears by the court papers that one
sacrament day, when the wine had been brought from the
meetinghouse and poured into the golden cup, Mr. Gilbert drank
most of it with the usual result, for he sank down in his chair, forgot
to give thanks, and sang a Psalm with lisping utterance. He was late
at the afternoon service, so that many went away before he came
and Thomas Baker testified "I perceived that he was distempered in
his head, for he did repeat many things many times over; in his
prayer he lisped and when he had done to prayer, he went to singing
& read the Psalm so that it could not be well understood and when
he had done singing he went to prayer again, and when he had
done he was going to sing again, but being desired to forbear used
these expressions: I bless God I find a great deal of comfort in it;
and coming out of the pulpit he said to the people I give you notice I
will preach among you no more." His faithful wife testified that his
conduct was due to a distemper that came upon him sometimes
when fasting and in rainy weather. The following April he was again
before the Court charged with many reproachful and reviling
speeches for which he was found guilty and sharply admonished and
plainly told "that if he shall find himself unable to demean himself
more soberly and christianly, as became his office, they do think it
more convenient for him to surcease from the exercise of any public
employment." The stubborn Scot refused to submit and affixing a
defiant paper to the meetinghouse door he deserted his office for
three successive Sabbaths, when his exasperated people petitioned
the Court to be freed from such "an intollerable burden" and so the
relation ceased but not until further suits and counter suits had been
tried for defamation, slander, and threatened assault.
His successor was Rev. Jeremiah Hobart, a Harvard graduate, who
preached for a while at Beverly and found difficulty in collecting his
salary. He remained at Topsfield eight years and during that time
became a familiar figure at the County Courts, because of non-
payment of salary, for cursing and swearing, and for a damaging suit
for slander exhibiting much testimony discreditable to him. Even his
brother ministers and the churches were not free from his
reproachful and scandalous speeches so he at last was dismissed
and two years later was followed by a godly man, Rev. Joseph Capen
of Dorchester, who enjoyed a peaceful pastorate of nearly forty
years.
The severe penalties of the English legal code were much modified
in the Bay Colony but public executions continued until the middle of
the nineteenth century and were usually more or less a public
holiday. The condemned was taken in a cart through the streets to
the gallows. Not infrequently a sermon was preached by some
minister on the Sunday previous to the execution and speeches from
the gallows always thrilled the crowd. The execution of pirates drew
many people from some distance. Several Rhode Island murderers
were executed and afterwards hung in chains. The gibbeting of the
bodies of executed persons does not seem to have been general.[91]
While executions by burning took place in Europe, and Salem is
sometimes accused of having burned witches at the stake, there are
but two instances, so far as known, when this extreme penalty was
inflicted in Massachusetts. The first occurred in 1681 when Maria,
the negro servant of Joshua Lamb of Roxbury willfully set fire to her
master's house, and was sentenced by the Court to be burned alive.
The same year Jack, a negro servant, while searching for food set
fire to the house of Lieut. William Clark of Northampton. He was
condemned to be hanged and then his body was burnt to ashes in
the same fire with Maria, the negress. The second instance of
inflicting the penalty of burning alive occurred at Cambridge in the
fall of 1755, when Phillis, a negro slave of Capt. John Codman of
Charlestown, was so executed. She poisoned her master to death by
using arsenic. A male slave Mark, who was an accomplice was
hanged and the body afterwards suspended in chains beside the
Charlestown highway where it remained for nearly twenty years,[92]
Why was the woman deemed more culpable than the man in such
instances of poisoning? The old English law so provided and at a
later date, under Henry VIII, poisoners were boiled alive in oil. The
last execution in Massachusetts for the crime of arson occurred on
Salem Neck in 1821 when Stephen Merrill Clark, a Newburyport lad,
fifteen years of age, paid the penalty. He had set fire to a barn in the
night time endangering a dwelling house.
Ten years before the adoption of the "Body of Liberties," adultery
became a capital crime in accordance with the Mosaic law. The first
case was one John Dawe, for enticing an Indian woman. He was
severely whipped, and at the next session of the General Court, the
death penalty was ordered for the future. When we consider the
freedom of manners of the time, the clothing worn by the women,
the limited sleeping accommodations and the ignorance of the
servants, it is remarkable that the penalty was inflicted in so few
cases. The records are full of cases of fornication, uncleanness,
wanton dalliance, unseemly behaviour, unchaste words, and living
away from wife, and the more so during the earlier years. Possibly,
the juries may have thought the penalty too severe and found the
parties guilty only, of "adulterous behavior," which happened in
Boston in 1645. This followed a case of the previous year where a
young woman had married an old man out of pique and then
received the attentions of a young man of eighteen. They both were
hanged.
The Court Records of the County of Essex always must have a
curious interest because of the witchcraft cases. But the first
execution in Massachusetts for witchcraft did not take place in
Salem, but in Boston, in 1648, when Margaret Jones of Charlestown
was hanged. It was shown that she had a malignant touch, that she
produced deafness, practiced physic, and that her harmless
medicines produced violent effects. She foretold things which came
to pass and lied at her trial and railed at the jury. The midwives
found that mysterious excrescence upon her, and for all these crimes
she was hanged, and as a proof from Heaven of the justice of her
taking off there was a great tempest in Connecticut on the very hour
she was executed.
But Essex County court records show several witchcraft cases during
the first twenty-five years following the settlement. In September,
1650, Henry Pease of Marblehead, deposed that he heard Peter
Pitford of Marblehead say that goodwife James was a witch and that
he saw her in a boat at sea in the likeness of a cat, and that his
garden fruits did not prosper so long as he lived near that woman,
and that said Pitford often called her "Jesable." Erasmus James, her
husband, promptly brought suit for slander, and at the next Court
another suit for defamation by which he received 50s. damages. The
court records show that this Jane James had previously made her
appearance, for in June, 1639, Mr. Anthony Thatcher complained
that she took things from his house. She and her husband were
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
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.
ebookluna.com