100% found this document useful (8 votes)
341 views

Programming Logic and Design Comprehensive 6th Edition Joyce Farrell download pdf

Joyce

Uploaded by

refuseatito
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (8 votes)
341 views

Programming Logic and Design Comprehensive 6th Edition Joyce Farrell download pdf

Joyce

Uploaded by

refuseatito
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 81

Download the full version of the ebook at

https://ebookultra.com

Programming Logic and Design Comprehensive


6th Edition Joyce Farrell

https://ebookultra.com/download/programming-logic-
and-design-comprehensive-6th-edition-joyce-
farrell/

Explore and download more ebook at https://ebookultra.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Java Programming 7th Edition Joyce Farrell

https://ebookultra.com/download/java-programming-7th-edition-joyce-
farrell/

ebookultra.com

Java Programming 8th Edition Joyce Farrell

https://ebookultra.com/download/java-programming-8th-edition-joyce-
farrell/

ebookultra.com

Java Programs to Accompany Programming Logic and Design


7th Edition Jo Ann Smith

https://ebookultra.com/download/java-programs-to-accompany-
programming-logic-and-design-7th-edition-jo-ann-smith/

ebookultra.com

Microsoft Visual Basic Programs to Accompany Programming


Logic and Design 3rd Edition Jo Ann Smith

https://ebookultra.com/download/microsoft-visual-basic-programs-to-
accompany-programming-logic-and-design-3rd-edition-jo-ann-smith/

ebookultra.com
Computer programming for teens 1st Edition Mary E. Farrell

https://ebookultra.com/download/computer-programming-for-teens-1st-
edition-mary-e-farrell/

ebookultra.com

Programming and Problem Solving with C Comprehensive


Comprehensive Edition Nell B. Dale

https://ebookultra.com/download/programming-and-problem-solving-with-
c-comprehensive-comprehensive-edition-nell-b-dale/

ebookultra.com

Comprehensive Gynecology 6th Edition Gretchen M Lentz

https://ebookultra.com/download/comprehensive-gynecology-6th-edition-
gretchen-m-lentz/

ebookultra.com

The Haskell Road to Logic Maths and Programming 1st


Edition Kees Doets

https://ebookultra.com/download/the-haskell-road-to-logic-maths-and-
programming-1st-edition-kees-doets/

ebookultra.com

Logic and Computer Design Fundamentals Third Edition M.


Morris Mano

https://ebookultra.com/download/logic-and-computer-design-
fundamentals-third-edition-m-morris-mano/

ebookultra.com
Programming Logic and Design Comprehensive 6th
Edition Joyce Farrell Digital Instant Download
Author(s): Joyce Farrell
ISBN(s): 0538744766
Edition: 6
File Details: PDF, 18.81 MB
Year: 2010
Language: english
PROGRAMMING LOGIC
AND DESIGN
COMPREHENSIVE
This page intentionally left blank
SIXTH EDITION

PROGRAMMING LOGIC
AND DESIGN
COMPREHENSIVE

J O Y C E FA R R E L L

Australia • Brazil • Japan • Korea • Mexico • Singapore • Spain • United Kingdom • United States
This is an electronic version of the print textbook. Due to electronic rights restrictions, some third party content may
be suppressed. Editorial review has deemed that any suppressed content does not materially affect the overall
learning experience. The publisher reserves the right to remove content from this title at any time if subsequent rights
restrictions require it. For valuable information on pricing, previous editions, changes to current editions, and
alternate formats, please visit www.cengage.com/highered to search by ISBN#, author, title, or keyword for
materials in your areas of interest.
Programming Logic and Design, © 2011 Course Technology, Cengage Learning
Comprehensive, Sixth Edition
ALL RIGHTS RESERVED. No part of this work covered by the copyright
Joyce Farrell
herein may be reproduced, transmitted, stored or used in any form or by
Executive Editor: Marie Lee any means—graphic, electronic, or mechanical, including but not limited
to photocopying, recording, scanning, digitizing, taping, Web distribution,
Acquisitions Editor: Amy Jollymore
information networks, or information storage and retrieval systems, except
Managing Editor: Tricia Coia as permitted under Section 107 or 108 of the 1976 United States Copyright
Developmental Editor: Dan Seiter Act—without the prior written permission of the publisher.
Content Project Manager: Jennifer Feltri
For product information and technology assistance, contact us at
Editorial Assistant: Zina Kresin Cengage Learning Customer & Sales Support, 1-800-354-9706
Marketing Manager: Bryant Chrzan For permission to use material from this text or product,
Art Director: Marissa Falco submit all requests online at cengage.com/permissions
Further permissions questions can be emailed to
Text Designer: Shawn Girsberger permissionrequest@cengage.com
Cover Designer: Cabbage Design Company
Cover Image: iStockphoto Library of Congress Control Number: 2009938501
Print Buyer: Julio Esperas
ISBN-13: 978-0-5387-4476-8
Copy Editor: Michael Beckett
ISBN-10: 0-538-74476-6
Proofreader: Vicki Zimmer
Indexer: Alexandra Nickerson Course Technology
Compositor: Integra 20 Channel Center Street
Boston, MA 02210
USA

Some of the product names and company names used in this book have
been used for identification purposes only and may be trademarks or
registered trademarks of their respective manufacturers and sellers.

Course Technology, a part of Cengage Learning, reserves the right to revise


this publication and make changes from time to time in its content without
notice.

Cengage Learning is a leading provider of customized learning solutions with


office locations around the globe, including Singapore, the United Kingdom,
Australia, Mexico, Brazil, and Japan. Locate your local office at:
www.cengage.com/global

Cengage Learning products are represented in Canada by


Nelson Education, Ltd.

To learn more about Course Technology, visit


www.cengage.com/coursetechnology

Purchase any of our products at your local college store or at our preferred
online store www.ichapters.com

Printed in Canada
1 2 3 4 5 6 7 14 13 12 11 10
Brief Contents
v

Pref ace . . . . . . . . . . . . . . . . . xvi


CHAPTER 1 An Overview of Computers and Programming . . 1
CHAP TER 2 Wo r k in g wi t h Data, Creati ng Modul es,
an d Des ig ni ng Hi gh- Qual i ty Programs . . . . 41
CHAP TER 3 U n der s t an di ng Structure . . . . . . . . . . 92
CHAP TER 4 M ak in g De ci si o ns . . . . . . . . . . . . 133
CHAP TER 5 Lo o pin g . . . . . . . . . . . . . . . . 184
CHAP TER 6 Ar r ays . . . . . . . . . . . . . . . . . 228
CHAP TER 7 F ile Han dli ng and Appl i cati ons . . . . . . 276
CHAPTER 8 Advan ced A rray Concepts, I ndex ed Fi l es,
an d Lin k ed Li st s . . . . . . . . . . . . . 325
CHAPTER 9 Advan ced Mo dul ari zati on Techni ques . . . . 370
CHAPTER 10 Object -Or ient ed Programmi ng . . . . . . . 426
CHAPTER 11 M o re Obje ct - Ori ented Programmi ng
Co n cept s . . . . . . . . . . . . . . . . 469
CHAPTER 12 E ven t -Dr iven GUI Programmi ng,
M u lt it h readi ng , and Ani mati on . . . . . . . 515
CHAPTER 13 Sys t em M o del i ng wi th the UML . . . . . . 550
CHAPTER 14 U s in g Relat i o nal Databases . . . . . . . . 585
APPEN DIX A U n der s t andi ng Numberi ng Sy stems
an d Co m put er Codes . . . . . . . . . . . 637
APPEN DIX B F lo w ch ar t Sy m bol s . . . . . . . . . . . 646
BRIEF CONTENTS

APPEN DIX C St r u ct u res . . . . . . . . . . . . . . . 647


APPEN DIX D So lvin g Dif f icul t Structuri ng Probl ems . . . 649
APPEN DIX E Creat in g Pr int Char ts . . . . . . . . . . 658
vi APPEN DIX F Tw o Var iat io ns o n the Basi c Structures—
c a s e an d d o-while . . . . . . . . . . 660
Glo s s ar y . . . . . . . . . . . . . . . . 666
In dex . . . . . . . . . . . . . . . . . 681
Contents
vii

Pref ace . . . . . . . . . . . . . . . . . xvi

CHAP TER 1 An Over view o f Computers


an d Pro g r am m i ng . . . . . . . . . . . . . 1
Understanding Computer Systems. . . . . . . . . . . . . . 2
Understanding Simple Program Logic . . . . . . . . . . . . 5
Understanding the Program Development Cycle . . . . . . . 8
Understanding the Problem . . . . . . . . . . . . . . . . 8
Planning the Logic . . . . . . . . . . . . . . . . . . . . 10
Coding the Program . . . . . . . . . . . . . . . . . . . 10
Using Software to Translate the Program
into Machine Language . . . . . . . . . . . . . . . . . 11
Testing the Program . . . . . . . . . . . . . . . . . . . 12
Putting the Program into Production . . . . . . . . . . . . 14
Maintaining the Program . . . . . . . . . . . . . . . . . 14
Using Pseudocode Statements and Flowchart Symbols . . . . 15
Writing Pseudocode . . . . . . . . . . . . . . . . . . . 15
Drawing Flowcharts . . . . . . . . . . . . . . . . . . . 17
Repeating Instructions . . . . . . . . . . . . . . . . . . 18
Using a Sentinel Value to End a Program . . . . . . . . . . . 20
Understanding Programming and User Environments . . . . . 23
Understanding Programming Environments . . . . . . . . . 23
Understanding User Environments . . . . . . . . . . . . . 25
Understanding the Evolution of Programming Models . . . . . 27
Chapter Summary . . . . . . . . . . . . . . . . . . . . . 28
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . 29
Review Questions . . . . . . . . . . . . . . . . . . . . . 32
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . 37

CHAP TER 2 Wo r k in g w i t h Data, Creati ng Modul es,


an d Des igni ng Hi gh- Qual i ty Programs . . . . . . 41
Declaring and Using Variables and Constants . . . . . . . . . 42
CONTENTS

Working with Variables . . . . . . . . . . . . . . . . . . 42


Naming Variables . . . . . . . . . . . . . . . . . . . . 44
Understanding Unnamed, Literal Constants
and their Data Types . . . . . . . . . . . . . . . . . . 45
Understanding the Data Types of Variables . . . . . . . . . 46
viii
Declaring Named Constants. . . . . . . . . . . . . . . . 47
Assigning Values to Variables . . . . . . . . . . . . . . . . 48
Performing Arithmetic Operations . . . . . . . . . . . . . 49
Understanding the Advantages of Modularization . . . . . . . 52
Modularization Provides Abstraction . . . . . . . . . . . . 53
Modularization Allows Multiple Programmers
to Work on a Problem . . . . . . . . . . . . . . . . . . 54
Modularization Allows You to Reuse Your Work . . . . . . . 54
Modularizing a Program . . . . . . . . . . . . . . . . . . 55
Declaring Variables and Constants
within Modules . . . . . . . . . . . . . . . . . . . . . 59
Understanding the Most Common Configuration
for Mainline Logic . . . . . . . . . . . . . . . . . . . . 61
Creating Hierarchy Charts . . . . . . . . . . . . . . . . . 66
Features of Good Program Design . . . . . . . . . . . . . . 68
Using Program Comments . . . . . . . . . . . . . . . . 69
Choosing Identifiers . . . . . . . . . . . . . . . . . . . 71
Designing Clear Statements. . . . . . . . . . . . . . . . 72
Writing Clear Prompts and Echoing Input . . . . . . . . . . 74
Maintaining Good Programming Habits . . . . . . . . . . . 76
Chapter Summary . . . . . . . . . . . . . . . . . . . . . 77
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . 78
Review Questions . . . . . . . . . . . . . . . . . . . . . 82
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . 86

CHAPTER 3 U n der s t an ding St ructure . . . . . . . . . . 92


Understanding Unstructured Spaghetti Code . . . . . . . . . 93
Understanding the Three Basic Structures . . . . . . . . . . 95
Using a Priming Input to Structure a Program . . . . . . . 103
Understanding the Reasons for Structure . . . . . . . . . 110
Recognizing Structure . . . . . . . . . . . . . . . . . . 111
Structuring and Modularizing Unstructured Logic . . . . . . 115
Chapter Summary . . . . . . . . . . . . . . . . . . . . 121
Key Terms . . . . . . . . . . . . . . . . . . . . . . . 122
Review Questions . . . . . . . . . . . . . . . . . . . . 123
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 127
CONTENTS

CHAP TER 4 M ak in g Deci si o ns . . . . . . . . . . . . 133


Evaluating Boolean Expressions to Make Comparisons . . . 134
Using Relational Comparison Operators . . . . . . . . . . 137
Avoiding a Common Error with Relational Operators . . . . 141
Understanding AND Logic . . . . . . . . . . . . . . . . 141
Nesting AND Decisions for Efficiency . . . . . . . . . . 144 ix
Using the AND Operator . . . . . . . . . . . . . . . . 146
Avoiding Common Errors in an AND Selection. . . . . . . 148
Understanding OR Logic . . . . . . . . . . . . . . . . . 150
Writing OR Decisions for Efficiency . . . . . . . . . . . 152
Using the OR Operator . . . . . . . . . . . . . . . . . 153
Avoiding Common Errors in an OR Selection . . . . . . . 155
Making Selections within Ranges . . . . . . . . . . . . . 159
Avoiding Common Errors When Using Range Checks . . . 162
Understanding Precedence When Combining
AND and OR Operators . . . . . . . . . . . . . . . . . 166
Chapter Summary . . . . . . . . . . . . . . . . . . . . 169
Key Terms . . . . . . . . . . . . . . . . . . . . . . . 170
Review Questions . . . . . . . . . . . . . . . . . . . . 171
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 177

CHAP TER 5 Lo o pin g . . . . . . . . . . . . . . . . 184


Understanding the Advantages of Looping . . . . . . . . . 185
Using a Loop Control Variable. . . . . . . . . . . . . . . 186
Using a Definite Loop with a Counter . . . . . . . . . . 187
Using an Indefinite Loop with a Sentinel Value . . . . . . 188
Understanding the Loop in a Program’s Mainline Logic. . . 190
Nested Loops . . . . . . . . . . . . . . . . . . . . . . 192
Avoiding Common Loop Mistakes . . . . . . . . . . . . . 196
Mistake: Neglecting to Initialize the
Loop Control Variable . . . . . . . . . . . . . . . . . 197
Mistake: Neglecting to Alter the
Loop Control Variable . . . . . . . . . . . . . . . . . 198
Mistake: Using the Wrong Comparison with the
Loop Control Variable . . . . . . . . . . . . . . . . . 200
Mistake: Including Statements Inside the Loop
that Belong Outside the Loop . . . . . . . . . . . . . 201
Using a for Loop . . . . . . . . . . . . . . . . . . . . 206
Common Loop Applications . . . . . . . . . . . . . . . . 208
Using a Loop to Accumulate Totals . . . . . . . . . . . 208
Using a Loop to Validate Data . . . . . . . . . . . . . . 211
Limiting a Reprompting Loop . . . . . . . . . . . . . . 213
CONTENTS

Validating a Data Type . . . . . . . . . . . . . . . . . 215


Validating Reasonableness and Consistency of Data . . . . 216
Chapter Summary . . . . . . . . . . . . . . . . . . . . 217
Key Terms . . . . . . . . . . . . . . . . . . . . . . . 218
Review Questions . . . . . . . . . . . . . . . . . . . . 219
x
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 223

CHAPTER 6 Ar r ays . . . . . . . . . . . . . . . . . 228


Understanding Arrays and How They Occupy
Computer Memory . . . . . . . . . . . . . . . . . . . 229
How Arrays Occupy Computer Memory . . . . . . . . . . 229
Manipulating an Array to Replace Nested Decisions . . . . . 232
Using Constants with Arrays . . . . . . . . . . . . . . . 240
Using a Constant as the Size of an Array . . . . . . . . . 240
Using Constants as Array Element Values . . . . . . . . 241
Using a Constant as an Array Subscript . . . . . . . . . 241
Searching an Array . . . . . . . . . . . . . . . . . . . 242
Using Parallel Arrays . . . . . . . . . . . . . . . . . . . 246
Improving Search Efficiency. . . . . . . . . . . . . . . 251
Searching an Array for a Range Match . . . . . . . . . . . 254
Remaining within Array Bounds . . . . . . . . . . . . . . 258
Using a for Loop to Process Arrays . . . . . . . . . . . 261
Chapter Summary . . . . . . . . . . . . . . . . . . . . 262
Key Terms . . . . . . . . . . . . . . . . . . . . . . . 263
Review Questions . . . . . . . . . . . . . . . . . . . . 264
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 268

CHAPTER 7 F ile Han dlin g and Appl i cati ons . . . . . . 276


Understanding Computer Files . . . . . . . . . . . . . . 277
Organizing Files . . . . . . . . . . . . . . . . . . . . 278
Understanding the Data Hierarchy . . . . . . . . . . . . . 279
Performing File Operations . . . . . . . . . . . . . . . . 280
Declaring a File . . . . . . . . . . . . . . . . . . . . 280
Opening a File . . . . . . . . . . . . . . . . . . . . . 281
Reading Data From a File . . . . . . . . . . . . . . . . 281
Writing Data to a File . . . . . . . . . . . . . . . . . . 283
Closing a File . . . . . . . . . . . . . . . . . . . . . 283
A Program that Performs File Operations . . . . . . . . . 283
Understanding Sequential Files and Control Break Logic . . . 286
Understanding Control Break Logic . . . . . . . . . . . 287
Merging Sequential Files . . . . . . . . . . . . . . . . . 293
Master and Transaction File Processing . . . . . . . . . . 303
CONTENTS

Random Access Files . . . . . . . . . . . . . . . . . . 311


Chapter Summary . . . . . . . . . . . . . . . . . . . . 313
Key Terms . . . . . . . . . . . . . . . . . . . . . . . 314
Review Questions . . . . . . . . . . . . . . . . . . . . 316
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 320
xi
CHAP TER 8 Advan ced A rray Concepts, I ndex ed Fi l es,
an d Lin k ed Li st s . . . . . . . . . . . . . 325
Understanding the Need for Sorting Records . . . . . . . . 326
Understanding How to Swap Two Values . . . . . . . . . . 327
Using a Bubble Sort . . . . . . . . . . . . . . . . . . . 329
Sorting a List of Variable Size . . . . . . . . . . . . . . 337
Refining the Bubble Sort to Reduce Unnecessary
Comparisons. . . . . . . . . . . . . . . . . . . . . 341
Refining the Bubble Sort to Eliminate Unnecessary
Passes . . . . . . . . . . . . . . . . . . . . . . . 343
Other Sorts . . . . . . . . . . . . . . . . . . . . . . 345
Using Multidimensional Arrays . . . . . . . . . . . . . . 345
Using Indexed Files and Linked Lists. . . . . . . . . . . . 352
Using Indexed Files . . . . . . . . . . . . . . . . . . 352
Using Linked Lists . . . . . . . . . . . . . . . . . . . 354
Chapter Summary . . . . . . . . . . . . . . . . . . . . 357
Key Terms . . . . . . . . . . . . . . . . . . . . . . . 358
Review Questions . . . . . . . . . . . . . . . . . . . . 359
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 364

CHAPTER 9 Advan ced Mo dul ari zati on Techni ques . . . . 370


Using Methods with No Parameters . . . . . . . . . . . . 371
Creating Methods that Require a Single Parameter . . . . . 374
Creating Methods that Require Multiple Parameters . . . . . 379
Creating Methods that Return a Value . . . . . . . . . . . 381
Using an IPO Chart . . . . . . . . . . . . . . . . . . . 387
Passing an Array to a Method . . . . . . . . . . . . . . . 388
Overloading Methods. . . . . . . . . . . . . . . . . . . 395
Avoiding Ambiguous Methods . . . . . . . . . . . . . . . 398
Using Predefined Methods . . . . . . . . . . . . . . . . 401
Method Design Issues: Implementation Hiding, Cohesion,
and Coupling . . . . . . . . . . . . . . . . . . . . . 403
Understanding Implementation Hiding . . . . . . . . . . 403
Increasing Cohesion . . . . . . . . . . . . . . . . . . 404
Reducing Coupling . . . . . . . . . . . . . . . . . . . 405
Understanding Recursion . . . . . . . . . . . . . . . . . 407
CONTENTS

Chapter Summary . . . . . . . . . . . . . . . . . . . . 411


Key Terms . . . . . . . . . . . . . . . . . . . . . . . 413
Review Questions . . . . . . . . . . . . . . . . . . . . 415
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 419

xii CHAPTER 10 Object -Or ient ed Programmi ng . . . . . . . 426


Principles of Object-Oriented Programming . . . . . . . . . 427
Classes and Objects . . . . . . . . . . . . . . . . . . 427
Polymorphism . . . . . . . . . . . . . . . . . . . . . 430
Inheritance . . . . . . . . . . . . . . . . . . . . . . 431
Encapsulation . . . . . . . . . . . . . . . . . . . . . 432
Defining Classes and Creating Class Diagrams . . . . . . . 433
Creating Class Diagrams . . . . . . . . . . . . . . . . 435
The Set Methods . . . . . . . . . . . . . . . . . . . . 438
The Get Methods. . . . . . . . . . . . . . . . . . . . 440
Work Methods . . . . . . . . . . . . . . . . . . . . . 440
Understanding Public and Private Access . . . . . . . . . 442
Organizing Classes . . . . . . . . . . . . . . . . . . . 446
Understanding Instance Methods . . . . . . . . . . . . . 447
Understanding Static Methods . . . . . . . . . . . . . . 453
Using Objects . . . . . . . . . . . . . . . . . . . . . . 455
Chapter Summary . . . . . . . . . . . . . . . . . . . . 459
Key Terms . . . . . . . . . . . . . . . . . . . . . . . 460
Review Questions . . . . . . . . . . . . . . . . . . . . 462
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 466

CHAPTER 11 M o re Object - Ori ented Programmi ng


Co n cept s . . . . . . . . . . . . . . . . 469
An Introduction to Constructors . . . . . . . . . . . . . . 470
Constructors with Parameters . . . . . . . . . . . . . . 473
Overloading Class Methods and Constructors. . . . . . . 473
Understanding Destructors . . . . . . . . . . . . . . . . 476
Understanding Composition . . . . . . . . . . . . . . . . 478
Understanding Inheritance . . . . . . . . . . . . . . . . 479
Understanding Inheritance Terminology . . . . . . . . . 481
Accessing Private Members of a Parent Class . . . . . . 484
Using Inheritance to Achieve Good Software Design . . . . 490
One Example of Using Predefined Classes:
Creating GUI Objects . . . . . . . . . . . . . . . . . . 491
Understanding Exception Handling. . . . . . . . . . . . . 493
Drawbacks to Traditional Error-Handling Techniques . . . . 493
The Object-Oriented Exception Handling Model . . . . . . 495
CONTENTS

Using Built-in Exceptions and Creating Your Own


Exceptions. . . . . . . . . . . . . . . . . . . . . . 498
Reviewing the Advantages of Object-Oriented
Programming . . . . . . . . . . . . . . . . . . . . . 499
Chapter Summary . . . . . . . . . . . . . . . . . . . . 500
Key Terms . . . . . . . . . . . . . . . . . . . . . . . 502 xiii
Review Questions . . . . . . . . . . . . . . . . . . . . 503
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 508

CHAPTER 12 E ven t -Dr iven GUI Programmi ng,


M u lt it h readi ng , and Ani mati on . . . . . . . 515
Understanding Event-Driven Programming . . . . . . . . . 516
User-Initiated Actions and GUI Components. . . . . . . . . 519
Designing Graphical User Interfaces . . . . . . . . . . . . 523
The Interface Should Be Natural and Predictable . . . . . 523
The Interface Should Be Attractive, Easy to Read, and
Nondistracting . . . . . . . . . . . . . . . . . . . . 524
To Some Extent, It’s Helpful If the User Can
Customize Your Applications. . . . . . . . . . . . . . 524
The Program Should Be Forgiving . . . . . . . . . . . . 525
The GUI Is Only a Means to an End . . . . . . . . . . . 525
The Steps to Developing an Event-Driven Application . . . . 526
Creating Storyboards. . . . . . . . . . . . . . . . . . 527
Defining the Storyboard’s Objects in
an Object Dictionary . . . . . . . . . . . . . . . . . 527
Defining Connections Between the User Screens . . . . . 528
Planning the Logic . . . . . . . . . . . . . . . . . . . 529
Understanding Multithreading . . . . . . . . . . . . . . . 535
Creating Animation. . . . . . . . . . . . . . . . . . . . 537
Chapter Summary . . . . . . . . . . . . . . . . . . . . 540
Key Terms . . . . . . . . . . . . . . . . . . . . . . . 541
Review Questions . . . . . . . . . . . . . . . . . . . . 542
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 546

CHAPTER 13 Sys t em M o del i ng wi th the UML . . . . . . 550


Understanding the Need for System Modeling . . . . . . . 551
What is the UML? . . . . . . . . . . . . . . . . . . . . 552
Using Use Case Diagrams . . . . . . . . . . . . . . . . 554
Using Class and Object Diagrams . . . . . . . . . . . . . 560
Using Sequence and Communication Diagrams . . . . . . . 564
Using State Machine Diagrams . . . . . . . . . . . . . . 566
Using Activity Diagrams . . . . . . . . . . . . . . . . . 567
CONTENTS

Using Component, Deployment, and Profile Diagrams . . . . 570


Diagramming Exception Handling . . . . . . . . . . . . . 572
Deciding When to Use the UML and Which
UML Diagrams to Use . . . . . . . . . . . . . . . . . 573
Chapter Summary . . . . . . . . . . . . . . . . . . . . 575
xiv
Key Terms . . . . . . . . . . . . . . . . . . . . . . . 576
Review Questions . . . . . . . . . . . . . . . . . . . . 578
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 582

CHAPTER 14 U s in g Relat i o nal Databases . . . . . . . . 585


Understanding Relational Database Fundamentals . . . . . . 586
Creating Databases and Table Descriptions . . . . . . . . 588
Identifying Primary Keys . . . . . . . . . . . . . . . . . 591
Understanding Database Structure Notation . . . . . . . . 594
Adding, Deleting, Updating, and Sorting Records
within Tables. . . . . . . . . . . . . . . . . . . . . . 595
Sorting the Records in a Table . . . . . . . . . . . . . 596
Creating Queries. . . . . . . . . . . . . . . . . . . . . 596
Understanding Relationships Between Tables . . . . . . . . 600
Understanding One-to-Many Relationships . . . . . . . . 600
Understanding Many-to-Many Relationships . . . . . . . . 601
Understanding One-to-One Relationships . . . . . . . . . 606
Recognizing Poor Table Design . . . . . . . . . . . . . . 607
Understanding Anomalies, Normal Forms,
and Normalization . . . . . . . . . . . . . . . . . . . 609
First Normal Form . . . . . . . . . . . . . . . . . . . 610
Second Normal Form . . . . . . . . . . . . . . . . . . 612
Third Normal Form . . . . . . . . . . . . . . . . . . . 615
Database Performance and Security Issues . . . . . . . . 618
Providing Data Integrity. . . . . . . . . . . . . . . . . 618
Recovering Lost Data . . . . . . . . . . . . . . . . . 619
Avoiding Concurrent Update Problems . . . . . . . . . . 619
Providing Authentication and Permissions . . . . . . . . 620
Providing Encryption . . . . . . . . . . . . . . . . . . 620
Chapter Summary . . . . . . . . . . . . . . . . . . . . 621
Key Terms . . . . . . . . . . . . . . . . . . . . . . . 622
Review Questions . . . . . . . . . . . . . . . . . . . . 625
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 630
CONTENTS

APPEN DIX A U n der s t andi ng Numberi ng Sy stems


an d Co m put er Codes . . . . . . . . . . . 637

APPEN DIX B F lo w ch ar t Sy m bol s . . . . . . . . . . . 646


xv
APPEN DIX C St r u ct u res . . . . . . . . . . . . . . . 647

APPEN DIX D So lvin g Di f f i cul t Structuri ng Probl ems . . . 649

APPEN DIX E Creat in g Pri nt Char ts . . . . . . . . . . 658

APPEN DIX F Tw o Var iati o ns on the Basi c Structures—


c a s e an d do-while . . . . . . . . . . 660

Glo s s ar y . . . . . . . . . . . . . . . . 666

In dex . . . . . . . . . . . . . . . . . 681
Preface
xvi

Programming Logic and Design, Comprehensive, Sixth Edition


provides the beginning programmer with a guide to developing
structured program logic. This textbook assumes no programming
language experience. The writing is nontechnical and emphasizes
good programming practices. The examples are business examples;
they do not assume mathematical background beyond high school
business math. Additionally, the examples illustrate one or two major
points; they do not contain so many features that students become
lost following irrelevant and extraneous details.
The examples in Programming Logic and Design have been created to
provide students with a sound background in logic, no matter what
programming languages they eventually use to write programs. This
book can be used in a stand-alone logic course that students take as a
prerequisite to a programming course, or as a companion book to an
introductory programming text using any programming language.

Organization and Coverage


Programming Logic and Design, Comprehensive, Sixth Edition
introduces students to programming concepts and enforces good
style and logical thinking. General programming concepts are intro-
duced in Chapter 1. Chapter 2 discusses using data and introduces
two important concepts: modularization and creating high-quality
programs. It is important to emphasize these topics early so that
students start thinking in a modular way and concentrate on making
their programs efficient, robust, easy to read, and easy to maintain.
Chapter 3 covers the key concepts of structure, including what
structure is, how to recognize it, and most importantly, the advan-
tages to writing structured programs. This early overview gives
students a solid foundation for thinking in a structured way before
they have to manage the details of the structures.
Chapters 4, 5, and 6 explore the intricacies of decision making, looping,
and array manipulation. Chapter 7 provides details of file handling so
students can create programs that handle a significant amount of data.
P R E FA C E

In Chapters 8 and 9, students learn more advanced techniques in


array manipulation and modularization. Chapters 10 and 11 provide
a thorough, yet accessible, introduction to concepts and terminology
used in object-oriented programming. Students learn about classes,
objects, instance and static class members, constructors, destructors,
inheritance, and the advantages provided by object-oriented thinking.
xvii
Chapter 12 explores additional object-oriented programming issues:
event-driven GUI programming, multithreading, and animation.
Chapter 13 discusses system design issues and details the features of
the Unified Modeling Language. Chapter 14 is a thorough introduc-
tion to the most important database concepts business programmers
should understand.
The first three appendices give students summaries of numbering
systems, flowchart symbols, and structures. Additional appendices
allow students to gain extra experience with structuring large
unstructured programs, creating print charts, and understanding
posttest loops and case structures.
Programming Logic and Design combines text explanation with
flowcharts and pseudocode examples to provide students with
alternative means of expressing structured logic. Numerous detailed,
full-program exercises at the end of each chapter illustrate the
concepts explained within the chapter, and reinforce understanding
and retention of the material presented.
Programming Logic and Design distinguishes itself from other
programming logic books in the following ways:
• It is written and designed to be non-language specific. The logic
used in this book can be applied to any programming language.
• The examples are everyday business examples; no special knowledge
of mathematics, accounting, or other disciplines is assumed.
• The concept of structure is covered earlier than in many other
texts. Students are exposed to structure naturally, so they will
automatically create properly designed programs.
• Text explanation is interspersed with flowcharts and pseudocode
so students can become comfortable with both logic development
tools and understand their interrelationship. Screen shots of
running programs also are included, providing students with a
clear and concrete image of the programs’ execution.
• Complex programs are built through the use of complete business
examples. Students see how an application is constructed from
start to finish instead of studying only segments of programs.
P R E FA C E

Features
This edition of the text includes many features to help students
become better programmers and understand the big picture in
program development. Many new features have been added, and the
popular features from the first five editions are still included.
xviii
Features maintained from previous editions include:
OBJECTIVES Each chapter begins with a list of objectives so the
student knows the topics that will be presented in the chapter. In
addition to providing a quick reference to topics covered, this feature
provides a useful study aid.
FLOWCHARTS This book has plenty of figures and illustrations,
including flowcharts, which provide the reader with a visual learning
experience, rather than one that involves simply studying text. You
can see examples of flowcharts beginning in Chapter 1.
PSEUDOCODE This book also includes numerous examples of
pseudocode, which illustrate correct usage of the programming logic
and design concepts being taught.
NOTES These tips provide additional information—for
example, another location in the book that expands on a topic,
or a common error to watch out for.
THE DON’T DO IT ICON It is sometimes illustrative to
show an example of how NOT to do something—for
example, having a dead code path in a program. However,
students do not always read carefully and sometimes use logic similar
to that shown in what is intended to be a “bad” example. When the
instructor is critical, the frustrated student says, “But that’s how they
did it in the book!” Therefore, although the text will continue to
describe bad examples, and the captions for the related figures will
mention that they are bad examples, the book also includes a “Don’t
Do It” icon near the offending section of logic. This icon provides a
visual jolt to the student, emphasizing that particular figures are NOT
to be emulated.
THE TWO TRUTHS AND A LIE QUIZ This quiz appears after each
chapter section, with answers provided. The quiz contains three
statements based on the preceding section of text—two true and one
false. Over the years, students have requested answers to problems,
but we have hesitated to distribute them in case instructors want
to use problems as assignments or test questions. These true-false
mini-quizzes provide students with immediate feedback as they read,
without “giving away” answers to the multiple-choice questions and
programming problems later in the chapter.
P R E FA C E

GAME ZONE EXERCISES These exercises are included at the


end of each chapter. Students can create games as an
additional entertaining way to understand key concepts
presented in the chapter.
CHAPTER SUMMARIES Following each chapter is a summary that
recaps the programming concepts and techniques covered in the xix
chapter. This feature provides a concise means for students to review
and check their understanding of the main points in each chapter.
KEY TERMS Each chapter lists key terms and their definitions; the list
appears in the order the terms are encountered in the chapter. Along
with the chapter summary, the list of key terms provides a snapshot
overview of a chapter’s main ideas. A glossary at the end of the book lists
all the key terms in alphabetical order, along with working definitions.
DEBUGGING EXERCISES Because examining programs
critically and closely is a crucial programming skill, each
chapter includes a “Find the Bugs” section in which program-
ming examples are presented that contain syntax errors and logical
errors for the student to find and correct.
REVIEW QUESTIONS Twenty multiple-choice review questions
appear at the end of every chapter to allow students to test their
comprehension of the major ideas and techniques presented.
EXERCISES Multiple end-of-chapter flowcharting and pseudocoding
exercises are included so students have more opportunities to practice
concepts as they learn them. These exercises increase in difficulty and
are designed to allow students to explore logical programming concepts.
Each exercise can be completed using flowcharts, pseudocode, or both.
In addition, instructors can assign the exercises as programming prob-
lems to be coded and executed in a particular programming language.
ESSAY QUESTIONS Each chapter contains an “Up For
Discussion” section in which questions present personal and
ethical issues that programmers must consider. These ques-
tions can be used for written assignments or as a starting point for
classroom discussions.

New to this Edition!


VIDEO LESSONS Each chapter is accompanied by two or
more video lessons that help explain an important chapter
concept. A listing of the videos provided can be found on
the inside back cover of this text. These videos are designed
and narrated by the author and are available for free with a new book.
(They can also be purchased separately at iChapters.com.)
P R E FA C E

If you have a new book, it will contain a URL and PIN code. Once you
go to this URL and enter your PIN code, follow the prompts to locate
the videos for this text. If you are a user of an online course cartridge,
such as BlackBoard, WebCT, or Angel, you will also have access to
these videos through that platform.
xx INCREASED EMPHASIS ON MODULARITY From the second chapter,
students are encouraged to write code in concise, easily manageable,
and reusable modules. Instructors have found that modularization
is a technique that should be encouraged early to instill good habits
and a clearer understanding of structure. This edition explains
modularization early, using global variables instead of local passed
and returned values, and saves parameter passing for later when the
student has become more adept.
CLEARER EXPLANATIONS This edition has been rewritten to
provide clearer, simpler explanations that are appropriate for the
beginning programming student. As a result of the new, cleaner
approach, the length of the book has been reduced.
NEW APPENDICES FOR EASY REFERENCE New appendices
have been added that cover numbering systems, flowchart symbols,
and structures.
DECREASED EMPHASIS ON CONTROL BREAKS Professional
programmers should understand control break logic, but creating
such logic is not as common a task as it was years ago. Therefore, the
topic is still covered briefly as part of the file-handling chapter, but
with reduced emphasis from previous editions of the book.

Instructor Resources
The following supplemental materials are available when this
book is used in a classroom setting. All of the instructor resources
available with this book are provided to the instructor on a single
CD-ROM.
ELECTRONIC INSTRUCTOR’S MANUAL The Instructor’s Manual
that accompanies this textbook provides additional instructional
material to assist in class preparation, including items such as Sample
Syllabi, Chapter Outlines, Technical Notes, Lecture Notes, Quick
Quizzes, Teaching Tips, Discussion Topics, and Key Terms.
EXAMVIEW® This textbook is accompanied by ExamView, a powerful
testing software package that allows instructors to create and admin-
ister printed, computer (LAN-based), and Internet exams. ExamView
includes hundreds of questions that correspond to the topics covered in
this text, enabling students to generate detailed study guides that include
page references for further review. The computer-based and Internet
P R E FA C E

testing components allow students to take exams at their computers,


and save the instructor time by grading each exam automatically.
POWERPOINT PRESENTATIONS This book comes with Microsoft
PowerPoint© slides for each chapter. These are included as a teach-
ing aid for classroom presentation, to make available to students
on your network for chapter review, or to be printed for classroom xxi
distribution. Instructors can add their own slides for additional topics
they introduce to the class.
SOLUTIONS Suggested solutions to Review Questions and Exercises
are provided on the Instructor Resources CD and may also be found
on the Course Technology Web site at www.cengage.com/coursetech-
nology. The solutions are password protected.
DISTANCE LEARNING Course Technology offers WebCT© and
Blackboard© courses for this text to provide the most complete and
dynamic learning experience possible. When you add online content
to one of your courses, you’re adding a lot: automated tests, topic
reviews, quick quizzes, and additional case projects with solutions.
For more information on how to bring distance learning to your
course, contact your Course Technology sales representative.

Software Options
You have the option to bundle software with your text! Please contact
your Course Technology sales representative for more information.
MICROSOFT ® OFFICE VISIO ® PROFESSIONAL Visio is a
diagramming program that helps users create flowcharts and
diagrams easily while working through the text, enabling them to
visualize concepts and learn more effectively.
VISUAL LOGIC ™ This simple but powerful tool teaches program-
ming logic and design without traditional high-level programming
language syntax. Visual Logic uses flowcharts to explain essential
programming concepts, including variables, input, assignment, out-
put, conditions, loops, procedures, graphics, arrays, and files. It also
has the ability to interpret and execute flowcharts, providing students
with immediate and accurate feedback about their solutions. By exe-
cuting student solutions, Visual Logic combines the power of a high-
level language with the ease and simplicity of flowcharts.

Acknowledgments
I would like to thank all of the people who helped to make this book
a reality, especially Dan Seiter, Development Editor, whose hard work
and attention to detail have made this a high-quality textbook. I have
P R E FA C E

worked with Dan for many years now, and he is indispensable in pro-
ducing accurate and approachable technical instruction. Thanks also
to Tricia Coia, Managing Editor; Amy Jollymore, Acquisitions Editor;
Jennifer Feltri, Content Project Manager; and Green Pen QA, Technical
Editors. I am grateful to be able to work with so many fine people who
are dedicated to producing high-quality instructional materials.
xxii
I am grateful to the many reviewers who provided helpful and
insightful comments during the development of this book, including
Gilbert Armour, Virginia Western Community College; John Buerck,
Saint Louis University; Karen Cummings, McLennan Community
College; Clara Groeper, Illinois Central College; and Jeff Hedrington,
Colorado Technical University.
Thanks, too, to my husband, Geoff, and our daughters, Andrea and
Audrey, for their support. This book, as were all its previous editions,
is dedicated to them.
–Joyce Farrell
P R E FA C E

About the Inside Front Cover


Check out our interviews with recent graduates who are now
working in the IT field. One is featured on the inside front cover
of this book. If you know people who recently landed a job in IT,
we’d like to interview them too! Send your suggestions via e-mail to
Amy Jollymore, Acquisitions Editor, at Amy.Jollymore@Cengage.com. xxiii
This page intentionally left blank
An Overview of
CHAPTER 1
Computers and
Programming

In this chapter, you will learn about:

 Computer systems
 Simple program logic
 The steps involved in the program development cycle
 Pseudocode statements and flowchart symbols
 Using a sentinel value to end a program
 Programming and user environments
 The evolution of programming models
CHAPTER 1 An Overview of Computers and Programming

Understanding Computer Systems


A computer system is a combination of all the components required
to process and store data using a computer. Every computer system
is composed of multiple pieces of hardware and software.

2 • Hardware is the equipment, or the physical devices, associated


with a computer. For example, keyboards, mice, speakers, and
printers are all hardware. The devices are manufactured differently
for large mainframe computers, laptops, and even smaller comput-
ers that are embedded into products such as cars and thermostats,
but the types of operations performed by different-sized comput-
ers are very similar. When you think of a computer, you often think
of its physical components first, but for a computer to be useful it
needs more than devices; a computer needs to be given instruc-
tions. Just as your stereo equipment does not do much until you
provide music, computer hardware needs instructions that control
how and when data items are input, how they are processed, and
the form in which they are output or stored.
• Software is computer instructions that tell the hardware what to do.
Software is programs: instructions written by programmers. You can
buy prewritten programs that are stored on a disk or that you down-
load from the Web. For example, businesses use word-processing
and accounting programs, and casual computer users enjoy pro-
grams that play music and games. Alternatively, you can write your
own programs. When you write software instructions, you are
programming. This book focuses on the programming process.

Software can be classified as application software or system software.


Application software comprises all the programs you apply to a task—
word-processing programs, spreadsheets, payroll and inventory programs,
and even games. System software comprises the programs that you use
to manage your computer, including operating systems such as Windows,
Linux, or UNIX. This book focuses on the logic used to write application software pro-
grams, although many of the concepts apply to both types of software.

Together, computer hardware and software accomplish three major


operations in most programs:
• Input—Data items enter the computer system and are put into mem-
ory, where they can be processed. Hardware devices that perform input
operations include keyboards and mice. Data items include all the text,
numbers, and other information that are processed by a computer.

In business, much of the data used is facts and figures about such entities as
products, customers, and personnel. However, data can also be items such
as the choices a player makes in a game or the notes required by a music-
playing program.
Understanding Computer Systems

Many computer professionals distinguish between the terms data, which


describes items that are input, and information, which describes data items
that have been processed and sent to a device where people can read and
interpret them. For example, your name, Social Security number, and
hourly pay rate are data items when they are input to a program, but the
same items are information after they have been processed and output on your
paycheck. 3

• Processing—Processing data items may involve organizing or sorting


them, checking them for accuracy, or performing calculations with
them. The hardware component that performs these types of tasks is
the central processing unit, or CPU.
• Output—After data items have been processed, the resulting infor-
mation usually is sent to a printer, monitor, or some other output
device so people can view, interpret, and use the results.

Some people consider storage as a fourth major computer operation.


Instead of sending output to a device such as a printer, monitor, or speaker
where a person can interpret it, you sometimes store output on storage
devices, such as a disk or flash media. People cannot read data directly
from these storage devices, but the devices hold information for later
retrieval. When you send output to a storage device, sometimes it is used later as input
for another program.

You write computer instructions in a computer programming The instruc-


language, such as Visual Basic, C#, C++, or Java. Just as some tions you write
people speak English and others speak Japanese, programmers also using a pro-
gramming
write programs in different languages. Some programmers work
language are
exclusively in one language, whereas others know several program- called program code;
ming languages and use the one that is best suited to the task when you write instruc-
at hand. tions, you are coding the
program.
Every programming language has rules governing its word usage and
punctuation. These rules are called the language’s syntax. If you ask,
“How the geet too store do I?” in English, most people can figure
out what you probably mean, even though you have not used proper
English syntax—you have mixed up the word order, misspelled a
word, and used an incorrect word. However, computers are not
nearly as smart as most people; in this case, you might as well have
asked the computer, “Xpu mxv ort dod nmcad bf B?” Unless the
syntax is perfect, the computer cannot interpret the programming
language instruction at all.
When you write a program, you usually type its instructions using
a keyboard. When you type program instructions, they are stored
in computer memory, which is a computer’s temporary, internal
CHAPTER 1 An Overview of Computers and Programming

Random storage. Internal storage is volatile—its contents are lost when the
access computer is turned off or loses power. Usually, you want to be able to
memory, or
retrieve and perhaps modify the stored instructions later, so you also
RAM, is a
form of inter-
store them on a permanent storage device, such as a disk. Permanent
nal, volatile memory. It is storage devices are nonvolatile—that is, their contents are persistent
hardware on which the and are retained even when power is lost.
4
programs that are cur-
After a computer program is stored in memory, it must be trans-
rently running and the
data items that are lated from your programming language statements to machine
currently being used language that represents the millions of on/off circuits within the
are stored for quick computer. Each programming language uses a piece of software,
access. called a compiler or an interpreter, to translate your program
code into machine language. Machine language is also called
binary language, and is represented as a series of 0s and 1s. The
The program compiler or interpreter that translates your code tells you if any
statements programming language component has been used incorrectly.
you write in a Syntax errors are relatively easy to locate and correct because
programming
the compiler or interpreter you use highlights every syntax error.
language are
known as source code.
If you write a computer program using a language such as C++
The translated machine but spell one of its words incorrectly or reverse the proper order
language statements are of two words, the software lets you know that it found a mistake
known as object code. by displaying an error message as soon as you try to translate the
program.

Although there are differences in how compilers and interpreters work, their
basic function is the same—to translate your programming statements into
code the computer can use. When you use a compiler, an entire program is
translated before it can execute; when you use an interpreter, each instruc-
tion is translated just prior to execution. Usually, you do not choose which
type of translation to use—it depends on the programming language. However, there
are some languages for which both compilers and interpreters are available.

Only after program instructions are successfully translated to machine


code can the computer carry out the program instructions. When
instructions are carried out, a program runs, or executes. In a typical
program, some input will be accepted, some processing will occur,
and results will be output.

Besides the popular full-blown programming languages such as Java


and C++, many programmers use scripting languages (also called
scripting programming languages or script languages) such as Python,
Lua, Perl, and PHP. Scripts written in these languages usually can be typed
directly from a keyboard and are stored as text rather than as binary execut-
able files. Scripting language programs are interpreted line by line each time the
program executes, instead of being stored in a compiled (binary) form.
Understanding Simple Program Logic

TWO TRUTHS & A LIE


Understanding Computer Systems

In each Two Truths and a Lie section, two of the numbered statements are true,
5
and one is false. Identify the false statement and explain why it is false.
1. Hardware is the equipment, or the devices, associated with a computer.
Software is computer instructions.
2. The grammar rules of a computer programming language are its syntax.
3. You write programs using machine language, and translation software con-
verts the statements to a programming language.

preter) converts the statements to machine language, which is 0s and 1s.


such as Visual Basic or Java, and a translation program (called a compiler or inter-
The false statement is #3. You write programs using a programming language

Understanding Simple Program Logic


A program with syntax errors cannot execute. A program with no syntax The dangerous
errors can execute, but might contain logical errors, and produce incor- cake-baking
rect output as a result. For a program to work properly, you must give the instructions
are shown with
instructions to the computer in a specific sequence, you must not leave
a Don’t Do It
any instructions out, and you must not add extraneous instructions. By icon. You will see this icon
doing this, you are developing the logic of the computer program. when the book contains
an unrecommended pro-
Suppose you instruct someone to
gramming practice that is
make a cake as follows: used as an example of
Don’t Do It
Get a bowl what not to do.
Don't bake a cake like
Stir this! If you misspell
Add two eggs
a program-
Add a gallon of gasoline
ming language
Bake at 350 degrees for 45 minutes
Add three cups of flour word, you
commit a
Even though you have used the English language syntax correctly, the syntax error, but if you
cake-baking instructions are out of sequence, some instructions are use an otherwise correct
missing, and some instructions belong to procedures other than baking word that does not make
sense in the current con-
a cake. If you follow these instructions, you are not going to make an edi-
text, programmers say
ble cake, and you most likely will end up with a disaster. Logical errors you have committed a
are much more difficult to locate than syntax errors—it is easier for you semantic error. Either
to determine whether “eggs” is spelled incorrectly in a recipe than it is way, the program will not
for you to tell if there are too many eggs or if they are added too soon. execute.
CHAPTER 1 An Overview of Computers and Programming

After you learn Just as baking directions can be given correctly in Mandarin, Urdu,
French, you or Spanish, the same program logic can be expressed in any number
automatically
of programming languages. Because this book is not concerned with
know, or can
easily figure
any specific language, the programming examples could have been
out, many Spanish words. written in Visual Basic, C++, or Java. For convenience, this book uses
Similarly, after you learn instructions written in English!
6
one programming lan-
Most simple computer programs include steps that perform input,
guage, it is much easier
to understand several processing, and output. Suppose you want to write a computer
other languages. program to double any number you provide. You can write such a
program in a programming language such as Visual Basic or Java,
but if you were to write it using English-like statements, it would
You will learn look like this:
about the odd
input myNumber
elimination of
set myAnswer = myNumber * 2
the space
output myAnswer
between
words like my and The number-doubling process includes three instructions:
Number in Chapter 2.
• The instruction to input myNumber is an example of an input
operation. When the computer interprets this instruction, it
knows to look to an input device to obtain a number. When you
work in a specific programming language, you write instructions
that tell the computer which device to access for input. For exam-
ple, when a user enters a number as data for a program, the user
might click on the number with a mouse, type it from a keyboard,
or speak it into a microphone. Logically, however, it doesn’t really
matter which hardware device is used, as long as the computer
knows to look for a number. When the number is retrieved from
an input device, it is placed in the computer’s memory at the
location named myNumber. The location myNumber is a variable. A
variable is a named memory location whose value can vary—for
example, the value of myNumber might be 3 when the program is
used for the first time and 45 when it is used the next time.

From a logical perspective, when you input a value, the hardware device is
irrelevant. The same is true in your daily life. If you follow the instruction “Get
eggs for the cake,” it does not really matter if you purchase them from a
store or harvest them from your own chickens—you get the eggs either way.
There might be different practical considerations to getting the eggs, just as
there are for getting data from a large database as opposed to an inexperienced user.
For now, this book is only concerned with the logic of the operation, not the minor
Programmers details.
use an aster-
isk to indicate
multiplication.
• The instruction set myAnswer = myNumber * 2 is an example
You will learn of a processing operation. Mathematical operations are not the
more about arithmetic only kind of processing operations, but they are very typical. As
statements in Chapter 2. with input operations, the type of hardware used for processing
Understanding Simple Program Logic

is irrelevant—after you write a program, it can be used on comput-


ers of different brand names, sizes, and speeds. The instruction
takes the value stored in memory at the myNumber location, mul-
tiplies it by 2, and stores the result in another memory location
named myAnswer.
• In the number-doubling program, the output myAnswer instruc- 7
tion is an example of an output operation. Within a particular
program, this statement could cause the output to appear on the
monitor (which might be a flat-panel plasma screen or a cathode-
ray tube), or the output could go to a printer (which could be laser
or ink-jet), or the output could be written to a disk or DVD. The
logic of the output process is the same no matter what hardware Watch the
device you use. When this instruction executes, the value stored video A Simple
in memory at the location named myAnswer is sent to an output Program.
device.

Computer memory consists of millions of numbered locations where data


can be stored. The memory location of myNumber has a specific numeric
address—for example, 48604. Your program associates myNumber with
that address. Every time you refer to myNumber within a program, the com-
puter retrieves the value at the associated memory location. When you write
programs, you seldom need to be concerned with the value of the memory address;
instead, you simply use the easy-to-remember name you created.

Computer programmers often refer to memory addresses using hexadeci-


mal notation, or base 16. Using this system, they might use a value like
42FF01A to refer to a memory address. Despite the use of letters, such an
address is still a hexadecimal number. Appendix A contains information on
this numbering system.

TWO TRUTHS & A LIE


Understanding Simple Program Logic

1. A program with syntax errors can execute but might produce incorrect results.
2. Although the syntax of programming languages differs, the same program
logic can be expressed in different languages.
3. Most simple computer programs include steps that perform input, process-
ing, and output.

program with no syntax errors can execute, but might produce incorrect results.
The false statement is #1. A program with syntax errors cannot execute; a
CHAPTER 1 An Overview of Computers and Programming

Understanding the Program


Development Cycle
A programmer’s job involves writing instructions (such as those in
the doubling program in the preceding section), but a professional
8
programmer usually does not just sit down at a computer keyboard
and start typing. Figure 1-1 illustrates the program development
cycle, which can be broken down into at least seven steps:
1. Understand the problem.
2. Plan the logic.
3. Code the program.
4. Use software (a compiler or interpreter) to translate the
program into machine language.
5. Test the program.
6. Put the program into production.
7. Maintain the program.

Understand
the problem

Maintain the Plan the


program logic

Put the program Write the


into production code

Test the Translate the


program code

Figure 1-1 The program development cycle

Understanding the Problem


Professional computer programmers write programs to satisfy the
needs of others, called users or end users. Examples could include a
Human Resources department that needs a printed list of all employ-
ees, a Billing department that wants a list of clients who are 30 or
more days overdue on their payments, and an Order department that
Understanding the Program Development Cycle

needs a Web site to provide buyers with an online shopping cart in The term end
which to gather their orders. Because programmers are providing a user distin-
guishes those
service to these users, programmers must first understand what the
who actually
users want. Although when a program runs, you usually think of the use and ben-
logic as a cycle of input-processing-output operations; when you efit from a software prod-
plan a program, you think of the output first. After you understand uct from others in an
9
what the desired result is, you can plan what to input and process to organization who might
achieve it. purchase, install, or have
other contact with the
Suppose the director of Human Resources says to a programmer, software.
“Our department needs a list of all employees who have been here
over five years, because we want to invite them to a special thank-you
dinner.” On the surface, this seems like a simple request. An experi-
enced programmer, however, will know that the request is incom-
plete. For example, you might not know the answers to the following
questions about which employees to include:
• Does the director want a list of full-time employees only, or a list
of full- and part-time employees together?
• Does she want people who have worked for the company on a
month-to-month contractual basis over the past five years, or only
regular, permanent employees?
• Do the listed employees need to have worked for the organization
for five years as of today, as of the date of the dinner, or as of some
other cutoff date?
• What about an employee who, for example, worked three years,
took a two-year leave of absence, and has been back for three years?
The programmer cannot make any of these decisions; the user (in this
case, the Human Resources director) must address these questions.
More decisions still might be required. For example:
• What data should be included for each listed employee? Should
the list contain both first and last names? Social Security numbers?
Phone numbers? Addresses?
• Should the list be in alphabetical order? Employee ID number
order? Length-of-service order? Some other order?
• Should the employees be grouped by any criteria, such as depart-
ment number or years of service?
Several pieces of documentation are often provided to help the pro-
grammer understand the problem. Documentation consists of all the
supporting paperwork for a program; it might include items such
as original requests for the program from users, sample output, and
descriptions of the data items available for input.
CHAPTER 1 An Overview of Computers and Programming

Watch the video Really understanding the problem may be one of the most difficult
The Program aspects of programming. On any job, the description of what the user
Development
needs may be vague—worse yet, users may not really know what they
Cycle, Part 1.
want, and users who think they know frequently change their minds
after seeing sample output. A good programmer is often part coun-
selor, part detective!
10

You may hear


programmers
Planning the Logic
refer to The heart of the programming process lies in planning the program’s
planning a logic. During this phase of the process, the programmer plans the
program as
steps of the program, deciding what steps to include and how to order
“developing an algorithm.”
An algorithm is the
them. You can plan the solution to a problem in many ways. The two
sequence of steps neces- most common planning tools are flowcharts and pseudocode. Both
sary to solve any problem. tools involve writing the steps of the program in English, much as you
would plan a trip on paper before getting into the car or plan a party
theme before shopping for food and favors.
You will learn
more about
The programmer shouldn’t worry about the syntax of any particu-
flowcharts lar language at this point, but should focus on figuring out what
and pseudo- sequence of events will lead from the available input to the desired
code later in output. Planning the logic includes thinking carefully about all the
this chapter. possible data values a program might encounter and how you want
the program to handle each scenario. The process of walking through
a program’s logic on paper before you actually write the program is
In addition to called desk-checking. You will learn more about planning the logic
flowcharts and
throughout this book; in fact, the book focuses on this crucial step
pseudocode,
programmers
almost exclusively.
use a variety
of other tools to help in
program development. Coding the Program
One such tool is an IPO
After the logic is developed, only then can the programmer write
chart, which delineates
input, processing, and
the program. Hundreds of programming languages are available.
output tasks. Some Programmers choose particular languages because some have built-in
object-oriented program- capabilities that make them more efficient than others at handling
mers also use TOE certain types of operations. Despite their differences, programming
charts, which list tasks, languages are quite alike in their basic capabilities—each can handle
objects, and events. input operations, arithmetic processing, output operations, and other
standard functions. The logic developed to solve a programming
problem can be executed using any number of languages. Only after
choosing a language must the programmer be concerned with proper
punctuation and the correct spelling of commands—in other words,
using the correct syntax.
Some very experienced programmers can successfully combine
logic planning and program coding in one step. This may work for
Understanding the Program Development Cycle

planning and writing a very simple program, just as you can plan and
write a postcard to a friend using one step. A good term paper or a
Hollywood screenplay, however, needs planning before writing—and
so do most programs.
Which step is harder: planning the logic or coding the program?
Right now, it may seem to you that writing in a programming lan- 11
guage is a very difficult task, considering all the spelling and syntax
rules you must learn. However, the planning step is actually more
difficult. Which is more difficult: thinking up the twists and turns to
the plot of a best-selling mystery novel, or writing a translation of an
existing novel from English to Spanish? And who do you think gets
paid more, the writer who creates the plot or the translator? (Try
asking friends to name any famous translator!)

Using Software to Translate the Program


into Machine Language
Even though there are many programming languages, each computer When you
knows only one language: its machine language, which consists of 1s learn the syn-
tax of a pro-
and 0s. Computers understand machine language because they are
gramming
made up of thousands of tiny electrical switches, each of which can
language, the
be set in either the on or off state, which is represented by a 1 or 0, commands you learn will
respectively. work on any machine on
which the language soft-
Languages like Java or Visual Basic are available for programmers
ware has been installed.
because someone has written a translator program (a compiler or However, your com-
interpreter) that changes the programmer’s English-like high-level mands are translated to
programming language into the low-level machine language that machine language, which
the computer understands. If you write a programming language differs depending on your
statement incorrectly (for example, by misspelling a word, using a computer make and
word that doesn’t exist in the language, or using “illegal” grammar), model.
the translator program doesn’t know how to proceed and issues
an error message identifying a syntax error, which is a misuse of a
language’s grammar rules. Although making errors is never desirable,
syntax errors are not a major concern to programmers, because the
compiler or interpreter catches every syntax error and displays a mes-
sage that notifies you of the problem. The computer will not execute a
program that contains even one syntax error.
Typically, a programmer develops a program’s logic, writes the code, Watch the video
and compiles the program, receiving a list of syntax errors. The pro- The Program
grammer then corrects the syntax errors and compiles the program Development
Cycle, Part 2.
again. Correcting the first set of errors frequently reveals new errors
that originally were not apparent to the compiler. For example, if you
could use an English compiler and submit the sentence “The dg chase
CHAPTER 1 An Overview of Computers and Programming

the cat,” the compiler at first might point out only one syntax error.
The second word, “dg,” is illegal because it is not part of the English
After a pro- language. Only after you corrected the word to “dog” would the com-
gram has piler find another syntax error on the third word, “chase,” because it is
been trans- the wrong verb form for the subject “dog.” This doesn’t mean “chase”
lated into is necessarily the wrong word. Maybe “dog” is wrong; perhaps the
12 machine lan- subject should be “dogs,” in which case “chase” is right. Compilers
guage, the machine lan-
don’t always know exactly what you mean, nor do they know what the
guage program is saved
and can be run any num-
proper correction should be, but they do know when something is
ber of times without wrong with your syntax.
repeating the translation
When writing a program, a programmer might need to recompile the
step. You only need to
retranslate your code if
code several times. An executable program is created only when the
you make changes to code is free of syntax errors. When you run an executable program, it
your source code typically also might require input data. Figure 1-2 shows a diagram of
statements. this entire process.

Data that the


program uses

If there are no
Write and correct Compile the syntax errors Executable
the program code program program

If there are
syntax errors

List of Program
syntax output
error
messages

Figure 1-2 Creating an executable program

Testing the Program


A program that is free of syntax errors is not necessarily free of logi-
cal errors. A logical error results when you use a syntactically correct
statement but use the wrong one for the current context. For exam-
ple, the English sentence “The dog chases the cat,” although syntacti-
cally perfect, is not logically correct if the dog chases a ball or the cat
is the aggressor.
Understanding the Program Development Cycle

Once a program is free of syntax errors, the programmer can


test it—that is, execute it with some sample data to see whether
the results are logically correct. Recall the number-doubling
program:
input myNumber
set myAnswer = myNumber * 2
13
output myAnswer

If you execute the program, provide the value 2 as input to the pro-
gram, and the answer 4 is displayed, you have executed one successful
test run of the program.
However, if the answer 40 is displayed, maybe the program contains
a logical error. Maybe the second line of code was mistyped with an
extra zero, so that the program reads:
input myNumber Don’t Do It
set myAnswer = myNumber * 20 The programmer typed
output myAnswer "20" instead of "2".
The process
Placing 20 instead of 2 in the
of finding and
multiplication statement caused a logical error. Notice that nothing is correcting
syntactically wrong with this second program—it is just as reasonable program
to multiply a number by 20 as by 2—but if the programmer intends errors is
only to double myNumber, then a logical error has occurred. called debugging.

Programs should be tested with many sets of data. For example, if


you write the program to double a number, then enter 2 and get an
output value of 4, that doesn’t
necessarily mean you have
a correct program. Perhaps Don’t Do It
you have typed this program The programmer typed
by mistake: "+" instead of "*".
input myNumber
set myAnswer = myNumber + 2
output myAnswer

An input of 2 results in an answer of 4, but that doesn’t mean your


program doubles numbers—it actually only adds 2 to them. If you test
your program with additional data and get the wrong answer—for
example, if you enter 7 and get an answer of 9—you know there is a
problem with your code.
Selecting test data is somewhat of an art in itself, and it should be
done carefully. If the Human Resources department wants a list
of the names of five-year employees, it would be a mistake to test
the program with a small sample file of only long-term employees.
If no newer employees are part of the data being used for testing,
you do not really know if the program would have eliminated them
CHAPTER 1 An Overview of Computers and Programming

from the five-year list. Many companies do not know that their
software has a problem until an unusual circumstance occurs—for
Chapter 4
contains more
example, the first time an employee has more than nine depen-
information on dents, the first time a customer orders more than 999 items at a
testing time, or when (as well-documented in the popular press) a new
programs. century begins.
14

Putting the Program into


Production
Once the program is tested adequately, it is ready for the organi-
zation to use. Putting the program into production might mean
simply running the program once, if it was written to satisfy a
user’s request for a special list. However, the process might take
months if the program will be run on a regular basis, or if it is one
of a large system of programs being developed. Perhaps data-entry
people must be trained to prepare the input for the new program;
users must be trained to understand the output; or existing data
in the company must be changed to an entirely new format to
accommodate this program. Conversion, the entire set of actions
an organization must take to switch over to using a new pro-
gram or set of programs, can sometimes take months or years to
accomplish.

Maintaining the Program


After programs are put into production, making necessary
changes is called maintenance. Maintenance can be required for
many reasons: new tax rates are legislated, the format of an input
file is altered, or the end user requires additional information
not included in the original output specifications, to name a few.
Frequently, your first programming job will require maintaining
Watch the video previously written programs. When you maintain the programs
The Program others have written, you will appreciate the effort the original pro-
Development grammer put into writing clear code, using reasonable variable
Cycle, Part 3.
names, and documenting his or her work. When you make changes
to existing programs, you repeat the development cycle. That is, you
must understand the changes, then plan, code, translate, and test
them before putting them into production. If a substantial number
of program changes are required, the original program might be
retired, and the program development cycle might be started for a
new program.
Using Pseudocode Statements and Flowchart Symbols

TWO TRUTHS & A LIE


Understanding the Program Development Cycle

1. Understanding the problem that must be solved can be one of the most dif-
15
ficult aspects of programming.
2. The two most commonly used logic-planning tools are flowcharts and
pseudocode.
3. Flowcharting a program is a very different process if you use an older
programming language instead of a newer one.

to solve a programming problem can be executed using any number of languages.


processing, output operations, and other standard functions. The logic developed
quite alike in their basic capabilities—each can handle input operations, arithmetic
The false statement is #3. Despite their differences, programming languages are

Using Pseudocode Statements


and Flowchart Symbols
When programmers plan the logic for a solution to a programming
problem, they often use one of two tools: pseudocode (pronounced
“sue-doe-code”) or flowcharts. Pseudocode is an English-like repre-
sentation of the logical steps it takes to solve a problem. A flowchart
is a pictorial representation of the same thing. Pseudo is a prefix that
means “false,” and to code a program means to put it in a programming
language; therefore, pseudocode simply means “false code,” or sentences
that appear to have been written in a computer programming language
but do not necessarily follow all the syntax rules of any specific language.

Writing Pseudocode
You have already seen examples of statements that represent pseudo-
code earlier in this chapter, and there is nothing mysterious about
them. The following five statements constitute a pseudocode repre-
sentation of a number-doubling problem:
start
input myNumber
set myAnswer = myNumber * 2
output myAnswer
stop
CHAPTER 1 An Overview of Computers and Programming

Using pseudocode involves writing down all the steps you will use in
a program. Usually, programmers preface their pseudocode with a
beginning statement like start and end it with a terminating state-
ment like stop. The statements between start and stop look like
English and are indented slightly so that start and stop stand out.
Most programmers do not bother with punctuation such as periods
16
at the end of pseudocode statements, although it would not be wrong
to use them if you prefer that style. Similarly, there is no need to capi-
talize the first word in a sentence, although you might choose to do
so. This book follows the conventions of using lowercase letters for
verbs that begin pseudocode statements and omitting periods at the
end of statements.
Pseudocode is fairly flexible because it is a planning tool, and not the
final product. Therefore, for example, you might prefer any of the
following:
• Instead of start and stop, some pseudocode developers would
use the terms begin and end.
• Instead of writing input myNumber, some developers would write
get myNumber or read myNumber.

• Instead of writing set myAnswer = myNumber * 2, some develop-


ers would write calculate myAnswer = myNumber times 2 or
compute myAnswer as myNumber doubled.

• Instead of writing output myAnswer, many pseudocode devel-


opers would write display myAnswer, print myAnswer, or
write myAnswer.

The point is, the pseudocode statements are instructions to retrieve


an original number from an input device and store it in memory
where it can be used in a calculation, and then to get the calculated
answer from memory and send it to an output device so a person can
see it. When you eventually convert your pseudocode to a specific
programming language, you do not have such flexibility because spe-
cific syntax will be required. For example, if you use the C# program-
ming language and write the statement to output the answer, you will
code the following:
Console.Write (myAnswer);

The exact use of words, capitalization, and punctuation are important


in the C# statement, but not in the pseudocode statement.
Using Pseudocode Statements and Flowchart Symbols

Drawing Flowcharts
Some professional programmers prefer writing pseudocode to
drawing flowcharts, because using pseudocode is more similar to
writing the final statements in the programming language. Others
prefer drawing flowcharts to represent the logical flow, because flow-
charts allow programmers to visualize more easily how the program You can draw 17
statements will connect. Especially for beginning programmers, flow- a flowchart by
charts are an excellent tool to help them visualize how the statements hand or use
software,
in a program are interrelated.
such as
When you create a flowchart, you draw geometric shapes that contain Microsoft Word and
the individual statements and that are connected with arrows. You Microsoft PowerPoint,
that contains flowcharting
use a parallelogram to represent
tools. You can use sev-
an input symbol, which indicates input myNumber eral other software pro-
an input operation. You write an grams, such as Visio and
input statement in English inside the Visual Logic, specifically
parallelogram, as shown in Figure 1-3. Figure 1-3 Input symbol to create flowcharts.

Arithmetic operation statements


are examples of processing. In a set myAnswer =
flowchart, you use a rectangle as the myNumber * 2
processing symbol that contains a
processing statement, as shown in Because the
Figure 1-4 Processing symbol
Figure 1-4. parallelogram
is used for
To represent an output state-
both input and
ment, you use the same symbol as output myAnswer output, it is
for input statements—the output often called
symbol is a parallelogram, as shown the input/output
in Figure 1-5. Figure 1-5 Output symbol symbol or I/O symbol.

Some software programs that use flowcharts (such as Visual Logic) use
a left-slanting parallelogram to represent output. As long as the flowchart
creator and the flowchart reader are communicating, the actual shape
used is irrelevant. This book will follow the most standard convention
of always using the right-slanting parallelogram for both input and output.

Appendix B
To show the correct sequence of these statements, you use arrows, or
contains a
flowlines, to connect the steps. Whenever possible, most of a flow- summary of
chart should read from top to bottom or from left to right on a page. all the flow-
That’s the way we read English, so when flowcharts follow this con- chart symbols
vention, they are easier for us to understand. you will see in this book.
CHAPTER 1 An Overview of Computers and Programming

Programmers To be complete, a flowchart should include two more elements:


seldom create terminal symbols, or start/stop symbols, at each end. Often, you
both pseudo-
place a word like start or begin in the first terminal symbol and a
code and a
word like end or stop in the other. The standard terminal symbol is
flowchart for
the same problem. You shaped like a racetrack; many programmers refer to this shape as a
usually use one or the lozenge, because it resembles the shape of the medication you might
18
other. In a large program, use to soothe a sore throat. Figure 1-6 shows a complete flowchart
you might even prefer to for the program that doubles a number, and the pseudocode for the
use pseudocode for same problem. You can see from the figure that the flowchart and
some parts and draw a pseudocode statements are the same—only the presentation format
flowchart for others.
differs.

Flowchart Pseudocode

start

input myNumber

start
input myNumber
set myAnswer =
set myAnswer = myNumber * 2
myNumber * 2
output myAnswer
stop

output myAnswer

stop

Figure 1-6 Flowchart and pseudocode of program that doubles a number

Repeating Instructions
After the flowchart or pseudocode has been developed, the
programmer only needs to: (1) buy a computer, (2) buy a language
compiler, (3) learn a programming language, (4) code the pro-
gram, (5) attempt to compile it, (6) fix the syntax errors, (7) com-
pile it again, (8) test it with several sets of data, and (9) put it into
production.
“Whoa!” you are probably saying to yourself. “This is simply not worth
it! All that work to create a flowchart or pseudocode, and then all those
other steps? For five dollars, I can buy a pocket calculator that will
Using Pseudocode Statements and Flowchart Symbols

double any number for me instantly!” You are absolutely right. If this When you tell
were a real computer program, and all it did was double the value of a a friend how
to get to your
number, it would not be worth the effort. Writing a computer program
house, you
would be worthwhile only if you had many—let’s say 10,000—numbers might write a
to double in a limited amount of time—let’s say the next two minutes. series of instructions or
you might draw a map.
Unfortunately, the number-doubling program represented in 19
Pseudocode is similar to
Figure 1-6 does not double 10,000 numbers; it doubles only one. You
written, step-by-step
could execute the program 10,000 times, of course, but that would instructions; a flowchart,
require you to sit at the computer and tell it to run the program over like a map, is a visual
and over again. You would be better off with a program that could representation of the
process 10,000 numbers, one after the other. same thing.

One solution is to write the program shown in Figure 1-7 and execute
the same steps 10,000 times. Of course, writing this program would
be very time consuming; you might as well buy the calculator.

start
input myNumber
set myAnswer = myNumber * 2
output myAnswer
input myNumber
set myAnswer = myNumber * 2
output myAnswer Don’t Do It
input myNumber You would never want to
set myAnswer = myNumber * 2 write such a repetitious
output myAnswer list of instructions.
…and so on for 9,997 more times

Figure 1-7 Inefficient pseudocode for program that doubles 10,000 numbers

A better solution is to have the computer execute the same set of


three instructions over and over again, as shown in Figure 1-8. The
repetition of a series of steps is called a loop. With this approach, the
computer gets a number, doubles it, displays the answer, and then
starts over again with the first instruction. The same spot in memory,
called myNumber, is reused for the second number and for any subse-
quent numbers. The spot in memory named myAnswer is reused each
time to store the result of the multiplication operation. The logic illus-
trated in the flowchart in Figure 1-8 contains a major problem—the
sequence of instructions never ends. This programming situation is
known as an infinite loop—a repeating flow of logic with no end. You
will learn one way to handle this problem later in this chapter; you
will learn a superior way in Chapter 3.
Exploring the Variety of Random
Documents with Different Content
purpose of maintaining buoys and beacons, and keeping clear the
channel of the river.
Among other improvements to which their attention has been
directed, was the building of an elegant stone bridge, in the room of
the old wooden one, over the great river. This was done about
1767, at the expence of nearly 2,300l. It consists of one elliptical
arch, very accurately proportioned. A new Custom-House has been
also erected; and the streets are cleaned, lighted, and watched, at
their expence. Of late a new Jail and Shire-hall have been likewise
built; and when a few more improvements are made, and especially
the finishing of the circus, but few towns will be more handsome
than Wisbeach. The Theatre is a commodious buildings in nearly a
central situation. The Rose Inn, where balls and monthly assemblies
are held, is said to have been a place of public reception from the
year 1475, at which period it was known by the sign of the Horn;
and on one of the out-buildings, erected in 1601, the figure of a
horn is yet to be seen.
The trade of Wisbeach is said to have much increased of late years,
through the improved state of the drainage and navigation of the
fens, and consequent augmentation of the produce and consumption
of the country: and it would, no doubt, have increased much more,
but for the bad state of the harbour or river below. The average of
the exports and imports amounts to 40,000 tons annually. The
principal articles of traffic are coals, corn, timber, and wine. The
neighbouring lands are in high cultivation, chiefly on the grazing
System. The Sheep and oxen grow to a great size, and considerable
numbers of them are fattened, and sent twice every week to the
London market. The inhabitants are employed in commerce, there
being no manufacture of any kind in the place, though the
surrounding country produces immense quantities of wool, hemp,
and flax. The market is abundantly supplied with poultry, fish, and
butchers meat; and the trade of the town is further promoted by six
small fairs, for hemp and flax, horned cattle and horses. The canal,
which was completed a few years ago, extending from Wisbeach
river to the river Nene at Outwell, and thence to the river Ouse at
Salters-Lode Sluice, opened a communication with Norfolk, Suffolk,
and other counties, and has already benefited the town considerably.
[104]

The Summer Assizes, and the January and Midsummer quarter


sessions for the Isle of Ely, are held at Wisbeach; where the
magistrates assemble also every Wednesday and Saturday to settle
the assize of bread, and for other purposes. The chief Justice of the
Isle, and all other magistrates are appointed by the bishop, who is
here invested with temporal as well as spiritual jurisdiction. The
education of youth at Wisbeach is provided for by a free school, and
two charity schools, supported by voluntary contributions. The
appointment of Master of the Free-School is vested in the Capital
Burgesses, with the consent of any other ten inhabitants, having
voices in the election of those Burgesses. It appears that the Trinity
Guild used to allow the Schoolmaster the annual salary of 10l. 6s.
8d. and that they also distributed annually among the poor the sum
of 3l. 15s. which last sum, as Mr. Hutchesson assures us, has been
continued invariably to this day. But 3l. 15s. is now a very paltry
sum, indeed, compared to what it was in the 15th and 16th
centuries. Its value now is scarcely a tenth part of what it was then.
[105]

An institution which has been justly deemed creditable to Wisbeach,


is its Literary Society, formed in 1781, whose members sometime
ago were about thirty, and its collection of books, or library,
consisted of upwards of a thousand volumes.—Besides this
institution, and some reading societies, or book-clubs, Wisbeach can
also boast of a Philosophical Society, the President of which is Mr.
Wm. Skrimshire Junr. a gentleman much and deservedly respected
among his fellow-townsmen. He is allowed to be well qualified for
the presidentship of such an institution, from his extensive
knowledge of those subjects which it is the aim of the Society chiefly
to cultivate; and in some branches of natural history he is said to be
eminently conversant. He is a native of the town, as well as one of
the most ingenious, intelligent, and respectable of its inhabitants.
Many remarkable personages may be supposed, one time and
another, to have appeared among the natives of Wisbeach; but we
shall here mention but two of them, and those of very unequal
merit.—One of them was Dr. Henry Southwell, late rector of Asterby,
and the reputed author of a well known and popular Commentary on
the Old and New Testament, commonly called Dr. Southwell’s Family
Bible; not a page of which, however, was written by him, being
absolutely unequal to such an undertaking, and but a few degrees, if
any, above an ideot. [106] But he sold his name to some London
booksellers for a certain pecuniary consideration, and they employed
one Dr. Saunders, a noted hackney writer, to do the work. They also
produced Letters of approbation and recommendation, addressed to
Dr. Southwell, from a great number of pretended eminent
clergymen, in different parts of the kingdom. The trick succeeded,
and the credulous public went taken in, as usual. It was, certainly, a
most shameful business, and must be contemplated by all honest
men with abhorrence and indignation: but the work brought no
small gain to the publishers, for it had, it seems, a great run; and
that, with them, would sufficiently sanctify the imposture. It is to be
wished it could be said to be the only instance of the kind that
occurs in the transactions of modern booksellers. But this is the age
of imposition and humbugging, in which not only booksellers, but
even ministers of State have sometimes been too fond of acting
their parts.
The other person that shall be here named, as a native of Wisbeach,
is Thomas Clarkson. He too is a clergyman; but of a character so
very different from the former, that no two human beings could well
be more unlike each other. His unparalleled exertions in behalf of
the oppressed Africans, and for the abolition of the detestable Slave-
trade, so long the disgrace and curse of this country, must place his
name very high indeed, among the modern sons of Britain—even far
above our Burkes, our Pitts, and our Nelsons, as the real friend of
his country and his species, and the benefactor of the human race.
Compared with such characters, he appears as an angel of light by
the side of a group of demons. The honour of giving birth to so
estimable and distinguished a person, must justly entitle the town of
Wisbeach to no small degree of lasting celebrity. He should,
certainly, be placed at the head of those memorable and venerable
instruments, who contributed to the abolishment and annihilation of
our most shameful, detestable, and horrid traffick in human flesh
and blood. But for his vigorous and unwearied efforts, the names
even of a Fox and a Wilberforce had never perhaps been known, as
the promoters and champions of that honourable and sacred cause.
But the virtues he displayed, and the service he performed, on that
never to be forgotten occasion, are too well known, and too
frequently acknowledged, to need any eulogy that this feeble pen is
capable of attempting. Long may he live to enjoy his well-earned
fame, and to exhibit still more widely among his contemporaries, by
his future writings, the truth and importance of those exalted
principles, for which he so nobly and so successfully contended.
The attention bestowed upon Wisbeach by William I, in erecting
there a stone castle, has been already noticed. To some of our
succeeding monarchs it also appears to have been an object of
partiality: we are accordingly informed that Richard I, March 28th,
1190, granted the tenants of Wisbeach-Barton Manor an exemption
or freedom from toll in all fairs and markets throughout England.
This grant was confirmed, in 1214, by king John, who came to
Wisbeach from Lynn in October 1216, as Dr. Brady has proved from
original records preserved in the Tower. In the 12th of Henry IV. it
was renewed, and again confirmed by writ of privy seal of Henry VI.
Afterwards the privilege being forfeited, it was restored through the
exertions of Nicholas Sandford, who died in 1608, and was buried in
the church, where an inscription, on the brass plate inserted in his
tomb-stone, commemorates his singular bounty and patriotism, as
having, at his own charge, freed the town from toll.
After Oliver Cromwell had been appointed governor of the Isle of Ely,
for his activity in swaying it to the interest of the Parliament, he
caused fortifications to be raised near the Horse-shoe on the north
side of Wisbeach, to secure the passes out of Lincolnshire, which
continued attached to the king. The soldiers stationed to defend
them were commanded by Colonel Sir John Palgrave, and Captain
William Dodson; and the ammunition, and other warlike stores, were
supplied from a Dutch ship, which the Queen had dispatched from
Holland for the use of the royalists, but which, very seasonably and
conveniently, fell into the hands of their opponents.
In 1643 the burgesses lent 150l. to Captain Dodson, who was then
engaged in the siege of Croyland; and on the 25th of March 1644,
they delivered to Major John Ireton four muskets, three bandeliers,
and two swords, for the service of the Parliament. They also
furnished the latter with a loan of 250l. towards raising a troop of
horse for the defence of the Isle. This troop seems to have been
supported even after the Revolution, as on the 6th of June, 1690, 4l.
were ordered to be paid towards the expence of a horse to serve in
“the Troop,” and the town-bailiff was directed to defray a moiety of
the charge for arms and furniture.
Between the restoration and the year 1672, cities, towns, and even
individuals, were allowed to coin copper money for the convenience
of trade: the Capital Burgesses of Wisbeach, therefore, in February,
1670, ordered the town-bailiff to expend 20l. in coining halfpence,
with the words “A Wisbeach Half-penny,” on one side; and on the
other, the impression of the town-seal. In 1722, the poor-house was
erected, at the expence of 2000l. borrowed for that purpose by the
Capital Burgesses, on their corporation seal:—for being an invisible
body, (like other bodies-corporate) whose intentions cannot be
manifested or expressed by personal acts, or oral discourse, they
could act and speak only by their common seal. [109]
The frequent journeys made by George II. to Hanover, (whither it
was supposed he transported a large share of the national treasure,)
and his attachment to Lady Kilmarnock, afterwards Countess of
Yarmouth, excited the displeasure of some of the inhabitants of this
town; and the Rev. Thomas Whiston, curate to Dr. Bell, preached a
sermon full of asperity against the King’s conduct. His text was from
Proverbs vii, 19–22. “The good man is not at home, he is gone a
long journey, he hath taken a bag of money with him, and will come
home at the day appointed. With her much fair speech she caused
him to yield. He goeth after her straightway, as an ox goeth to the
slaughter, or as a fool to the correction of the stocks.” Mr. Whiston
seems to have been endued with that talent which gives its
possessor a facility in adapting the language and circumstances of
distant ages to the occurrences of modern times; of which he gave
further proof after the suppression of the rebellion in 1745, and the
return of the Pretender into France, when he zealously defended the
succession of the House of Brunswick, taking for his text, 2 Kings,
xix, 33. “By the way that he came, by the same shall he return, and
shall not come into this city, saith the Lord.” [110] One would suppose
this clergyman to have been in his day somewhat of an uncommon
and singular, though not apparently of a disreputable character. He
was evidently a patriot and anti-jacobite; and, unlike most of his
order, he could discern the errors and misdoings of the great, and
even testify against them in a very open and pointed manner. On
the prudence and propriety, or expediency of this part of his
conduct, different persons, no doubt, would entertain different
opinions. What he would have thought, said, or done, had he lived
in the present reign, and to this very time, it is impossible to know.
Of royal journeys to Hanover, and of female favourites, or mistresses
of the sovereign, one may presume he would have seen no cause of
complaint. But that the same would have been the case, as to all
our state maxims, and public measures, and especially our three last
wars, is more, perhaps, than we are warranted to conclude; as it
seems rather probable, not to say more than probable, that Mr.
Whiston would have discovered in some, if not in all of them, no
slight cause of disgust and animadversion. How he would have
stood affected toward some of our princes of the blood, or royal
dukes, and what texts, or passages of scripture he would have
applied to them, or made the groundwork of sermons or addresses
to his parishioners concerning them, are questions that cannot now
be answered or resolved.
The river Nene, being navigable from Wisbeach to Peterborough,
and many other more distant inland parts, contributes much to the
commercial importance of the former. There are also passage-boats
on this river, which prove very convenient to travellers, in their
progress to, or from the great north road.—Before we quit Wisbeach
it may be here just hinted, that some of its inhabitants have often
been heard loudly congratulating themselves, on the very superior
advantages of their town, compared with Lynn and most other
boroughs, where the corporation spirit is too apt to encroach and
bear hard upon the unprivileged part of the community; but which,
happily, never haunts, molests, or disturbs the people of Wisbeach.
If that be really the case, they have, certainly, cause for boasting;
and we can do no less than hail them on the occasion.—The
population of Wisbeach, as ascertained by the late act, amounts to
near five thousand: so that it is the most populous town in the
county, except Cambridge.

Section XIII.

Additional account of Marshland—Parkin—Bishop of Ely’s manor,


in Terrington—Queen Henrietta—Admiral Bentinck—Cross Keys—
Demolishers of the banks prosecuted and suppressed—High
Tides—Destructive Inundations—Principal divisions of Marshland.
Being here to quit Wisbeach, we shall now recross the ditch, [112] and
take another turn in Marshland. In this remarkable District, as has
been already intimated, scarce any edifices are to be seen, either of
ancient or modern date, that are worthy of very particular attention,
except the parish churches; and of them it does not seem necessary
to give here any further description: but it may be just hinted, that
next to Walpole St-Peter’s, already described, the two Terringtons,
one of the Tilneys, West-Walton, and Walsoken, are deemed the
most considerable and remarkable. Some account of them may be
found in Parkin’s History of Freebridge Hundred and half.
In the same work may also be found a pretty distinct and
circumstantial account of the different manors in this district, one of
which belonged formerly to the Crown, as a royal desmesne, and
was repeatedly settled on some of our queen’s consorts, as part of
their jointures.—It lies in Terrington, and is called the bishop of Ely’s
manor, having once belonged to his great lordship of West-Walton,
Wisbeach, &c. It remained in the See of Ely till the death of bishop
Cox, in 1581, when it came to the Crown by an Act of Parliament
passed in the 4th of Elizabeth. James I. granted it with all its
appurtenances to his eldest son Henry, and after his decease, to his
other son Charles prince of Wales, on whose marriage it was settled
on his queen, as a part of her jointure; from which, however, it has
been thought not very likely that she ever derived much benefit.
[113]
In the reign of Charles II. it was again settled on Catherine of
Lisbon, his consort, as part of her dower or jointure, and was farmed
by Sir James Chapman Fuller, bart. In 1696, William Bentinck, earl
of Portland, had a grant of it from king William. Admiral Bentinck, a
descendant of that family, is the present possessor of it, and of the
greatest part of Terrington.—Somewhere upon this estate of his, is
said to be one of the best spots in the whole country for forming a
Decoy.—The Admiral, within these few years, has added to his
possessions here a large extent of salt marshes, which he has
rescued from the sea, and secured by strong and capital
embankments. No part of his valuable territory here exceeds this
newly recovered tract, in point of fertility: nor is it exceeded, if
equalled, by any other part of Marshland: and yet it has been
thought, from the high terms on which he lets it, that he himself has
overrated its value. This point, however, must be left for him and his
tenants to settle as they can.
In Terrington is that Wash, or passage into Lincolnshire, commonly
called the Cross Keys. “Here (says Parkin) is a guide always
attending, to conduct passengers over, bearing a wand or rod in his
hand, probably in imitation of Moses, who had a rod when he
conducted the Israelites through the Red Sea.” [114] A guide certainly
does attend; and it seems he bears a wand; but that he does so in
imitation of Moses, was, perhaps, never supposed by any one before
Mr. Parkin.—These guides might very probably use a wand, or long
rod, for the purpose of sounding the depth of the water, or to
discover any unevenness, dangerous holes, or sloughs at the
bottom.
The Banks erected by the Romans to secure this country, appear to
have been well constructed (as was generally the case with the
great works of that people) and they served probably for ages as
effectual bulwarks against the encroachment of the ocean. In a long
course of time, however, they would naturally fall into decay; and
the Saxons, who succeeded the Romans, being never very
remarkable for their attention to such matters, or their skill in the
management of them, it is not to be wondered that we often hear in
aftertimes of breaches in the banks; and of high tides, or great
inland floods deluging and desolating the country.
As long ago as the reign of Edward I. we read of certain lawless
people making breaches in the banks, and resisting those who would
have stopt them; upon which the king is said to have appointed
certain persons to inquire into those misdemeanours, and punish the
offenders. Afterward, in the same reign, mischievous persons are
said to have thrown down the bank at Little-lode; when a new
commission was issued to search after the offenders and bring them
to justice. Another commission was issued some few years after,
when Robert Russel, bailiff to the Abbot of Ramsey, John Mayner,
Walter Halleman and others, were found out as offenders, having by
force of arms, broke down the Dam at Smalelode, and Richard
Curteys the other at Wadynstowe; and the Sheriff was ordered to
apprehend them. All this seems very plainly to indicate, that, even
in the reign of our boasted English Justinian, the state of things in
this country was very different from what it was in that of the
immortal Alfred. [116] In the 22, of Henry VIII. an act passed,
making it felony to demolish the sea banks, which seems to have put
an effectual stop to those flagitious proceedings.
Among the shocking inundations, from which this low country
greatly suffered in former times, the following seem to be the most
remarkable.—In the year 1236, on the morrow after Martinmas-day,
and the eight following days, the sea, by the violence of the wind,
was raised to such a height, that the banks, yielding to the force of
the water, were broken so, that “of small craft, cattle, and men,”
great multitudes were destroyed. A similar calamity happened about
nineteen years afterward. Also in 1437, by a breach in the bank of
Wisbeach Fen, 4,400 acres of land were overflowed. Another of
those disastrous events happened on Monday and Tuesday, the
second and third of October, 1570, by which all Marshland together
with the town of Wigenhale, were overflowed with salt water; so
that from Old Lynn to Magdalen-bridge there were not left ten roods
of the bank whole and firm, to the very great damage of the whole
country. How or when that damage was repaired, or the banks
restored to their former state, does not appear; but in the 39th of
the same reign (that of Elizabeth) complaint was made at a Session
of Sewers, that through neglect of keeping the water in at Rightforth
Lode within the crests of the same, the grounds on the north side of
the said Lode were, in time of great inundations, overflown, which
occasioned the tenants, for avoiding the water, to cut the old
Powdike, and issue the said water into Marshland Fen, to the great
loss of the inhabitants and commoners there. It was therefore
ordained and decreed, by the commissioners, that whoever should
so transgress in future, should be fined 20l. for every such default.
After this, on the 1st of April 1607 (5. Jac.) there happened a mighty
tide, which broke Catt’s bank, and drowned Clenchwarton. About
1610, provision was made for draining the waters of Oldfield,
Outwell, &c. without issuing them through Broken Dike into
Marshland, and also for a general repair of all the banks. How far
these measures were carried on, or effected, cannot now be said;
but they proved entirely ineffectual to secure the country from that
dreadful inundation of the sea, which happened on November 1,
1613 (11 Jac.) and which laid all Marshland and parts adjacent under
water, and proved exceedingly calamitous to the whole country. In
commemoration of this most disastrous event, the following rather
quaint Inscription was set up on the East Wall of the south aisle in
Wisbeach Church—

“To the immortal praise of God Almighty, that saveth his people
in all adversities, be it kept in perpetual memory, That on the
Feast-Day of All saints, being the first of November in the year
of our Lord 1613, late in the night, the sea broke in through the
violence of a North East wind, meeting with a Spring Tide, and
overflowed all Marshland, with the town of Wisbeche, both on
the north side and on the south; and almost the whole Hundred
round about; to the great danger of men’s lives, and the losse
of some; besides the exceeding great lossc which these counties
sustained through the breach of the banks, and spoil of corn,
cattle, and housing, which could not be estimated.”
Dugdale in his History of Embanking has preserved—

“An Abstract of the losses in general (sustained on the above


occasion) as they were presented by the Jurors of several
Hundreds at the Session of Sewers held at Lynn, December 9,
1613.—Within the Ring of Marshland the statement of the said
losses is as follows—Terrington, 10,416l; Walpole, 3,000l; West-
Walton, 850l; Walsoken, 1,328l; Emneth, 150l; Wigenhale and
South Lynn, 6,000l; Tilney and Islington, 4,380l; Clenchwarton,
6,000l; West and North Lynn, 4,000l—in all 35,834l.—Without
the Ring of Marshland, the damage was far less considerable,
and is given as follows, Gaywood, 205l; South Wotton, 313l;
North Wotton, 810l; Watlington, 500l; Totnel cum Wormegay,
60l; Holm cum Thorpland, 40l; Stow Bardolf, 100l: in all 2,028l;
which added to the former account will amount to no less a sum
than 37,862l.”—A sum equal, perhaps, to near half a million of
our money.

The damages at or about Wisbeach, and out of Norfolk, are not


included in the above abstract; though they must, doubtless, have
been very considerable, and probably not much less than the
former: the whole together must, of course, have been enormous,
and equal to many hundred thousand pounds of our money.
In the months of January and February, and particularly on the 23rd
of March in the ensuing year (1614,) the country sustained much
additional damage from the snows that had fallen, and which had
occasioned vast floods from the upland countries upon their going
off. A great part of Marshland, from the bank called the Edge,
between the towns and Emneth, to the New Podike, was overflowed
with fresh water, by divers breaches, between Salter’s Lode and
Downham Bridge. The country to the south of Wisbeach also
suffered greatly on the occasion; as did likewise the greater part of
the land within South Eaubrink in Holland, which was so overflowed
and damaged, from Spalding to Tydd St. Giles, as to be almost
entirely lost for that year.—From these premises it evidently appears,
that the boasted fertility, and numerous advantages of Marshland
and the adjacent parts have often been woefully counterbalanced by
disadvantages and evils of a most serious and distressing nature; so
as to leave the inhabitants but very little room to exult over their
less wealthy countrymen, whose lot is fallen in the more sterile and
rugged parts of the kingdom.
Before we finish this Section, it may be proper to say something of
the principal divisions of Marshland, and its extent, which we often
find differently represented. In its fullest extent, or within its ring,
as it is sometimes expressed, Marshland comprehends the following
parishes, (with the exception of part of that of St. German’s, which
lies on the eastern side of the river Ouse.)—1. Emneth. 2.
Walsoken. 3. West Walton. 4. Walpole St Andrew’s. 5. Walpole St
Peter’s. 6. Terrington St Clement’s. 7. Terrington St John’s. 8.
Clenchwarton. 9. North Lynn. 10. West Lynn. 11. Tilney All Saints.
12. Tilney St. Lawrence. 13. Islington cum Tilney. 14. Wigenhale
St. Mary’s. 15. Wigenhale St. German’s. 16. Wigenhale St. Mary
Magdalen.—In another view, as a privileged district, and, particularly,
as interested in the Smeeth, Marshland has been considered as
much less extensive, comprehending only eleven parishes, or rather
confined to seven towns, or townships: and then N. and W. Lynn,
with the three Wigenhales are excluded. These townships; or the
seven towns of Marshland, as they are usually called, are thus
enumerated—1. Emneth. 2. Walsoken. 3. West Walton. 4. The two
Walpoles, both under one. 5. The two Terringtons, both under one.
6. Clenchwarton. 7. The two Tilneys and Islington, all under one, or
constituting one township.—At what time this division of the district
into seven townships took place, does not appear. It was, probably,
at a remote period, and before the formation of the eleven parishes,
which these townships now contain. It may, perhaps not
unreasonably be presumed to have originated under the East-
Anglian government, at an early period of the Heptarchy:—if not,
indeed, even before either the Heptarchy, or yet the East-Anglian
government had ever sprung into existence.
Section XIV.

Biographical Sketches of some of the most distinguished


personages of other times, in Marshland and its vicinity.
Of celebrated characters, or men who attained to high renown
among their contemporaries, but a very moderate number appears
to belong to Marshland or its vicinity. Some such, however, seem to
have sprung up there, at different periods, within the last thousand
years: and of them, whose names have been preserved, the first
place, at least in point of seniority, seems to belong to
1. Hickifric, vulgarly called Tom Hickatrif or Hickathrift. He is
supposed to have lived some time before the conquest, and to have
been in his day and generation,

“A village Hampden, that with dauntless breast


The little tyrants of his fields withstood.”

He has been represented as the proprietor of the Smeeth; though he


might, perhaps, be only entitled to the benefit of pasturage there, in
common with the rest of his neighbours. Be that as it might, it is
agreed on all hands that he was a person of uncommon strength,
gigantic stature, and unshaken fortitude. Very different from most
other men of might, it does not appear that he was ever accused of
oppressing his weaker neighbours, insulting their persons, or
committing depredations upon their property. His superior powers
and valour were called forth and employed only in defence of his
own just right and property, and those of his oppressed fellow-
citizens. Tradition informs us of a certain unwarrantable and base
attempt being once made, by some lawless and powerful men, to
encroach upon the neighbouring inhabitants, and dispossess them of
their right to the Smeeth; or, at least, to deprive them of some part
of that fertile tract; and which was to be effected by force of arms,
as the inhabitants seemed determined to make resistance, and not
tamely to part with, or give up their rights. An engagement
accordingly ensued, which terminated in the total discomfiture of the
invaders, and the consequent reinstatement of the inhabitants in the
quiet possession of their wonted privileges. The victory was
universally ascribed to the singular prowess and irresistible exertions
of Hickifric, who fought that day, as the tradition says, with a cart-
wheel in one hand, instead of a buckler or shield, and an axletree in
the other, instead of a spear or battle-ax. In short he is said to have
acquitted himself on that memorable occasion, so as to establish his
character, and hand it down to posterity, as, at once, the firm
patriot, and redoubtable champion. A stone coffin, in Tilney
churchyard, is shewn to this day as having once belonged to him.
But this, perhaps, may be questioned, as may also some of the
circumstances of the above story, though the substance of it may be
true: the affair of the wheel and axletree, for instance, like many
other vulgar traditions, may be only hyperbolically and not literally
true; and implying no more than, that be furnished himself for the
said conflict with certain rustic, ponderous and unusual weapons;
which blind tradition and stupid credulity afterwards converted into a
cartwheel and an axletree.
2. Saint Godric. He is said to have been a native of Walpole, and to
have originally followed the humble occupation or profession of a
Pedler. He afterwards went on pilgrimage to Rome, and even to
Jerusalem; but whether he relinquished his former profession before
he set off, or took his pedlery along with him, does not appear.
Some of the pilgrims of those times, it is said, used to engage,
clandestinely, in certain pedling, mercantile, or commercial
adventures, and to find their account in so doing, as the garb, or
profession of pilgrims exempted them from the tolls or duties
imposed upon mere pedlers, or merchants. Whether that was the
case with our Godric, or not, he acquired the character of a Saint,
and was canonized; which yet with some people will make no very
great deal in his favour. In the latter part of his life he became a
hermit, and lived sometime at Finchale near Durham, where he is
said to have worn out no less than three successive suits of iron
clothes, [123] which, with many, would be an indubitable proof that
his sanctity must have been far superior to that of the wearers of
flannel, coarse woollen, or even haircloth; by which kind of dresses
numbers of his brethren chose to distinguish themselves. Godric
died in 1170. Many miracles, of course, are ascribed to him; and his
girdle that he left, was said to have in it such uncommon and
wonderful virtue, as to make barren women fruitful.—After all, it
seems not quite clear, or certain, that he was a better man, or
worthier character than Hickifric.
3. Sir Frederic Tilney. He was one of the attendants and Captains of
Richard I, in his memorable expedition to the Holy Land, and was
knighted by that monarch, in his third year, at Acon or Acre,
otherwise Ptolemais—[a place rendered very famous during the
Crusades; especially by the heroic achievements of the lion-hearted
Richard and his followers; and no less so of late years, by its
obstinate and successful defence against the arms and repeated
assaults of Bonaparte.]—Sir Frederic Tilney was distinguished for his
great stature and vast bodily strength; being, perhaps, a descendant
of Hickifric. He survived the expedition to Palestine, and returned
safe to his native country, where he ended his days in peace, and
was buried with his ancestors at Terrington, by Tilney; that is, at St.
John’s, as it is supposed; where we are told his height was to be
seen as late as 1556.—Sixteen knights of the same name (and
supposed to be his descendants) succeeded him, most, if not all of
whom lived at Boston.
4. Richard de Tyrington. He is said to have been one of the great
favourites of King John, who granted him, for his life, an annuity of
twenty marks. Little more is known of him. But as a king’s
favourite, he must have been a noted man in his day. That king had
many favourites, it seems, in and about Lynn. No part of his
kingdom seemed to be more, if so much attached to him. His
favourites and adherents, and this Richard of Terrington among the
rest, may be presumed to be much of the same cast with their royal,
patron, and therefore the less said about them is best.
5. Sir Frederick Chervill, or Chervile, otherwise Kervile. He lived in
the reign of Henry III. and had considerable possessions in Tilney,
Islington, Wigenhale, and Clenchwarton. He was found, in the
thirty-fourth year of that king, to have a Gallows in Tilney, and the
liberty or power of trying and hanging offenders; by which it
appears, that he was in his time a person of no small consequence
and dignity in this country. He lived at the time when the Ouse
deserted its ancient course or channel by Wisbeach, and mixed with
the waters of Wigenhale and of Lynn. Of the qualities of his heart,
or his particular deeds, good or bad, no memorial now remains.—
The seat of the Kerviles, for many successive generations, was the
manor-house of Wigenhale St. Mary’s, of which only the gate-house
now remains, and is visible from the Wisbeach road. Its appearance
seems to indicate that the mansion formerly attached to it was in its
day a sumptuous edifice; and for no short period, perhaps, the first
house in all Marshland.
6. John Colton: a native of Terrington, chaplain to W. Bateman,
bishop of Norwich, and the first master of Gonvil-Hall in Cambridge.
Afterward, on account of his great learning and piety, (as it is said)
Henry IV. advanced him to the archbishopric of Armagh, and primacy
of Ireland. While in that high station he was sent to Rome, and
employed in the affair of the schism between Urban VI. and Clement
VII. which occasioned his writing a learned treatise (as Fuller says)
De causa Schismatis; and also another De remedio ejusd. He is
supposed to have resigned his archbishopric some time before his
death, which happened, it seems, in 1404. It does not appear that
he was one of the worst men of his order.
7. Walter Tirrington, LL.D. a celebrated writer and author, is said to
have been another native of Terrington. At what time he flourished,
is rather uncertain; though it seems not improbable, that he was
contemporary with Colton. Nor is it now known what these writings
were which made him so celebrated as an author. Whatever they
were, and they might be highly valuable in their time, they seem to
have been long ago swallowed up in the dark devouring abyss or
gulph of oblivion; and from which the very name of their author has
hardly escaped.
8. John Aylmer: born at Aylmer-Hall in Tilney, about 1521. When
very young, Henry Grey, Marquis of Dorset, afterward Duke of
Suffolk, took a great liking to him, entertained him as his scholar,
and gave him an exhibition at Cambridge, where his proficiency was
so considerable, that he was afterward deemed one of the best
scholars of his time. [126] From the University his noble patron took
him to his family, and made him tutor to his children, among whom
was the memorable Lady Jane Grey. He early imbibed the opinion
of the reformers, and was very instrumental, under the patronage of
the Duke of Suffolk, and the Earl of Huntingdon, in diffusing the
same about Leicestershire, (in which bounty was the Duke’s chief
seat and residence,) where he seems to have had some preferment,
and to have been tor sometime the only preacher of that
description. In time he was promoted to the archdeaconry of Stow,
in the diocese of Lincoln, which qualified him to sit in Convocation,
the first year of the reign of Mary, where he defended protestantism
with so much zeal, learning, and acuteness, that he was soon after
deprived of his archdeaconry, and obliged to abscond and quit the
kingdom, to avoid the approaching storm. After he had embarked
he was in no small danger from the searchers, who came onboard,
in quest of fugitives; but he happily escaped, partly through his own
diminutive size, (being of small stature like Zaccheus,) and partly
through the friendship of the Captain, who placed him in the empty
end of a wine butt, that had a partition in the middle, where he sat
very snugly, while the searchers were drinking wine, which they saw
drawn out of the other end. He was sometime after landed on the
continent, and got safe to Strasburgh, whence he shortly after
removed to Zurich, where he diligently prosecuted his studies, and
attended the Lectures of Peter Martyr. He afterwards visited most of
the universities of Italy and Germany, and at Jena, in Saxony, he had
the offer of the Hebrew Professorship, which he declined. After the
accession of Elizabeth he returned home, and was one of the divines
appointed to dispute at Westminster with an equal number of popish
bishops. He sometime after was made archdeacon of Lincoln; but
got no higher for a long while. At last, upon the translation of
Sandys to York, he was appointed his successor in the see of
London. This elevation he is said to have owed, in a great measure,
to the interest and friendship of that prelate, but which he afterward
very ill requited. He now forgot his former affection to the puritans,
and became a bitter persecutor. On Sunday afternoons he was fond
of playing at bowls, and would use such language at this game as
justly exposed him to reproach. When he happened to preach, if he
observed his audience inattentive, he would take a Hebrew bible out
of his pocket, and read them a few verses, and then resume his
discourse. [128a] He was a man of great courage, which he shewed
on many occasions; one of which was his having a tooth drawn, to
encourage the queen to submit to the like operation. Strype says,
he was a man of metal, and could use his hands and arms well, [128b]
and would turn his back on no man. Fuller says, he was foully
belibelled by the puritans; but does not say how much provocation
he had given them for so doing. He died at his Palace of Fulham,
June 3. 1594.
9. Sir Robert Aylmer, elder brother of the preceding, appears to have
been a person of some note in his time, and resided chiefly, as it is
supposed, at Aylmer Hall, above-mentioned; but as the particulars of
his history have not been recorded, and seem to be now entirely
forgotten, no more can be here said of him.
10. Thomas Herring. He was the Son of the reverend John Herring,
rector of Walsoken, where he was born in 1693. At a proper time he
was sent to Cambridge, and in 1722, became chaplain to Dr.
Fleetwood, bishop of Ely. In 1726 he was chosen preacher of
Lincoln’s Inn, and appointed king’s chaplain; in 1737 he was made
bishop of Bangor, and in 1743 was translated to York. When the
rebellion broke out, and the king’s troops were defeated at Preston
Pans, the archbishop convened the nobility, gentry, and clergy of his
diocese, and by an excellent speech removed the general panic, and
excited such zeal among his auditors, that a subscription to the
amount of 40,000l. was raised; and the example was followed in
most parts of the kingdom. On the death of Dr. Potter, in 1747, he
was advanced to Canterbury, and so attained to the very summit of
ecclesiastical preferment and dignity; but his health very soon began
to impair, and after languishing about four years, he died, in 1757,
leaving behind him a very amiable and excellent character, in spite of
the many disadvantages of his elevated situation, and his long
course of worldly prosperity. He appears to have been a real and
warm friend to civil and religious liberty, as well as one of the best
and worthiest men of the age in which he lived.
11. Dr. Richard Busby. He was not indeed born in Marshland, but
close by, at Lutton in Lincolnshire, in 1606. He had his education at
Westminster school, and afterward at Christ-Church, in Oxford. In
1640, he was appointed master of Westminster school, and by his
skill and diligence in that laborious and important office, for the
space of fifty five years, bred up the greatest number of eminent
men, in church and state that any teacher or tutor could boast of in
this, or perhaps in any other country. In his school discipline, he
was extremely and proverbially severe, though he applauded and
rewarded wit in his scholars, even when it reflected on himself.
After a long life of unwearied assiduity and temperance, he died, in
1695, at the age of 89.
Here it may not be improper to add, that the noble families of the
Howards and the Walpoles appear to have originated in Marshland.—
The ancestors of the former, sometime after the conquest, bore the
name of Wigenhale, or de Wigenhale, from that being their place of
residence, and where they had their most considerable possessions.
In the 12th century lived a notable person of this family, whose
name was Sir William de Wigenhale, and who, it seems, went
sometimes under the name of William de Clenchwarton, from his
having large possessions in that parish. John, the Son of this
William, in the 13th century, took the surname of Howard, (on what
account does not appear,) and his descendants have borne that
name ever since. William, the son of this John Howard, became one
of the most eminent lawyers and distinguished characters of his
time, being Lord Chief Justice of England, in the reign of Edward I.
and one of that King’s privy Council. He owned the manor of East
Winch, and the manor-house there appears to have been his
principal seat, and where the family chiefly resided for some
generations. In the chapel of St. Mary’s, on the south side of East
Winch church, supposed to have been built by him, he and many of
his earlier descendants are said to have been buried. The Howard
family continued to reside at East Winch till towards the close of the
14th Century, and perhaps longer. Sir William’s great grandson, Sir
Robert Howard, lived there, and there, it seems, he died and was
buried, in 1388.—Sir William Howard rendered much good service, of
some sort, to the corporation of Lynn, of which that body was not
insensible, as appears by divers presents, which he and his lady
received in return;—such as the carcase of an ox, one time, to lady
Howard, which, with the conveying of it to Winch, cost eleven
shillings, a sum equal, no doubt, to many pounds of our money.
Another time a present of wine, together with two calves, and a
collar, or shield of brawn, were sent as a present to Sir William, and
valued at thirteen shillings. Another time, two salmons were sent to
Sir William, on the vigil of Easter, valued at eleven shillings; [131]
which, compared with the value of the other articles, seems to
indicate, that salmon was a very great rarity at that period.—Such
was the origin of the far-famed House of Howard, which has been
long since divided into so many noble branches, and makes so
conspicuous a figure in the British Annals, and whose chief is now,
and has long been the first peer of the realm.
As to the Walpole family, it appears to be no less ancient than that
of the Howards, although it did not rise so soon to very great
eminence. Like the Howards, or rather the Wigenhales, it first
appeared among the opulent Marshland families, not long after the
conquest; but whether either of these families is of Saxon, Danish,
or Norman descent, does not appear. The Walpole family took its
name from the town of Walpole in Marshland, where the forefathers
of the family resided, and had large possessions. Reginald de
Walpole, who lived in the reign of Henry I. is thought the lineal
ancestor of the present family. His son, Richard de Walpole, married
Emma the daughter of Walter de Havelton (or de Houghton) of
Houghton, in Norfolk. From that time, the family, or the principal
branch of it, fixed its residence at Houghton, where it has continued
almost ever since. Sir John Walpole, knight, was a favourite of
Henry III. whom he accompanied in his expedition to Britany. His
son, Sir Henry de Walpole, was a Judge, about the 50th year of the
same king’s reign. Another of the family, Ralph de Walpole, was
about the same time bishop of Ely, and afterward of Norwich. [132]
Some of the family, at different times, long after the removal of one
branch to Houghton, appear to reside at Walpole; and in the reign of
Henry VII. we find the owner of Houghton residing at Lynn, as
appears by his Will, where he is called Thomas Walpole, Esquire, of
Lynne Bishop. In that Will, among other things, he leaves certain
lands and tenements at Walpole, “to the brodirhode of the Holy
Trinity at Lynne Bishop, to the intent the Alderman and Skyvens of
the said Gylde shall find and pay yerly eight marks to the wages of
an abil prest to synge mess perpetually for his sowl, and the sowl of
Jone his wife, in the chapel of our Lady, in the chapel of St. Nicholas
in Lynne.”—For many ages the Walpoles made no mean figure
among the Norfolk gentry; but none of them appear to have been
advanced to the peerage till the eighteenth century; since which
time, they have ranked among the principal nobility of the kingdom.
But of the whole race, from first to last, the most distinguished and
memorable character was the famous Sir Robert Walpole, prime
minister to our two first sovereigns, of the present dynasty, and
afterward created Earl of Orford; of whom some account will be
given in the next chapter, section IV.
Here it may be added, that the family of the Coneys has also, for
some ages, figured among the principal inhabitants of Marshland.
They seem however, to have been originally of Lynn, and to have
ranked, at a pretty distant period, among the principal people of that
town. Some of their modern descendants are said to have prided
themselves, not a little, on the score of their remote ancestry, but as
the remarkable, or memorable part of the history of those remote
ancestors of the family, or even the very names of more than one of
them, [134] have not yet come to the knowledge of the present
writer; it cannot be expected that he should say any more here
about them.—The pride of ancestry, or the plea of being descended
from renowned progenitors, is often very idle and childish, especially
when none of the eminent or estimable traits which distinguished
and characterized those progenitors are discoverable in their
descendants.

CHAP. III.
Of the parts about Lynn, on the eastern side of the Ouse.

Section I.

Aspect of the country—its agriculture and rural economy—


Wayland Wood—Memoir of Shuckforth—parish churches and
other edifices, ancient and modern.
After passing from Marshland to the eastern side of the Ouse, the
country presently begins to exhibit a very different appearance. The
surface now ceases to be flat and even as before, and the very soil
appears considerably altered and diversified. A light sandy soil soon
presents itself, and the land becomes higher and comparatively hilly,
as well as in general much less fertile and productive than in
Marshland. The style, or mode and process of agriculture also
differs considerably, as do likewise even the very implements of
husbandry. There are certainly some slovenly farmers on this
eastern side, but there are many others who manage their farms in
a manner greatly superior to what is generally done on the other
side of the river. Indeed the comparative poorness of the soil here
may operate in no small degree as a spur to superior exertion and
improvement. Where the land is poor nature requires the greater
attention and assistance; and without skilful, laborious, and
expensive management the cultivator cannot expect to thrive.
Those farmers who have distinguished themselves, by a close
attention to the pursuit of wise projects of agricultural improvement,
have found their account abundantly in so doing. They have
generally attained to considerable opulence, so as to be able to
exhibit the appearance of wealthy independent country gentleman,
instead of a servile, cringing yeomanry or tenantry. Not a few of
them are supposed to live as well as their landlords: but the conduct
of some of them towards the poor has been thought cruel and
tyrannical.
Dairies are said to be here rather neglected, and the farmers’
attention chiefly directed to tillage and the growing of corn. The
cheese is for the most part very ordinary and poor, and the butter
not excellent.—No part of England exceeds Norfolk, or even equals
it, in the culture of turnips, for which its loose, light, and sandy soil
is thought to be very favourable. Much dependence is here placed
on the turnip crop, for subsisting the sheep and cattle during the
winter season; and if it fail, or is materially injured by early frosts, or
other means, the complaints become loud, and the consequences
often prove serious and distressing.
The turnip was only cultivated in gardens, as a culinary plant in this
country till the reign of George I. when Lord Townshend, an
ancestor of the present marquis, who had attended the king to
Hanover, as secretary of state, observing the profit and utility of the
field cultivation of turnips in that electorate, on his return brought
with him the seed and recommended it to his tenants who occupied
land of a similar quality to that of Hanover. The experiment
succeeded adequate to expectation: the practice gradually spread
over the county, and made its way into other parts of the kingdom.
This important root, the great source of abundance to the county,
has been gradually rising to its present state, for upwards of seventy
years—A good acre of turnips in Norfolk will produce between thirty
and forty cart-loads, as heavy as three horses can draw; and an acre
will fat a Scotch bullock from forty to fifty stone, or eight sheep. But
the advantage of this crop does not end here, for it generally leaves
the land so clean and in such fine condition, that it almost insures a
good crop of barley, and a kind plant of clover; and the clover is a
most excellent preparative for wheat, so that in the subsequent
advantages the value of the turnip can hardly be estimated. It has
however been observed, that the cultivation of this root has reached
its acme; and that at present, from some latent causes, it is on the
decline: for recently more seed is become necessary, and the crop is
said to be more precarious. Some have attributed it to the want of
deeper ploughing, and instances have been adduced of the
extraordinary depth to which turnips, and even wheat will radicate.
This however has been thought insufficient to affix the cause of
failure to shallow ploughing. [137]
Among our enlightened agriculturists the first place in generally
allotted to those of Norfolk; and it has been observed, that the first
thing that attracts the eye of a stranger here, is the fine tilth of the
soil, and the succession of crops. The mode of cultivating the arable
lands is worthy, no doubt, of imitation, wherever it can be adopted.
The plough, which is of an admirable construction, is drawn by two
horses harnessed abreast, which with a pair of reins are guided by
the person who holds the plough. Instead of working the animals
seven or eight hours without drawing bit, as is the custom in some
counties, they are here worked eight hours in winter, and ten in
Summer, by two journeys, as they are termed, which enables them
to do considerably more than they would by one journey. The
ploughings are repeated till the land is high in tilth, when it is
completely pulverized with wheeled drags and harrows, which are
violently drawn by the horses being kept upon a trotting pace.
Owing to this rapid movement, the clods are very effectually broken,
and the land well prepared to receive the seed. After this is sown or
planted, the utmost attention is paid to keep the land free from
weeds. The ridiculous custom of letting the land lie idle one year in
every three, for the advantage of what is termed fallowing, is here
properly exploded. The necessity of it has been superceded, and
the reasons of it done away, by a judicious course of cropping; so
that one crop may fertilise as the other exhausts; and in this manner
are the lands cultivated like gardens, yielding various crops in
perpetual succession, to the mutual benefit of the landlord and
tenant; and of general utility to the public.
The mode of cropping in general practice is what is termed a
sixcourse shift—the first year wheat; second, barley, with or without
clover; third, turnips; fourth, barley or oates, with or without clover;
fifth, clover mown for hay; sixth, grazed and ploughed up for wheat
again. Some vary this mode by a five or a four course shift. Wheat
is a general crop over the whole county, but thrives best on the stiff
loamy lands. The lighter soils are favourable to barley, vast
quantities of which are raised, malted, and in that state sent out of
the county. Both wheat and barley are principally either drilled, for
which several kinds of ingeniously-contrived barrow-drills are used,
or else planted with the hand by women and children, called
dibbling. The latter is among the agricultural improvements that
have originated in this county: it is very generally practised, and its
superiority, in several respects, or circumstances, over the other
methods has been generally admitted. The quantities produced,
according to the seed sown, are very unequal in different parts of
the county. Lands, in the hundred of Flegg and Marshland, usually
bear six quarters of wheat per acre, and ten of oats; but in the very
light soils, the farmer is glad to obtain two quarters of oats, and
three of barley. The average crops of the whole county may be
stated at three quarters of wheat, and four of barley, and other
articles in proportion, per-acre. [139] Oats are mostly sown only as a
shifting crop, and seldom more is raised than what are consumed
within the county. Other crops are rye, buck wheat, peas, beans,
vetches or tares, coleseed, clovers, rye and other artificial grasses;
burnet; cocksfoot, chickary, cabbages, mangel wurzel, luzerne,
carrots, and potatoes. The latter, though so valuable a root, and in
other parts used as a preparatory crop for wheat, has not lately
been adopted as a field course in Norfolk. [140a] Flax and hemp, and
even mustard and saffron are grown in some parts about Marshland
and the Fens.—Improved implements and machines, to facilitate the
operations of husbandry, are here in the greatest variety and
perfection. Threshing machines are become general throughout the
county, as are also drills of all kinds; but a drill-roller has been
supposed to be peculiar to Norfolk. It is a large cast-iron cylinder,
with projecting rings round it, at about ten inches distance from
each other. This being drawn over the ploughed land makes
indentations, and the seed sown broad-cast chiefly falls into the
drills, and is thus regularly and better deposited than in the common
mode of sowing.—Among wheel-carriages the non descript one
called a wizzard, or hermaphrodite, is curious and remarkable; it is
the common cart, to which in harvest, or in pressing circumstances,
a couple of temporary forewheels are placed under the shafts, and
two oblique ladders to the frame, by which it is made to answer the
purpose of a waggon: in little farms, it is an object of no small utility,
and in large ones a great help in a busy season. [140b]
The fat cattle of these parts, except those sold at home to the
butchers, are commonly sent up to London, and sold in Smithfield
Market, by the authorized and sworn salesmen of that place, who
regularly remit the money afterwards to the respective owners, to
their entire satisfaction; for no murmurs against these salesmen, or
reflections unfavourable to their integrity are ever heard. One man,
commonly called a drover, generally takes charge of the disposable
cattle of a whole district, and among them sometimes very fierce
beasts, that would prove unmanageable to most other people, but
which he contrives to drive along with tolerable ease, assisted only
by a trusty and well-trained dog, his sagacious and constant
companion.
The country eastward of Lynn, towards Westacre and Swaffham,
soon becomes more and more elevated and hilly: the soil also, in
many places, is of a very inferior sort—and so light, loose, and
sandy, as to be easily, in its ploughed state, drifted by the wind; for
which the marl, that abounds about those parts, is the very best
manure, and almost the only effectual remedy; and it is generally
nigh at hand; often but a few feet beneath the surface, and under
the very soil that wants it. It is usually laid on very thick, and
seldom disappoints the farmer’s wish or expectation, unless the soil
be so incurably sterile as not to admit the marl’s incorporating with
it. Wonderful effects have often been produced by this marling,
upon lands that many would have deemed of invincible sterility.
Not far from the last mentioned town of Swaffham, between Watton
and Merton, is a place called Wayland Wood, which gives name to
the Hundred in which it lies. It is commonly called Wailing Wood,
and tradition has marked it out as the scene of the pitiable,
miserable, and horrid catastrophe recorded and commemorated in
the old and well-known ballad of “The Children in the Wood; or the
Norfolk Gentleman’s last will and testament.” The origin of the
tradition, or the time when that shocking event happened, cannot
now, it seems, be ascertained. Even Blomefield, with all his
antiquarian sagacity, and extensive means of information, was not
able to find it out. It was probably the occurrence of a very distant
period: but that it really did happen, the ballad and the tradition may
be considered as very sufficient proofs; and the latter renders it very
probable, or rather more than probable, that Wayland, or Wailing
Wood was the very theatre of its perpetration. Of the untimely and
tragical ends of helpless and friendless orphans, by the procurement
of unprincipled, unfeeling, and cruel relations, who were heirs to
their possessions, the history of rude and barbarous ages furnish but
too many and very shocking examples; and it is devoutly to be
wished that nothing of the kind, or nothing equally inhuman and
shocking, could be said of the history of what are usually called
civilized and enlightened times.
At Saham Tony, not far from Watton and Wayland Wood, lived in the
last century a remarkable person of the name of Shuckforth. He
was a gentleman of good property, and resided there on his own
estate. On some occasion, unknown to the present writer, he retired
from the world many years before he died, and gave himself up to
reading and meditation, and to the practice of piety and charity. His
religion appeared to be of that cast that is usually and assumingly
denominated orthodox and evangelical, with no slight tincture of
credulity, superstition, and fanaticism. These, however, as his life
was otherwise so inoffensive and fruitful of good works, lost in him a
great part of their deformity. His oddities and eccentricities induced
many of his neighbours, of the higher orders, to impute to him a
strong twist of insanity; while a great part of their own conduct
would have gone, perhaps, quite as far in supporting a similar
imputation against themselves. A course of life so singular,
unfashionable, and unadmired, as that which he chose and pursued,
might excite in many no small degree of surprize and disgust, but it
ought not to be taken as a proof of mental derangement. It was
probably the result of the sober exercise of his private judgement,
and of a full conviction that there was no other course in which he
could so well serve God and his fellow creatures, or promote his own
present and future happiness. He was seldom seen for many of his
latter years, except by a few domestics, one of whom was a
constant attendant, and employed to read to him, after his own
eyesight had failed. He is also supposed to have been the chief
agent to distribute his charities, in the mean time, among the
neighbouring poor and indigent. Close to his house he had a lime-
kiln erected, from an idea that the smell, or effluvia of burning lime
conduced to health and longevity. Thus he passed his time, in
innocent and useful retirement, during a great part of a very long
life. May his opulent survivors imitate his benevolence and
charitable actions, whatever they may think of his peculiarities. He
died in 1781, in his 91st. year, and was buried in one of his own
fields, in a spot which he had fixed upon, and enclosed for that
purpose, near twenty years before; and where he had erected a
tomb, or a kind of mausoleum, with a long inscription on each of its
four sides, or on four different stones. The inscriptions, as to the
style and substance of them, have no great merit. They possess no
elegance; and may be very truly said to be far more fanciful than
judicious. But of the writer’s good intention, no doubt ought to be
entertained. As he had in his lifetime distinguished himself by
numerous acts of benevolence, so at his death; and by his will, he
left divers charitable donations to the poor of Saham and the
neighbouring parishes. Thus did he, in life and in death, remember
the poor, and maintain the character of the poor man’s friend. The
blessing of the poor, and of those who were ready to perish he
doubtless obtained, and even the blessing and approbation of Him
who is the common parent, benefactor, and righteous judge of the
rich as well as the poor, the creator, sustainer, and ruler of the
universe.
The parish churches on this side the Ouse, for the most part, make
but a mean appearance, compared with those of Marshland and
Holland. Here are, however, and always have been other edifices
greatly superior to anything of the kind found in those districts: that
is, the sumptuous mansions and palaces, for which this county has
been long remarkable, and not inferior, perhaps, to any part of the
kingdom. Of these, the most distinguished, in former times, were,
Rising Castle, once a royal palace, and the residence, for many
years, of queen Isabel, the relict of Edward II; Gaywode Castle, the
principal mansion, for some ages, of the bishops of Norwich, and
one of the best houses, in the meantime, if not the very best, in the
whole county; Middleton Castle, the seat of Lord Scales; Wormegay
Castle, the seat of lord Bardolf; Castleacre, the seat of Earl Warren;
and Hunstanton Hall, the seat of the Lestranges.
Among the modern mansions, or palaces, in these parts, the most
distinguished is that of Lord Cholmondeley, at Houghton, built by the
famous Sir Robert Walpole; that of Thomas William Coke Esq. at
Holkham; and that of Lord Townshend, at Rainham. Besides these,
there are many others worthy of notice; such as that of Mr. Henley,
at Sandringham; that of Mr. Styleman, at Snettisham; that of Mr.
Rolfe, at Hitcham; that of Mr. Coldham, at Anmer; that of Sir Martin
Browne Folkes, at Hillington; that of Mr. Hamond, at Westacre; that
of Mr. Fountaine, at Narford; that of Mr. Tyssen, at Narborough; that
of Sir Richard Bedingfield, at Oxborough; that of Mr. Pratt, at
Ruston; that of Mr. Hare, at Stowe; that of Mr. Bell, at Wallington;
and that of Mr. Plestow, at Watlington; to which several others might
be added; but most, if not all of them, are of inferior consideration.

Section II.

You might also like