Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
100% found this document useful (8 votes)
41 views

PDF Microsoft Visual C 2010 An Introduction to Object Oriented Programming 4th Edition Joyce Farrell download

Microsoft

Uploaded by

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

PDF Microsoft Visual C 2010 An Introduction to Object Oriented Programming 4th Edition Joyce Farrell download

Microsoft

Uploaded by

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

Download the full version of the ebook at ebookname.

com

Microsoft Visual C 2010 An Introduction to Object


Oriented Programming 4th Edition Joyce Farrell

https://ebookname.com/product/microsoft-visual-c-2010-an-
introduction-to-object-oriented-programming-4th-edition-
joyce-farrell/

OR CLICK BUTTON

DOWNLOAD EBOOK

Download more ebook instantly today at https://ebookname.com


Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...

Object Oriented Programming Using C Fourth Edition Joyce


Farrell

https://ebookname.com/product/object-oriented-programming-using-c-
fourth-edition-joyce-farrell/

ebookname.com

Introduction to Object Oriented Programming An 3rd Edition


Timothy Budd

https://ebookname.com/product/introduction-to-object-oriented-
programming-an-3rd-edition-timothy-budd/

ebookname.com

Object Oriented Programming With C 4th Edition E.


Balagurusamy

https://ebookname.com/product/object-oriented-programming-with-c-4th-
edition-e-balagurusamy/

ebookname.com

Rockefeller Philanthropy and Modern Social Science 1st


Edition David L. Seim

https://ebookname.com/product/rockefeller-philanthropy-and-modern-
social-science-1st-edition-david-l-seim/

ebookname.com
Microbial Ecology 1st Edition Larry L. Barton

https://ebookname.com/product/microbial-ecology-1st-edition-larry-l-
barton/

ebookname.com

Hormones Cognition and Dementia State of the Art and


Emergent Therapeutic Strategies 1st Edition Eef Hogervorst

https://ebookname.com/product/hormones-cognition-and-dementia-state-
of-the-art-and-emergent-therapeutic-strategies-1st-edition-eef-
hogervorst/
ebookname.com

Basic Heat and Mass Transfer Third Edition Anthony F.


Mills

https://ebookname.com/product/basic-heat-and-mass-transfer-third-
edition-anthony-f-mills/

ebookname.com

Identity and Loss of Historical Memory The Destruction of


Archives Identities Identités Identidades English and
French Edition Igor Filippov (Editor)
https://ebookname.com/product/identity-and-loss-of-historical-memory-
the-destruction-of-archives-identities-identites-identidades-english-
and-french-edition-igor-filippov-editor/
ebookname.com

Introduction to Statistics in Psychology 6th Edition


Dennis Howitt

https://ebookname.com/product/introduction-to-statistics-in-
psychology-6th-edition-dennis-howitt/

ebookname.com
Elementary Number Theory 2nd Edition Underwood Dudley

https://ebookname.com/product/elementary-number-theory-2nd-edition-
underwood-dudley/

ebookname.com
Apago PDF Enhancer
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
Apago PDF Enhancer
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.
FOURTH EDITION

MICROSOFT®
VISUAL C#® 2010
AN INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING

Apago PDF Enhancer

J O Y C E FA R R E L L

Australia • Brazil • Japan • Korea • Mexico • Singapore • Spain • United Kingdom • United States
Microsoft® Visual C#® 2010: An © 2011 Course Technology, Cengage Learning
Introduction to Object-Oriented
ALL RIGHTS RESERVED. No part of this work covered by the copyright
Programming, Fourth Edition
herein may be reproduced, transmitted, stored, or used in any form or by
Joyce Farrell any means—graphic, electronic, or mechanical, including but not limited
to photocopying, recording, scanning, digitizing, taping, Web distribution,
Publisher: Nicole Pinard
information networks, or information storage and retrieval systems, except
Executive Editor: Marie Lee as permitted under Section 107 or 108 of the 1976 United States Copyright
Acquisitions Editor: Amy Jollymore Act—without the prior written permission of the publisher.

Senior Product Manager: Alyssa Pratt


Development Editor: Dan Seiter For product information and technology assistance, contact us at
Cengage Learning Customer & Sales Support, 1-800-354-9706
Content Project Manager: Lisa Weidenfeld
For permission to use material from this text or product,
Manufacturing Buyer: Julio Esperas submit all requests online at www.cengage.com/permissions
Proofreader: Brandy Lilly Further permissions questions can be e-mailed to
permissionrequest@cengage.com
Copyeditor: Michael Beckett
Indexer: Sharon Hilgenberg
Library of Congress Control Number: 2010930061
Art Director: Faith Brosnan
ISBN-13: 978-0-538-47951-6
Text Designer: Shawn Girsberger
ISBN-10: 0-538-47951-5
Cover Photo: iStockphoto.com/Dimitrije
Course Technology
Cover Designer: Bruce Bond 20 Channel Center Street
Editorial Assistant: Jacqueline Lacaire Boston, MA 02210
Art Director: Marissa Falco USA

Marketing Manager: Adam Marsh Apago Cengage


PDF Enhancer
Learning is a leading provider of customized learning solutions
with office locations around the globe, including Singapore, the United
Quality Assurance: Chris Scriver and Kingdom, Australia, Mexico, Brazil, and Japan. Locate your local office at:
Danielle Shaw www.cengage.com/global
Compositor: Integra Cengage Learning products are represented in Canada by
Nelson Education, Ltd.
To learn more about Course Technology, visit www.cengage.com/
coursetechnology
To learn more about Cengage Learning, visit www.cengage.com
Purchase any of our products at your local college store or at our preferred
online store www.cengagebrain.com
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.
Any fictional data related to people, companies, or URLs used throughout
this book is intended for instructional purposes only. At the time this book
was printed, any such data was fictional and not belonging to any real
people or companies.
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.
The programs in this book are for instructional purposes only. They have
been tested with care, but are not guaranteed for any particular intent
beyond educational purposes. The author and the publisher do not offer
any warranties or representations, nor do they accept any liabilities with
respect to the programs.

Printed in the United States of America


1 2 3 4 5 6 7 14 13 12 11 10
Brief Contents
iii

Pref ace . . . . . . . . . . . . . . . . . xv
CH AP TER 1 A F ir s t Prog ram Usi ng C# . . . . . . . . . 1
CH AP TER 2 U s in g Dat a . . . . . . . . . . . . . . . . 49
CH AP TER 3 U s in g GU I Obj ec ts and the V i sual
St u dio IDE . . . . . . . . . . . . . . . 103
CH AP TER 4 M ak in g Deci si o ns . . . . . . . . . . . . 142
CH AP TER 5 Lo o pin g . . . . . . . . . . . . . . . . 194
CH AP TER 6 U s in g Ar r a y s . . . . . . . . . . . . . . 232
CH AP TER 7 UApago
s in g M ethoPDF
ds . Enhancer
. . . . . . . . . . . . 273
CH AP TER 8 Advan ced Met ho d Concepts . . . . . . . . 315
CH AP TER 9 U s in g Clas ses a nd Obj ects . . . . . . . . 354
CH AP TER 10 In t ro du ct io n t o I nheri tance . . . . . . . . 427
CH AP TER 11 Except io n Hand l i ng . . . . . . . . . . . 490
CH AP TER 12 U s in g Co n t ro l s . . . . . . . . . . . . . 540
CH AP TER 13 H an dlin g E v ent s . . . . . . . . . . . . . 606
CH AP TER 14 F iles an d St ream s . . . . . . . . . . . . 656
CH AP TER 15 U s in g LINQ t o A ccess Data i n C#
Pro g r am s . . . . . . . . . . . . . . . . 708
BRIEF CONTENTS

AP PEN DIX A Oper at o r Pre cede nce And Associ ati v i ty . . . 764
AP PEN DIX B U n der s t an ding Numberi ng Sy stems
an d Co m pu t er Co des . . . . . . . . . . . 766
AP PEN DIX C U s in g T h e IDE E d i tor . . . . . . . . . . . 775
iv
Glo s s ar y . . . . . . . . . . . . . . . . 779
In dex . . . . . . . . . . . . . . . . . 799

Apago PDF Enhancer


Contents
v

Pref ace . . . . . . . . . . . . . . . . . xv

C HAP TER 1 A F ir s t Prog ram Usi ng C# . . . . . . . . . 1


Programming . . . . . . . . . . . . . . . . . . . . . . . 2
Procedural and Object-Oriented Programming . . . . . . . . 4
Features of Object-Oriented Programming Languages . . . . . 7
The C# Programming Language . . . . . . . . . . . . . . . 9
Writing a C# Program That Produces Output . . . . . . . . . 10
Selecting Identifiers . . . . . . . . . . . . . . . . . . . . 14
Improving Programs by Adding Comments and
Using the System Namespace . . . . . . . . . . . . . . 18
Adding Program Comments . . . . . . . . . . . . . . . . 18
Apago PDF Enhancer
Using the System Namespace . . . . . . . . . . . . . . 19
Writing and Compiling a C# Program . . . . . . . . . . . . 21
Compiling Code from the Command Prompt . . . . . . . . 21
Compiling Code within the Visual Studio IDE . . . . . . . . 24
You Do It . . . . . . . . . . . . . . . . . . . . . . . . . 26
Entering a Program into an Editor . . . . . . . . . . . . . 26
Compiling and Executing a Program from the
Command Line . . . . . . . . . . . . . . . . . . . . . 27
Compiling and Executing a Program Using
the Visual Studio IDE . . . . . . . . . . . . . . . . . . 29
Deciding Which Method to Use . . . . . . . . . . . . . . 35
Adding Comments to a Program . . . . . . . . . . . . . . 36
Chapter Summary . . . . . . . . . . . . . . . . . . . . . 37
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . 38
Review Questions . . . . . . . . . . . . . . . . . . . . . 42
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . 46

C HAP TER 2 U s in g Dat a . . . . . . . . . . . . . . . . 49


Declaring Variables . . . . . . . . . . . . . . . . . . . . 50
Displaying Variable Values . . . . . . . . . . . . . . . . . 54
CONTENTS

Using the Integral Data Types . . . . . . . . . . . . . . . . 58


Using Floating-Point Data Types . . . . . . . . . . . . . . . 60
Formatting Floating-Point Values . . . . . . . . . . . . . . 61
Using Arithmetic Operators . . . . . . . . . . . . . . . . . 63
Using Shortcut Arithmetic Operators . . . . . . . . . . . . 65
vi
Using the bool Data Type . . . . . . . . . . . . . . . . . 67
Understanding Numeric Type Conversion . . . . . . . . . . . 68
Using the char Data Type . . . . . . . . . . . . . . . . . 71
Using the string Data Type . . . . . . . . . . . . . . . . 73
Defining Named Constants . . . . . . . . . . . . . . . . . 77
Working with Enumerations . . . . . . . . . . . . . . . . 78
Accepting Console Input . . . . . . . . . . . . . . . . . . 80
You Do It . . . . . . . . . . . . . . . . . . . . . . . . . 82
Declaring and Using Variables . . . . . . . . . . . . . . . 82
Performing Arithmetic . . . . . . . . . . . . . . . . . . 84
Working with Boolean Variables . . . . . . . . . . . . . . 85
Using Escape Sequences . . . . . . . . . . . . . . . . . 86
Writing a Program that Accepts User Input . . . . . . . . . 87
Chapter Summary . . . . . . . . . . . . . . . . . . . . . 88
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . 89
Review Questions . . . . . . . . . . . . . . . . . . . . . 93
Apago PDF Enhancer
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . 97

C HAP TER 3 U s in g GU I Obj ect s and the V i sual


St u dio IDE . . . . . . . . . . . . . . . 103
Creating a Form in the IDE . . . . . . . . . . . . . . . . 104
Using the Toolbox to Add a Button to a Form . . . . . . . 109
Adding Functionality to a Button on a Form . . . . . . . 111
Adding Labels and TextBoxes to a Form . . . . . . . . 114
Formatting Data in GUI Applications . . . . . . . . . . . 119
Naming Forms and Controls . . . . . . . . . . . . . . . 119
Correcting Errors . . . . . . . . . . . . . . . . . . . . 121
Deleting an Unwanted Event-Handling Method . . . . . . . 123
Failing to Close a Form Before Attempting
to Reexecute a Program . . . . . . . . . . . . . . . 124
Using Visual Studio Help . . . . . . . . . . . . . . . . 124
Deciding Which Interface to Use . . . . . . . . . . . . . 125
You Do It . . . . . . . . . . . . . . . . . . . . . . . . 127
Working With the Visual Studio IDE . . . . . . . . . . . 127
Providing Functionality for a Button . . . . . . . . . . 131
Adding a Second Button to a Form . . . . . . . . . . 132
Chapter Summary . . . . . . . . . . . . . . . . . . . . 133
Key Terms . . . . . . . . . . . . . . . . . . . . . . . 134
CONTENTS

Review Questions . . . . . . . . . . . . . . . . . . . . 135


Exercises . . . . . . . . . . . . . . . . . . . . . . . . 139

C HAP TER 4 M ak in g Deci si o ns . . . . . . . . . . . . 142


Understanding Logic-Planning Tools
vii
and Decision Making . . . . . . . . . . . . . . . . . . 143
Making Decisions Using the if Statement . . . . . . . . . 146
A Note on Equivalency Comparisons . . . . . . . . . . . 152
Making Decisions Using the if-else Statement . . . . . . 152
Using Compound Expressions in if Statements . . . . . . 155
Using the Conditional AND Operator . . . . . . . . . . . 156
Using the Conditional OR Operator. . . . . . . . . . . . 157
Using the Logical AND and OR Operators. . . . . . . . . 158
Combining AND and OR Operators . . . . . . . . . . . . 159
Making Decisions Using the switch Statement . . . . . . 161
Using an Enumeration with a switch Statement . . . . . 165
Using the Conditional Operator . . . . . . . . . . . . . . 166
Using the NOT Operator . . . . . . . . . . . . . . . . . 167
Avoiding Common Errors When Making Decisions . . . . . . 169
Performing Accurate and Efficient Range Checks . . . . . 169
Apago PDF Enhancer
Using && and || Appropriately . . . . . . . . . . . . . 171
Using the ! Operator Correctly . . . . . . . . . . . . . 171
Decision-Making Issues in GUI Programs . . . . . . . . . . 173
You Do It . . . . . . . . . . . . . . . . . . . . . . . . 175
Using if-else Statements . . . . . . . . . . . . . . 175
Using AND and OR Logic . . . . . . . . . . . . . . . . 177
Chapter Summary . . . . . . . . . . . . . . . . . . . . 179
Key Terms . . . . . . . . . . . . . . . . . . . . . . . 181
Review Questions . . . . . . . . . . . . . . . . . . . . 183
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 188

C HAP TER 5 Lo o pin g . . . . . . . . . . . . . . . . 194


Using the while Loop . . . . . . . . . . . . . . . . . . 195
Using the for Loop . . . . . . . . . . . . . . . . . . . 201
Using the do Loop . . . . . . . . . . . . . . . . . . . . 204
Using Nested Loops . . . . . . . . . . . . . . . . . . . 207
Accumulating Totals . . . . . . . . . . . . . . . . . . . 210
Improving Loop Performance . . . . . . . . . . . . . . . 213
Looping Issues in GUI Programs. . . . . . . . . . . . . . 214
You Do It . . . . . . . . . . . . . . . . . . . . . . . . 217
Using a while Loop . . . . . . . . . . . . . . . . . . 217
Using for Loops . . . . . . . . . . . . . . . . . . . 218
CONTENTS

Chapter Summary . . . . . . . . . . . . . . . . . . . . 221


Key Terms . . . . . . . . . . . . . . . . . . . . . . . 222
Review Questions . . . . . . . . . . . . . . . . . . . . 223
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 227

viii C HAP TER 6 U s in g Ar r ays . . . . . . . . . . . . . . 232


Declaring an Array and Assigning Values
to Array Elements . . . . . . . . . . . . . . . . . . . 233
Initializing an Array . . . . . . . . . . . . . . . . . . . 235
Accessing Array Elements . . . . . . . . . . . . . . . . 237
Using the Length Property. . . . . . . . . . . . . . . 237
Using foreach . . . . . . . . . . . . . . . . . . . . 238
Using foreach with Enumerations . . . . . . . . . . . 239
Searching an Array Using a Loop . . . . . . . . . . . . . 240
Using a for Loop to Search an Array . . . . . . . . . . 241
Using a while Loop to Search an Array . . . . . . . . . 243
Searching an Array for a Range Match . . . . . . . . . . 245
Using the BinarySearch(), Sort(),
and Reverse() Methods . . . . . . . . . . . . . . . 247
Using the BinarySearch() Method . . . . . . . . . . 247
Using the Sort() Method . . . . . . . . . . . . . . . 249
Apago PDF Enhancer
Using the Reverse() Method . . . . . . . . . . . . . 250
Using Multidimensional Arrays . . . . . . . . . . . . . . 252
Array Issues In GUI Programs . . . . . . . . . . . . . . . 257
You Do It . . . . . . . . . . . . . . . . . . . . . . . . 259
Creating and Using an Array . . . . . . . . . . . . . . 259
Using the Sort() and Reverse() Methods . . . . . . 260
Chapter Summary . . . . . . . . . . . . . . . . . . . . 261
Key Terms . . . . . . . . . . . . . . . . . . . . . . . 263
Review Questions . . . . . . . . . . . . . . . . . . . . 264
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 268

C HAP TER 7 U s in g M et h o ds . . . . . . . . . . . . . 273


Understanding Methods and Implementation Hiding . . . . . 274
Understanding Implementation Hiding . . . . . . . . . . 275
Writing Methods with No Parameters
and No Return Value . . . . . . . . . . . . . . . . . . 276
Understanding Accessibility . . . . . . . . . . . . . . . 277
Understanding the Optional static Modifier . . . . . . . 278
Understanding the Return Type . . . . . . . . . . . . . 278
Understanding the Method Identifier . . . . . . . . . . . 279
Creating a Simple Method . . . . . . . . . . . . . . . 279
CONTENTS

Writing Methods That Require a Single Argument . . . . . . 281


Writing Methods That Require Multiple Arguments . . . . . . 285
Writing a Method That Returns a Value . . . . . . . . . . . 287
Writing a Method that Returns a Boolean Value . . . . . . 289
Passing an Array to a Method . . . . . . . . . . . . . . . 290
Alternate Ways to Write a Main() Method Header . . . . . 295 ix
Issues Using Methods in GUI Programs . . . . . . . . . . 297
Understanding Methods that are Automatically
Generated in the Visual Environment . . . . . . . . . . 297
Appreciating Scope in A GUI Program . . . . . . . . . . 298
Creating Methods to be Nonstatic when Associated
with a Form . . . . . . . . . . . . . . . . . . . . . 298
You Do It . . . . . . . . . . . . . . . . . . . . . . . . 299
Calling a Method . . . . . . . . . . . . . . . . . . . . 299
Writing a Method that Receives Parameters
and Returns a Value . . . . . . . . . . . . . . . . . 300
Chapter Summary . . . . . . . . . . . . . . . . . . . . 302
Key Terms . . . . . . . . . . . . . . . . . . . . . . . 303
Review Questions . . . . . . . . . . . . . . . . . . . . 305
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 309

C HAP TER 8
Apago PDF Enhancer
Advan ced Met ho d Concepts . . . . . . . . 315
Understanding Parameter Types. . . . . . . . . . . . . . 316
Using Mandatory Value Parameters . . . . . . . . . . . 316
Using Reference and Output Parameters . . . . . . . . . 318
Using Parameter Arrays . . . . . . . . . . . . . . . . 321
Overloading Methods. . . . . . . . . . . . . . . . . . . 323
Understanding Overload Resolution . . . . . . . . . . . 329
Understanding Built-In Overloaded Methods . . . . . . . . 330
Avoiding Ambiguous Methods . . . . . . . . . . . . . . . 332
Using Optional Parameters . . . . . . . . . . . . . . . . 334
Leaving Out Unnamed Arguments . . . . . . . . . . . . 336
Using Named Arguments . . . . . . . . . . . . . . . . 337
Overload Resolution with Named
and Optional Arguments . . . . . . . . . . . . . . . . 338
You Do It . . . . . . . . . . . . . . . . . . . . . . . . 339
Using Reference Parameters . . . . . . . . . . . . . . 339
Overloading Methods . . . . . . . . . . . . . . . . . . 341
Chapter Summary . . . . . . . . . . . . . . . . . . . . 342
Key Terms . . . . . . . . . . . . . . . . . . . . . . . 343
Review Questions . . . . . . . . . . . . . . . . . . . . 344
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 349
CONTENTS

C HAP TER 9 U s in g Clas s e s and Obj ects . . . . . . . . 354


Understanding Class Concepts . . . . . . . . . . . . . . 355
Creating a Class from Which Objects Can Be
Instantiated . . . . . . . . . . . . . . . . . . . . . . 357
Creating Instance Variables and Methods . . . . . . . . . 358
x Creating Objects. . . . . . . . . . . . . . . . . . . . . 361
Passing Objects to Methods . . . . . . . . . . . . . . 363
Creating Properties . . . . . . . . . . . . . . . . . . . 365
Using Auto-Implemented Properties . . . . . . . . . . . 369
More About public and private Access
Modifiers . . . . . . . . . . . . . . . . . . . . . . . 372
Understanding the this Reference . . . . . . . . . . . . 376
Understanding Constructors . . . . . . . . . . . . . . . 379
Passing Parameters to Constructors . . . . . . . . . . . 380
Overloading Constructors . . . . . . . . . . . . . . . . 381
Using Constructor Initializers . . . . . . . . . . . . . . 383
Using Object Initializers . . . . . . . . . . . . . . . . . 385
Overloading Operators . . . . . . . . . . . . . . . . . . 389
Declaring an Array of Objects . . . . . . . . . . . . . . . 394
Using the Sort() and BinarySearch() Methods
with Arrays of Objects . . . . . . . . . . . . . . . . 395
Apago PDF Enhancer
Understanding Destructors . . . . . . . . . . . . . . . . 399
Understanding GUI Application Objects . . . . . . . . . . 402
You Do It . . . . . . . . . . . . . . . . . . . . . . . . 404
Creating a Class and Objects . . . . . . . . . . . . . . 404
Using Auto-Implemented Properties . . . . . . . . . . . 407
Adding Overloaded Constructors To a Class . . . . . . . 407
Creating an Array of Objects . . . . . . . . . . . . . . 409
Chapter Summary . . . . . . . . . . . . . . . . . . . . 411
Key Terms . . . . . . . . . . . . . . . . . . . . . . . 413
Review Questions . . . . . . . . . . . . . . . . . . . . 416
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 420

C HAP TER 10 In t ro du ct io n t o I n heri tance . . . . . . . . 427


Understanding Inheritance . . . . . . . . . . . . . . . . 428
Understanding Inheritance Terminology . . . . . . . . . 431
Extending Classes . . . . . . . . . . . . . . . . . . . . 433
Using the protected Access Specifier . . . . . . . . . . 435
Overriding Base Class Methods . . . . . . . . . . . . . . 440
Accessing Base Class Methods from a Derived Class . . . 443
Understanding How a Derived Class Object “is an”
Instance of the Base Class . . . . . . . . . . . . . . . 445
Using the Object Class . . . . . . . . . . . . . . . . . 447
Using the Object Class’s GetType() Method . . . . . 449
CONTENTS

Using the Object Class’s ToString () Method . . . . . . 449


Using the Object Class’s Equals() Method . . . . . . 450
Using the Object Class’s GetHashCode() Method . . . 451
Working with Base Class Constructors . . . . . . . . . . . 453
Using Base Class Constructors That Require Arguments . . 454
Creating and Using Abstract Classes . . . . . . . . . . . 456 xi
Creating and Using Interfaces. . . . . . . . . . . . . . . 460
Using Extension Methods . . . . . . . . . . . . . . . . . 464
Recognizing Inheritance in GUI Applications
and Recapping the Benefits of Inheritance . . . . . . . . 467
You Do It . . . . . . . . . . . . . . . . . . . . . . . . 469
Extending a Class . . . . . . . . . . . . . . . . . . . 471
Using Base Class Members in a Derived Class . . . . . . 472
Adding Constructors to Base and Derived Classes . . . . 475
Chapter Summary . . . . . . . . . . . . . . . . . . . . 476
Key Terms . . . . . . . . . . . . . . . . . . . . . . . 477
Review Questions . . . . . . . . . . . . . . . . . . . . 479
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 483

CH AP TER 11 E xcept io n Hand l i ng . . . . . . . . . . . 490


Apago PDF Enhancer
Understanding Exceptions . . . . . . . . . . . . . . . . 491
Purposely Generating a SystemException . . . 493
Understanding Traditional and Object-Oriented
Error-Handling Methods . . . . . . . . . . . . . . . . . 495
Understanding Object-Oriented Exception-Handling
Methods . . . . . . . . . . . . . . . . . . . . . . . 496
Using the Exception Class’s ToString()Method
and Message Property . . . . . . . . . . . . . . . . . 499
Catching Multiple Exceptions . . . . . . . . . . . . . . 502
Using the finally Block . . . . . . . . . . . . . . . . 507
Handling Exceptions Thrown from Outside
Methods. . . . . . . . . . . . . . . . . . . . . . . . 509
Tracing Exceptions Through the Call Stack . . . . . . . 513
A Case Study: Using StackTrace . . . . . . . . . . . 514
Creating Your Own Exception Classes . . . . . . . . . . 518
Rethrowing an Exception . . . . . . . . . . . . . . . . 522
You Do It . . . . . . . . . . . . . . . . . . . . . . . . 524
Purposely Causing Exceptions . . . . . . . . . . . . 524
Handling Exceptions . . . . . . . . . . . . . . . . . 526
Catching Various Exception Types. . . . . . . . . . . 527
Chapter Summary . . . . . . . . . . . . . . . . . . . . 529
Key Terms . . . . . . . . . . . . . . . . . . . . . . . 530
Review Questions . . . . . . . . . . . . . . . . . . . . 531
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 536
CONTENTS

C HAP TER 12 U s in g Co n t ro l s . . . . . . . . . . . . . 540


Understanding Controls . . . . . . . . . . . . . . . . 541
Examining the IDE’s Automatically Generated Code . . . . . 545
Setting a Control’s Font . . . . . . . . . . . . . . . . 549
Using a LinkLabel . . . . . . . . . . . . . . . . . . . 551
xii Adding Color to a Form . . . . . . . . . . . . . . . . . 555
Using CheckBox and RadioButton Objects . . . . . . . 557
Adding a PictureBox to a Form . . . . . . . . . . . . 561
Adding ListBox, CheckedListBox, and ComboBox
Controls to a Form . . . . . . . . . . . . . . . . . 564
Adding MonthCalendar and DateTimePicker
Controls to a Form . . . . . . . . . . . . . . . . . 569
Working with a Form’s Layout . . . . . . . . . . . . . . 573
Understanding GroupBoxes and Panels . . . . . . . . 576
Adding a MenuStrip to a Form . . . . . . . . . . . . . 577
Using Other Controls . . . . . . . . . . . . . . . . . 580
You Do It . . . . . . . . . . . . . . . . . . . . . . . . 580
Adding Labels to a Form and Changing their
Properties . . . . . . . . . . . . . . . . . . . . . . 580
Examining the Code Generated by the IDE . . . . . . . . 583
Adding CheckBoxes to a Form . . . . . . . . . .
Apago PDF Enhancer . . . 586
Adding RadioButtons to a Form . . . . . . . . . . . 592
Chapter Summary . . . . . . . . . . . . . . . . . . . . 595
Key Terms . . . . . . . . . . . . . . . . . . . . . . . 597
Review Questions . . . . . . . . . . . . . . . . . . . . 598
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 602

CH APTER 13 Han dlin g E ve nt s . . . . . . . . . . . . . 606


Event Handling . . . . . . . . . . . . . . . . . . . . . 607
Understanding Delegates . . . . . . . . . . . . . . . . . 611
Creating Composed Delegates . . . . . . . . . . . . . 613
Declaring Your Own Events and Handlers and Using
the Built-in EventHandler. . . . . . . . . . . . . . . 615
Using the Built-in EventHandler . . . . . . . . . . . . 619
Handling Control Component Events. . . . . . . . . . . 621
Handling Mouse and Keyboard Events . . . . . . . . . . . 626
Handling Mouse Events . . . . . . . . . . . . . . . . . 626
Handling Keyboard Events . . . . . . . . . . . . . . . 628
Managing Multiple Controls . . . . . . . . . . . . . . . 631
Defining Focus. . . . . . . . . . . . . . . . . . . . . 631
Handling Multiple Events with a Single Handler . . . . . . 632
Continuing to Learn about Controls and Events . . . . . . 635
CONTENTS

You Do It . . . . . . . . . . . . . . . . . . . . . . . . 635
Creating Delegates. . . . . . . . . . . . . . . . . . . 635
Creating a Composed Delegate . . . . . . . . . . . . . 637
Creating a Delegate that Encapsulates Instance
Methods . . . . . . . . . . . . . . . . . . . . . . . 640
Creating an Event Listener . . . . . . . . . . . . . . . 642 xiii
Using TabIndex . . . . . . . . . . . . . . . . . . . 644
Associating One Method with Multiple Events . . . . . . . 645
Chapter Summary . . . . . . . . . . . . . . . . . . . . 646
Key Terms . . . . . . . . . . . . . . . . . . . . . . . 648
Review Questions . . . . . . . . . . . . . . . . . . . . 648
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 653

C HAP TER 14 F iles an d St ream s . . . . . . . . . . . . 656


Computer Files and the File and Directory
Classes . . . . . . . . . . . . . . . . . . . . . . . . 657
Using the File and Directory Classes . . . . . . . . . 658
Understanding Data Organization Within a File . . . . . . . 662
Understanding Streams . . . . . . . . . . . . . . . . . 665
Writing to and Reading From a Sequential Access
Text File . . . . . . . . . . . . . . . . . . .
Apago PDF Enhancer . . . . . 669
Writing Data to a Sequential Access Text File . . . . . . . 669
Reading from a Sequential Access Text File . . . . . . . 672
Searching a Sequential Text File. . . . . . . . . . . . . . 675
Understanding Serialization and Deserialization . . . . . . . 678
You Do It . . . . . . . . . . . . . . . . . . . . . . . . 682
Creating a File . . . . . . . . . . . . . . . . . . . . . 682
Reading from a File . . . . . . . . . . . . . . . . . . 684
Using the Seek() Method . . . . . . . . . . . . . . . 685
Creating a Text File in a GUI Environment . . . . . . . . . 687
Reading Data from a Text File into a Form . . . . . . . . 691
Chapter Summary . . . . . . . . . . . . . . . . . . . . 696
Key Terms . . . . . . . . . . . . . . . . . . . . . . . 698
Review Questions . . . . . . . . . . . . . . . . . . . . 700
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 704

C HAP TER 15 U s in g LINQ t o A ccess Data


in C# Pro gram s . . . . . . . . . . . . . 708
Understanding Relational Database Fundamentals . . . . . . 709
Creating Databases and Table Descriptions . . . . . . . . 712
Identifying Primary Keys . . . . . . . . . . . . . . . . 714
Understanding Database Structure Notation . . . . . . . 715
CONTENTS

Creating SQL Queries . . . . . . . . . . . . . . . . . . 716


Creating an Access Database . . . . . . . . . . . . . . . 718
Understanding Implicitly Typed Variables . . . . . . . . . . 721
Understanding LINQ . . . . . . . . . . . . . . . . . . . 723
Retrieving Data from an Access Database in C# . . . . . . 727
xiv
Using LINQ Queries with an Access Database Table . . . . . 731
Using LINQ Operators to Sort and Group Data . . . . . . . 736
You Do It . . . . . . . . . . . . . . . . . . . . . . . . 740
Adding a Dataset to a Project . . . . . . . . . . . . . . 740
Querying a Dataset. . . . . . . . . . . . . . . . . . . 743
Allowing the User to Provide Selection Criteria . . . . . . 744
Grouping Data . . . . . . . . . . . . . . . . . . . . . 747
Chapter Summary . . . . . . . . . . . . . . . . . . . . 750
Key Terms . . . . . . . . . . . . . . . . . . . . . . . 752
Review Questions . . . . . . . . . . . . . . . . . . . . 754
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 758

AP PEN DIX A Oper at o r Pre cede nce And Associ ati v i ty . . . 764

AP PEN DIX B U n der s t an ding Numberi ng Sy stems


an dApago
Co m pu t erPDFCo desEnhancer
. . . . . . . . . . . 766

AP PEN DIX C U s in g T h e IDE E d i tor . . . . . . . . . . . 775

Glo s s ar y . . . . . . . . . . . . . . . . 779

In dex . . . . . . . . . . . . . . . . . 799
Preface
xv

Microsoft Visual C# 2010, Fourth edition provides the beginning


programmer with a guide to developing programs in C#. C# is a
language developed by the Microsoft Corporation as part of the
.NET Framework and Visual Studio platform. The .NET Framework
contains a wealth of libraries for developing applications for the
Windows family of operating systems. With C#, you can build small,
reusable components that are well-suited to Web-based program-
ming applications. Although similar to Java and C++, many features
of C# make it easier to learn and ideal for the beginning programmer.
You can program in C# using a simple text editor and the command
prompt, or you can manipulate program components using Visual
Studio’s sophisticated Integrated Development Environment. This
book provides you with the tools to use both techniques.
This textbook assumes that you have little or no programming
Apago PDF Enhancer
experience. The writing is nontechnical and emphasizes good pro-
gramming 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 you become lost following
irrelevant and extraneous details. This book provides you with a solid
background in good object-oriented programming techniques and
introduces you to object-oriented terminology using clear, familiar
language.

Organization and Coverage


Microsoft Visual C# 2010 presents C# programming concepts,
enforcing good style, logical thinking, and the object-oriented
paradigm. Chapter 1 introduces you to the language by letting you
create working C# programs using both the simple command line and
the Visual Studio environment. In Chapter 2 you learn about data and
how to input, store, and output data in C#. Chapter 3 provides a quick
start to creating GUI applications. You can take two approaches:
• You can cover Chapter 3 and learn about GUI objects so that you
can create more visually interesting applications in the subsequent
P R E FA C E

chapters on decision making, looping, and array manipulation.


These subsequent chapters confine GUI examples to the end of the
chapters, so you can postpone GUI manipulation if you want.
• You can skip Chapter 3 until learning the fundamentals of decision
making, looping, and array manipulation, and until studying
xvi object-oriented concepts such as classes, objects, polymorphism,
inheritance, and exception handling. Then, after Chapter 11, you
can return to Chapter 3 and use the built-in GUI component
classes with a deeper understanding of how they work.
In Chapters 4, 5, and 6, you learn about the classic programming
structures—making decisions, looping, and manipulating arrays—and
how to implement them in C#. Chapters 7 and 8 provide a thorough
study of methods, including passing parameters into and out of
methods and overloading them.
Chapter 9 introduces the object-oriented concepts of classes,
objects, data hiding, constructors, and destructors. After completing
Chapters 10 and 11, you will be thoroughly grounded in the object-
oriented concepts of inheritance and exception handling, and will
be able to take advantage of both features in your C# programs.
Chapter 12 continues the discussion of GUI objects from Chapter 3.
You will learn about controls, how to set their properties, and how
Apago PDF Enhancer
to make attractive, useful, graphical, and interactive programs.
Chapter 13 takes you further into the intricacies of handling events
in your interactive GUI programs. In Chapter 14, you learn to save
data to and retrieve data from files. In Chapter 15 you learn how to
interact with databases in C# programs—an increasingly valuable
skill in the information-driven business world. C# supports LINQ
(Language INtegrated Query) statements, which allow you to
integrate SQL-like queries into C# programs; Chapter 15 provides
you with the fundamentals of this important technology.

New to this Edition!


Microsoft Visual C# 2010 is a superior textbook because it also
includes the following new features:
C# 4.0 IN VISUAL STUDIO 2010 This edition is written and tested
using the latest edition of C#.
VIDEO LESSONS Each chapter includes three or more video les-
sons produced by the author. These short videos provide instruc-
tion, further explanation, or background about a topic covered in the
corresponding chapter. These videos are especially useful for online
classes, for student review before exams, and for students who are
audio learners.
P R E FA C E

EARLY GUI APPLICATIONS Students now can begin to cre-


ate GUI applications in Chapter 3. The earlier introduction helps
engage students who have used GUI applications their entire lives.
In subsequent chapters on selections, loops, arrays, and methods,
students apply concepts to applications in both console and GUI
environments. This keeps some examples simple while increasing the
xvii
understanding that input, processing, and output are programming
universals no matter what interface is used. The book is structured
so that students who want to skip Chapter 3 until they understand
object-oriented programming can do so with no loss of continuity.
EXPANDED COVERAGE OF METHODS Instructions for using
methods have been expanded and divided into two chapters. The
introductory method chapter covers the basics of calling methods,
passing arguments, and returning values. The advanced chapter dis-
cusses reference parameters, output parameters, optional parameters,
parameter arrays, overloading methods, and avoiding ambiguity.
(Optional parameters are a new feature in C# 4.0.)
MORE ENGAGING EXERCISES ON SPECIFIC TOPICS Many
chapters have additional exercises that employ string manipulation and
enumerations. Gaming exercises have been added to many chapters.

Apago PDF Enhancer


Features of the Text
Microsoft Visual C# 2010 also includes the following features:
OBJECTIVES Each chapter begins with a list of objectives so you
know the topics that will be presented in the chapter. In addition to
providing a quick reference to topics covered, this feature offers a use-
ful study aid.
NOTES These tips provide additional information—for
example, an alternative method of performing a procedure,
another term for a concept, background information on a
technique, or a common error to avoid.

FIGURES Each chapter contains many figures. Code figures are


most frequently 25 lines or shorter, illustrating one concept at a time.
Frequently placed screen shots show exactly how program output
appears. In this edition, all C# keywords that appear in figures are
bold to help them stand out from programmer-created identifiers.
SUMMARIES Following each chapter is a summary that recaps the
programming concepts and techniques covered in the chapter. This
feature helps you to recap and check your understanding of the main
points in each chapter.
P R E FA C E

KEY TERMS Each chapter includes a list of newly introduced vocab-


ulary, shown in the order of appearance in the text. The list of key
terms provides a review of the major concepts in the chapter.
YOU DO IT In each chapter, step-by-step exercises help the student
create multiple working programs that emphasize the logic a pro-
xviii grammer uses in choosing statements. This section enables students
to achieve success on their own—even students in online or distance
learning classes.
TWO TRUTHS AND A LIE This short quiz appears after each main
chapter section, with answers provided. This quiz contains three
statements—two true and one false—and the student must identify
the false one. 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 quizzes
provide students with immediate feedback as they read, without “giv-
ing away” answers to the existing multiple-choice and programming
problem questions.
REVIEW QUESTIONS Each chapter contains 20 multiple-choice
review questions that provide a review of the key concepts in the chapter.
EXERCISES Each chapter concludes with meaningful programming
Apago PDF Enhancer
exercises that provide additional practice of the skills and concepts
you learned in the chapter. These exercises increase in difficulty and
allow you to explore logical programming concepts.
DEBUGGING EXERCISES Each chapter contains four pro-
grams that have syntax and/or logical errors for you to fix.
Completing these exercises provides valuable experience in
locating errors, interpreting code written by others, and observ-
ing how another programmer has approached a problem.
UP FOR DISCUSSION Each chapter concludes with a few
thought-provoking questions that concern programming in
general or C# in particular. The questions can be used to
start classroom or online discussions, or to develop and
encourage research, writing, and language skills.
PROGRAM CODE The downloadable student files provide code for
each full program presented in the chapter figures. Providing the code
on disk allows students to run it, view the results for themselves, and
experiment with multiple input values. Having the code on disk also
enables students to experiment with the code without a lot of typing.
GLOSSARY A glossary contains definitions for all key terms in the
book, presented in alphabetical order.
P R E FA C E

QUALITY Every program example in the book, as well as every exer-


cise, case project, and game solution, was tested by the author and
again by a Quality Assurance team using Visual Studio 2010.

Instructor Resources
xix
The following supplemental materials are available when this book is
used in a classroom setting. All of the teaching tools for this book are
provided to the instructor on a single CD-ROM, and are also avail-
able for download at the companion site for the text (www.cengage.
com/coursetechnology).
ELECTRONIC INSTRUCTOR’S MANUAL The Instructor’s Manual
that accompanies this textbook includes:
• Additional instructional material to assist in class preparation,
including suggestions for lecture topics.
• Solutions to Review Questions, end-of-chapter programming exer-
cises, debugging exercises, and Up For Discussion questions.
®
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
Apago PDF Enhancer
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 testing components allow students to take exams at their com-
puters, and save the instructor time by grading each exam automatically.
POWERPOINT PRESENTATIONS This book comes with Microsoft
PowerPoint slides for each chapter. These slides are included as a
teaching aid for classroom presentation; teachers can make them
available on the network for chapter review or print them for class-
room distribution. Instructors can add their own slides for additional
topics they introduce to the class.
SOLUTION FILES Solutions to all “You Do It” exercises and end-of
chapter exercises are provided on the Instructor Resources CD-ROM
and on the Course Technology Web site at www.cengage.com/
coursetechnology. The solutions are password protected.
DISTANCE LEARNING Cengage Learning is proud to present online
test banks in WebCT and Blackboard to provide the most complete
and dynamic learning experience possible. Instructors are encouraged
to make the most of the course, both online and offline. For more
information on how to access the online test bank, contact your local
Course Technology sales representative.
P R E FA C E

Acknowledgments
I would like to thank all of the people who helped to make this book
a reality, especially Dan Seiter, the development editor, who once
again worked against multiple, aggressive deadlines to make this
book into a superior instructional tool. Thanks also to Alyssa Pratt,
xx Senior Product Manager; Amy Jollymore, Acquisitions Editor; and
Lisa Weidenfeld, Content Project Manager. I am grateful to be able to
work with so many fine people who are dedicated to producing good
instructional materials.
I am also grateful to the many reviewers who provided helpful
comments and encouragement during this book’s development,
including Matthew Butcher, Mohave Community College;
Dan Guilmette, Cochise College; and Jorge Vallejos, Columbus
State Community College.
Thanks, too, to my husband, Geoff, for his constant support and
encouragement. Finally, this book is dedicated to Andrea and Forrest,
wishing them a lifetime of happiness together.
Joyce Farrell

Apago PDF Enhancer


Read This
Before You
Begin
xxi

To the User
To complete the debugging exercises in this book, you will need data
files that have been created specifically for the book. Your instructor
will provide the data files to you. You also can obtain the files
electronically from the Course Technology Web site by connecting to
www.cengage.com/coursetechnology and then searching for this book
Apago PDF Enhancer
title. Note that you can use a computer in your school lab or your
own computer to complete the exercises in this book.
The data files for this book are organized such that the examples and
exercises are divided into folders named Chapter.xx, where xx is the
chapter number. You can save these files in the same folders unless
specifically instructed to do otherwise in the chapter.

Using Your Own Computer


To use your own computer to complete the steps and exercises, you
will need the following:
SOFTWARE Microsoft Visual C# 2010, including the Microsoft.NET
Framework. If your book came with a copy of the software, you may
install it on your computer and use it to complete the material.
HARDWARE Minimum requirements identified by Microsoft are a
1.6 GHz CPU, 1024 MB of RAM, 3 GB of available hard disk space,
5400 RPM hard disk drive, DirectX 9-capable video card that runs at
1280×1024 or higher display resolution, and a DVD-ROM drive.
OPERATING SYSTEM Windows 7, Vista, or XP.
BEFORE YOU BEGIN

DATA FILES You will not be able to complete the debugging exer-
cises in this book using your own computer unless you have the data
files. You can get the data files from your instructor, or you can obtain
them electronically from the Course Technology Web site by con-
necting to www.cengage.com/coursetechnology and searching for this
book title. Additionally, the data files include code for every example
xxii
shown in a figure in the book.

To the Instructor
To complete the debugging exercises and chapters in this book, your
users must work with a set of data files. These files are included on
the Instructor Resources CD. You can also obtain these files electron-
ically through the Course Technology Web site at www.cengage.com/
coursetechnology. Follow the instructions in the Help file to copy the
user files to your server or stand-alone computer. You can view the
Help file using a text editor such as WordPad or Notepad.
Once the files are copied, you can make copies for the users yourself
or tell them where to find the files so they can make their own copies.

License
Apago to Use
PDFDataEnhancer
Files
You are granted a license to copy the files that accompany this book
to any computer or computer network used by people who have
purchased this book.
A First Program
CHAPTER 1
Using C#

In this chapter you will:

 Learn about programming


 Learn about
Apago PDF
procedural Enhancerprogramming
and object-oriented
 Learn about the features of object-oriented programming
languages
 Learn about the C# programming language
 Write a C# program that produces output
 Learn how to select identifiers to use within your programs
 Improve programs by adding comments and using the
System namespace
 Write and compile a C# program using the command
prompt and using Visual Studio
Random documents with unrelated
content Scribd suggests to you:
[14] The Acanths of the Coal Measures possess the cranial
buckler.
[15] Professor Owen, in fixing the homologies of the ichthyic
head, differs considerably from Cuvier; but his view seems to be
demonstrably the correct one. It will, however, be seen, that in
my attempted comparison of the divisions of the ancient ganoid
cranium with those of the craniums of existing fishes, the points
at issue between the two great naturalists are not involved,
otherwise than as mere questions of words. The matter to be
determined, for instance, is not whether plate A in the skulls of
the cod and Coccosteus be the homologue of a part of the
occipital or that of a part of the parietal bones, but whether plate
A in the Coccosteus be the homologue of plate A in the cod. The
letters employed I have borrowed from Agassiz’s restoration of
the Coccosteus; whereas the figures intimate divisions which the
imperfect keeping of the specimens on which the ichthyologist
founded did not enable him to detect.
[16] The jaws (10, 10) which exhibit in the print their greatest
breadth, would have presented in the animal, seen from beneath,
their narrow under-edges, and have nearly fallen into the line of
the sub-opercular plates, (13, 13.)
[17] In all probability it is likewise the principle of the placoid
skull. The numerous osseous points by which the latter is
encrusted, each capable of increase at the edges, seem the
minute bricks of an ample dome. It is possible, however, that new
points may be formed in the interstices between the first formed
ones, as what anatomists term the triquetra or Wormiana form
between the serrated edges of the lambdoidal suture in the
human skull; and that the osseous surface of the cerebral dome
may thus extend, as the dome itself increases in size, not through
the growth of the previously existing pieces,—the minute bricks of
my illustration,—but through the addition of new ones. Equally, in
either case, however, that essential difference between the
placoid skull and the placoid vertebra, to which I have referred,
appears to hinge on the circumstance, that while the osseous
nucleus of each vertebral centrum could form, in even its most
complicated shape, from a single point, the osseous walls of the
cranium had to be formed from hundreds. The accompanying
diagram serves to show after what manner the vertebral centrum
in the Ray enlarges with the growth of the animal, by addition of
bony matter external to the point in the middle, at which
ossification first begins. The horizontal lines indicate the lines of
increment in the two internal cones which each centrum
comprises, and the vertical ones the lines of increment in the
lateral pillars.

Fig. 23.

SECTION OF VERTEBRAL
CENTRUM OF
THORNBACK.
[18] One of the Thurso coprolites in my possession is about
one fourth longer than the larger of the two specimens figured
here, and nearly thrice as broad.
[19] In two of these, in a collection of several score, I have
failed to detect the spiral markings, though their state of keeping
is decidedly good. There are other appearances which lead me to
suspect that the Asterolepis was not the only large fish of the
Lower Old Red Sandstone; but my facts on the subject are too
inconclusive to justify aught more than sedulous inquiry.
[20] The shaded plate, (a,) accidentally presented in this
specimen, belongs to the upper part of the head. It is the
posterior frontal plate F, which half-encircled the eye orbit, (see
fig. 29;) and I have introduced it into the print here, as in none of
the other prints, or of any other specimens, is its upper surface
shown.
[21] The late Mr. John Thurston.
[22] “Mr. Phillips proceeded to describe some remains of a
small fish, resembling the Cheiracanthus of the Old Red
Sandstone, scales and spines of which he had found in a quarry
at Hales End, on the western side of the Malverns. The section
presented beds of the Old Red Sandstone inclined to the west;
beneath these were arenaceous beds of a lighter color, forming
the junction with Silurian shales; these, again, passing on to
calcareous beds in the lower part of the quarry, containing the
corals and shells of the Aymestry Limestone, of their agreement
with which stronger evidence might be obtained elsewhere. He
had found none of these scales in the junction beds or in the
Upper Ludlow Shales; but about sixty or one hundred feet lower,
just above the Aymestry Limestone, his attention had been
attracted to discolored spots on the surface of the beds, which,
upon microscopic examination, proved to be the minute scales
and spines before mentioned. These remains were only apparent
on the surface, whilst the ‘fish-bed’ of the Upper Ludlow rock, as
it usually occurred, was an inch thick, consisting of innumerable
small teeth and spines.”—Report, in “Athenæum” for 1842, of the
Proceedings of the Twelfth Meeting of British Association,
(Manchester.)
[23] “This is the lowest position” (that of the Onondago
Limestone) “in the State of New York in which any remains have
been found higher in the scale of organized beings than
Crustacea, with the exception of an imperfectly preserved fish-
bone discovered by Hall in the Oriskany Sandstone. That
specimen, together with the defensive fish-bone found in this part
of the New York system, furnishes evidences of the existence of
animals belonging to the class vertebrata during the deposition of
the middle part of the protozoic strata.”—American Journal of
Science and Arts for 1846, p. 63.
[24] “The shales alternating with the Wenlock Limestone.”
(Edinburgh Review.)
[25] The Silurian Placoids are most adequately represented by
the Cestracion of the southern hemisphere; but I know not that
of the peculiar character and instincts of this interesting Placoid,
—the last of its race,—there is any thing known. For its form and
general appearance see fig. 49, page 177.
[26] Such as the dog-fishes, picked and spotted.
[27] The twelfth in Spinax Acanthius, and the fourteenth in
Scyllium Stellare.
[28] It will scarce be urged against the degradation theory, that
those races which, tried by the tests of defect or misplacement of
parts, we deem degraded, are not less fitted for carrying on what
in their own little spheres is the proper business of life, than the
non-degraded orders and families. The objection is, however, a
possible one, and one which a single remark may serve to
obviate. It is certainly true that the degraded families are
thoroughly fitted for the performance of all the work given them
to do. They greatly increase when placed in favorable
circumstances, and, when vigorous and thriving, enjoy existence.
But then the same may be said of all animals, without reference
to their place in the scale;—the mollusc is as thoroughly adapted
to its circumstances and as fitted to accomplish the end proper to
its being, as the mammiferous quadruped, and the mammiferous
quadruped as man himself; but the fact of perfect adaptation in
no degree invalidates the other not less certain fact of difference
of rank, nor proves that the mollusc is equal to the quadruped, or
the quadruped to man. And, of course, the remark equally bears
on the reduced as on the unelevated,—on lowness of place when
a result of degradation in races pertaining to a higher division of
animals, as on lowness of place when a result of the humble
standing of the division to which the races belong.
[29] The vertebral column in the genus Diplopterus ran, as in
the placoid genus Scyllium, nearly through the middle of the
caudal fin.
[30] In the following diagram a few simple lines serve to exhibit
the progress of degradation. Fig. a represents the symmetrical
Placoids of the Silurian period, consisting of head, neck, body,
tail, fore limbs and hinder limbs; fig. b represents those
heterocercal Ganoids of the Old Red Sandstone, Coal Measures,
and Permian System, in which the neck is extinguished, and the
fore limbs stuck on to the occiput; fig. c, those homocercal
Ganoids of the Trias Lias, Oolite, and Wealden, whose tails spread
out into broad terminal processes, without homologue in the
higher animals; fig. d, those Acanthopterygii of the Chalk that, in
addition to the non-homological processes, have both fore limbs
and hinder limbs stuck round the head; while fig. e represents the
asymmetrical Platessa, of the same period, with one of its eyes in
the middle of its head, and the other thrust out to the side.
[31] I would, however, respectfully suggest, that that theory of
cerebral vertebræ, on which, in this question, the comparative
anatomists proceed as their principle, and which finds as little
support in the geologic record from the actual history of the fore
limbs as from the actual history of the bones of the cranium, may
be more ingenious than sound. It is a shrewd circumstance, that
the rocks refuse to testify in its favor. Agassiz, I find, decides
against it on other than geological grounds; and his conclusion is
certainly rendered not the less worthy of careful consideration by
the fact that, yielding to the force of evidence, his views on the
subject underwent a thorough change. He had first held, and
then rejected it. “I have shared,” he says, “with a multitude of
other naturalists, the opinion which regards the cranium as
composed of vertebræ; and I am consequently in some degree
called upon to point out the motives which have induced me to
reject it.”
“M. Oken,” he continues, “was the first to assign this
signification to the bones of the cranium. The new doctrine he
expounded was received in Germany with great enthusiasm by
the school of the philosophers of nature. The author conceived
the cranium to consist of three vertebræ, and the basal occipital,
the sphenoid, and the ethmoid, were regarded as the central
parts of these cranial vertebræ. On these alleged bodies of
vertebræ, the arches enveloping the central parts of the nervous
system were raised, while on the opposite side were attached the
inferior pieces, which went to form the vegetative arch destined
to embrace the intestinal canal and the large vessels. It would be
too tedious to enumerate in this place the changes which each
author introduced, in order to modify this matter so as to make it
suit his own views. Some went the length of affirming that the
vertebræ of the head were as complete as those of the trunk;
and, by means of various dismemberments, separations, and
combinations, all the forms of the cranium were referred to the
vertebræ, by admitting that the number of pieces was invariably
fixed in every head, and that all the vertebrata, whatever might
be their organization in other respects, had in their heads the
same number of points of ossification. At a later period, what was
erroneous in this manner of regarding the subject was detected;
but the idea of the vertebral composition of the head was still
retained. It was admitted as a general law, that the cranium was
composed of three primitive vertebræ, as the embryo is of three
blastodermic leaflets; but that these vertebræ, like the leaflets,
existed only ideally, and that their presence, although easily
demonstrated in certain cases, could only be slightly traced, and
with the greatest difficulty, in other instances. The notion thus
laid down of the virtual existence of cranial vertebræ did not
encounter very great opposition; it could not be denied that there
was a certain general resemblance between the osseous case of
the brain and the rachidian canal; the occipital, in particular, had
all the characteristic features of a vertebra. But whenever an
attempt was made to push the analogy further, and to determine
rigorously the anterior vertebræ of the cranium, the observer
found himself arrested by insurmountable obstacles, and he was
obliged always to revert to the virtual existence.
“In order to explain my idea clearly, let me have recourse to an
example. It is certain that organized bodies are sometimes
endowed with virtual qualities, which, at a certain period of the
being’s life, elude dissection, and all our means of investigation. It
is thus that at the moment of their origin, the eggs of all animals
have such a resemblance to each other, that it would be
impossible to distinguish, even by the aid of the most powerful
microscope, the ovarial egg of a craw-fish, for example, from that
of true fish. And yet who would deny that beings in every respect
different from each other exist in these eggs? It is precisely
because the difference manifests itself at a later period, in
proportion as the embryo develops itself, that we are authorized
to conclude, that, even from the earliest period, the eggs were
different,—that each had virtual qualities proper to itself, although
they could not be discovered by our senses. If, on the contrary,
any one should find two eggs perfectly alike, and should observe
two beings perfectly identical issue from them, he would greatly
err if he ascribed to these eggs different virtual qualities. It is
therefore necessary, in order to be in a condition to suppose that
virtual properties peculiar to it are concealed in an animal, that
these properties should manifest themselves once, in some phase
or other of its development. Now, applying this principle to the
theory of cranial vertebræ, we should say, that if these vertebræ
virtually exist in the adult, they must needs show themselves in
reality, at a certain period of development. If, on the contrary,
they are found neither in the embryo nor the adult, I am of
opinion that we are entitled likewise to dispute their virtual
existence.
“Here, however, an objection may be made to me, drawn from
the physiological value of the vertebræ, the function of which, as
is well known, is, on the one hand, to furnish a solid support to
the muscular contractions which determine the movements of the
trunk, and, on the other, to protect the centres of the nervous
system, by forming a more or less solid case completely around
them. The bodies of the vertebræ are particularly destined to the
first of these offices; the neurapophyses to the second. What can
be more natural than to admit, from the consideration of this,
that in the head, the bodies of the vertebræ diminish in
proportion as the moving function becomes lost, while the
neurapophyses are considerably developed for protecting the
brain, the volume of which is very considerable, when compared
with that of the spinal marrow? Have we not an example of this
fact in the vertebræ of the tail, where the neurapophyses become
completely obliterated, and a simple cylindrical body alone
remains? Now, may it not be the case, that in the head, the
bodies of the vertebræ have disappeared; and that, in
consequence, there is a prolongation of the cord only as far as
the moving functions of the vertebræ extend? There is some
truth in this argument, and it would be difficult to refute it a
priori. But it loses all its force the moment that we enter upon a
detailed examination of the bones of the head. Thus, what would
we call, according to this hypothesis, the principal sphenoid, the
great wings of the sphenoid, and the ethmoid, which form the
floor of the cerebral cavity? It may be said they are apophyses.
But the apophyses protect the nervous centres only on the side
and above. It may be said that they are the bodies of the
vertebræ. But they are formed without the concurrence of the
dorsal cord; they cannot, therefore, be the bodies of the
vertebræ. It must therefore be allowed, that these bones at least
do not enter into the vertebral type; that they are in some
measure peculiar. And if this be the case with them, why may not
the other protective plates be equally independent of the
vertebral type; the more so, because the relations of the frontals
and parietals vary so much, that it would be almost impossible to
assign to them a constant place?”
[32] It is stated by Mr. Witham, that, “except in a few
instances, he had ineffectually tried, with the aid of the
microscope, to obtain some insight into the structure of coal.
Owing,” he adds, “to its great opacity, which is probably due to
mechanical pressure, the action of chemical affinity, and the
percolation of acidulous waters, all traces of organization appear
to have been obliterated.” I have heard the late Mr. Sanderson,
who prepared for Mr. Witham most of the specimens figured in
his well-known work on the “Internal Structure of Fossil
Vegetables,” and from whom the materials of his statement on
this point seem to have been derived, make a similar remark. It
was rare, he said, to find a bit of coal that exhibited the organic
structure. The case, however, is far otherwise; and the ingenious
mechanic and his employer were misled, simply by the
circumstance, that it is rare to find pieces of coal which exhibit
the ligneous fibre, existing in a state of keeping solid enough to
stand the grinding of the lapidary’s wheel. The lignite usually
occurs in thin layers of a substance resembling soft charcoal, at
which, from the loose adhesion of the fibres, the coal splits at a
stroke; and as it cannot be prepared as a transparency, it is best
examined by a Stanhope lens. It will be found, tried in this
manner, that so far is vegetable fibre from being of rare
occurrence in coal,—our Scotch coal at least,—that almost every
cubic inch contains its hundreds, nay, its thousands, of cells.
[33] On a point of such importance I find it necessary to
strengthen my testimony by auxiliary evidence. The following is
the judgment, on this ancient petrifaction, of Mr. Nicol of
Edinburgh,—confessedly one of our highest living authorities in
that division of fossil botany which takes cognizance of the
internal structure of lignites, and decides, from their anatomy,
their race and family:—

“Edinburgh, 19th July, 1845.


“Dear Sir,—I have examined the structure of the fossil
wood which you found in the Old Red Sandstone at
Cromarty, and have no hesitation in stating, that the
reticulated texture of the transverse sections, though
somewhat compressed, clearly indicates a coniferous
origin; but as there is not the slightest trace of a disc to be
seen in the longitudinal sections parallel to the medullary
rays, it is impossible to say whether it belongs to the Pine
or Araucarian division. I am, &c.,
“William Nicol.”

It will be seen that Mr. Nicol failed to detect what I now deem
the discs of this conifer,—those stippled markings to which I have
referred, and which the engraver has indicated in no exaggerated
style, in one of the longitudinal sections (b) of the wood-cut given
above. But even were this portion of the evidence wholly
wanting, we would be left in doubt, in consequence, not whether
the Old Red lignite formed part of a true gymnospermous tree,
but whether that tree is now represented by the pines of Europe
and America, or by the araucarians of Chili and New Zealand.
Were I to risk an opinion in a department not particularly my
province it would be in favor of an araucarian relationship.
[34] The following digest from Professor Balfour’s very
admirable “Manual of Botany,” of what is held on this curious
subject, may be not unacceptable to the reader. “It is an
interesting question to determine the mode in which the various
species and tribes of plants were originally scattered over the
globe. Various hypotheses have been advanced on the subject.
Linnæus entertained the opinion that there was at first only one
primitive centre of vegetation, from which plants were distributed
over the globe. Some, avoiding all discussions and difficulties,
suppose that plants were produced at first in the localities where
they are now seen vegetating. Others think that each species of
plant originated in, and was diffused from, a single primitive
centre; and that there were numerous such centres situated in
different parts of the world, each centre being the seat of a
particular number of species. They thus admit great vegetable
migrations, similar to those of the human races. Those who adopt
the latter view recognize in the distribution of plants some of the
last revolutions of our planet, and the action of numerous and
varied forces, which impede or favor the dissemination of
vegetables in the present day. They endeavor to ascertain the
primitive flora of countries, and to trace the vegetable migrations
which have taken place. Daubeny says, that analogy favors the
supposition that each species of plant was originally formed in
some particular locality, whence it spread itself gradually over a
certain area, rather than that the earth was at once, by the fiat of
the Almighty, covered with vegetation in the manner we at
present behold it. The human race rose from a single pair; and
the distribution of plants and animals over a certain definite area
would seem to imply that the same was the general law. Analogy
would lead us to believe that the extension of species over the
earth originally took place on the same plan on which it is
conducted at present, when a new island starts up in the midst of
the ocean, produced either by a coral reef or a volcano. In these
cases the whole surface is not at once overspread with plants, but
a gradual progress of vegetation is traced from the accidental
introduction of a single seed, perhaps, of each species, wafted by
winds or floated by currents. The remarkable limitation of certain
species to single spots on the globe seems to favor the
supposition of specific centres.”
[35] Rhodomenia palmata and Alaria esculenta.
[36] Porphyra laciniata, Chorda filum, and Enteromorpha
compressa.
[37] “Dr. Neill mentions,” says the Rev. Mr. Landsborough, in his
complete and very interesting “History of British Sea-Weeds,”
“that on our shores algæ generally occupy zones in the following
order, beginning from deep water:—F. Filum; F. esculentus and
bulbosus, F. digitatus, saccharinus, and loreus; F. serratus and
crispus; F. nodosus and vesiculosus; F. canaliculatus; and, last of
all, F. pygmæus; which is satisfied if it be within reach of the
spray.”
[38] We are supplied with a curious example of that ever-
returning cycle of speculation in which the human mind operates,
by not only the introduction of the principle of Epicurus into the
“Vestiges,” but also by the unconscious employment of even his
very arguments, slightly modified by the floating semi-scientific
notions of the time. The following passages, taken, the one from
the modern work, the other from Fénélon’s life of the old Greek
philosopher, are not unworthy of being studied, as curiously
illustrative of the cycle of thought. Epicurus, I must, however, first
remind the reader, in the words of his biographer, “supposed that
men, and all other animals, were originally produced by the
ground. According to him, the primitive earth was fat and nitrous;
and the sun, gradually warming it, soon covered it with herbage
and shrubs: there also began to arise on the surface of the
ground a great number of small tumors like mushrooms, which
having in a certain time come to maturity, the skin burst, and
there came forth little animals, which, gradually retiring from the
place where they were produced, began to respire.” And there
can be little doubt, that had the microscope been a discovery of
early Greece, the passage here would have told us, not of
mushroom-like tumors, but of monads. Save that the element of
microscopic fact is awanting in the one and present in the other,
the following are strictly parallel lines of argument:—
“To the natural objection that the earth does not now produce
men, lions, and dogs, Epicurus replies that the fecundity of the
earth is now exhausted. In advanced age a woman ceases to
bear children; a piece of land never before cultivated produces
much more during the few first years than it does afterwards;
and when a forest is once cut down, the soil never produces trees
equal to those which have been rooted up. Those which are
afterwards planted become dwarfish, and are perpetually
degenerating. We are, however, he argues, by no means certain
but there may be at present rabbits, hares, foxes, bears, and
other animals, produced by the earth in their perfect state. The
reason why we are backward in admitting it is, that it happens in
retired places, and never falls under our view; and, never seeing
rats but such as have been produced by other rats, we adopt the
opinion that the earth never produced any.” (Fénélon’s Lives of
the Ancient Philosophers.)
“In the first place, there is no reason to suppose that, though
life had been imparted by natural means, after the first cooling of
the surface to a suitable temperament, it would continue
thereafter to be capable of being imparted in like manner. The
great work of the peopling of this globe with living species is
mainly a fact accomplished: the highest known species came as a
crowning effort thousands of years ago. The work being thus to
all appearance finished, we are not necessarily to expect that the
origination of life and of species should be conspicuously
exemplified in the present day. We are rather to expect that the
vital phenomena presented to our eyes should mainly, if not
entirely, be limited to a regular and unvarying succession of races
by the ordinary means of generation. This, however, is no more
an argument against a time when phenomena of the first kind
prevailed, than it would be a proof against the fact of a mature
man having once been a growing youth, that he is now seen
growing no longer..... Secondly, it is far from being certain that
the primitive imparting of life and form to inorganic elements is
not a fact of our times.” (Vestiges of Creation.)
[39] “Vestiges of the Natural History of Creation,” and
“Explanations, being a Sequel to the Vestiges.”
[40] The chapter in which this passage occurs originally
appeared, with several of the others, in the Witness newspaper,
in a series of articles, entitled “Rambles of a Geologist,” and drew
forth the following letter from a correspondent of the Scottish
Press, the organ of a powerful and thoroughly respectable section
of the old Dissenters of Scotland. I present it to the reader merely
to show, that if, according to the author of the “Vestiges,”
geologists assailed the development hypothesis in the fond hope
of “purchasing impunity for themselves,” they would succeed in
securing only disappointment for their pains:—

“THE PRE-ADAMITE EARTH.


“To the Editor of the Scottish Press.
“Sir,—I occasionally observe articles in your neighbor
and contemporary the Witness, characteristically headed
‘Rambles of a Geologist,’ wherein the writer with great zeal
once more ‘slays the slain’ heresies of the ‘Vestiges of
Creation.’ This writer (of the ‘Rambles,’ I mean)
nevertheless, and at the same time, announces his own
tenets to be much of the same sort, as applied to mere
dead matter, that those of the ‘Vestiges’ are with regard to
living organisms. He maintains that the world, during the
last million of years, has been of itself rising or developing,
without the interposition of a miracle, from chaos into its
present state; and, of course, as it is still, as a world,
confessedly far below the acme of physical perfection, that
it must be just now on its passage, self-progressing,
towards that point, which terminus it may reach in another
million of years hence.[!!!] The author of the ‘Vestiges,’ as
quoted by the author of the ‘Rambles,’ in the last number
of the Witness, complains that the latter and his allies are
not at all so liberal to him as, from their present
circumstances and position, he had a right to expect. He
(the author of the ‘Vestiges’) reminds his opponents that
they have themselves only lately emerged from the
antiquated scriptural notions that our world was the direct
and almost immediate construction of its Creator,—as much
so, in fact, as any of its organized tenants,—and that it was
then created in a state of physical excellence, the highest
possible, to render it a suitable habitation for these
tenants, and all this only about six or seven thousand years
ago,—to the new light of their present physico-Lamarckian
views; and he asks, and certainly not without reason, why
should these men, so circumstanced, be so anxious to stop
him in his attempt to move one step further forward in the
very direction they themselves have made the last move?—
that is, in his endeavor to extend their own principles of
self-development from mere matter to living creatures.
Now, Sir, I confess myself to be one of those (and possibly
you may have more readers similarly constituted) who not
only cannot see any great difference between merely
physical and organic development,[!!] but who would be
inclined to allow the latter, absurd as it is, the advantage in
point of likelihood.[!!!] The author of the ‘Rambles,’
however, in the face of this, assures us that his views of
physical self-development and long chronology belong to
the inductive sciences. Now, I could at this stage of his
rambles have wished very much that, instead of merely
saying so, he had given his demonstration. He refers,
indeed, to several great men, who, he says, are of his
opinion. Most that these men have written on the question
at issue I have seen, but it appeared far from
demonstrative, and some of them, I know, had not fully
made up their mind on the point.[!!!] Perhaps the author
of the ‘Rambles’ could favor us with the inductive process
that converted himself; and, as the attainment of truth,
and not victory, is my object, I promise either to acquiesce
in or rationally refute it.[?] Till then I hold by my
antiquated tenets, that our world, nay, the whole material
universe, was created about six or seven thousand years
ago, and that in a state of physical excellence of which we
have in our present fallen world only the ‘vestiges of
creation.’ I conclude by mentioning that this view I have
held now for nearly thirty years, and, amidst all the
vicissitudes of the philosophical world during that period, I
have never seen cause to change it. Of course, with this
view I was, during the interval referred to, a constant
opponent of the once famous, though now exploded,
nebular hypothesis of La Place; and I yet expect to see
physical development and long chronology wither also on
this earth, now that their root (the said hypothesis) has
been eradicated from the sky.[!!!]—I am, Sir, your most
obedient servant,
“Philalethes.”

I am afraid there is little hope of converting a man who has


held so stoutly by his notions “for nearly thirty years;” especially
as, during that period, he has been acquainting himself with what
writers such as Drs. Chalmers, Buckland, and Pye Smith have
written on the other side. But for the demonstration which he
asks, as I have conducted it, I beg leave to refer him to the
seventeenth chapter of my little work, “First Impressions of
England and its People.” I am, however, inclined to suspect that
he is one of a class whose objections are destined to be removed
rather by the operation of the laws of matter than of those of
mind. For it is a comfortable consideration, that in this
controversy the geologists have the laws of matter on their side;
—“the stars in their courses fight against Sisera.” Their opponents
now, like the opponents of the astronomer in the ages gone by,
are, in most instances, men who have been studying the matter
“for nearly thirty years.” When they study it for a few years longer
they disappear; and the men of the same cast and calibre who
succeed them are exactly the men who throw themselves most
confidently into the arms of the enemy, and look down upon their
poor silent predecessors with the loftiest commiseration. It is,
however, not uninstructive to remark how thoroughly, in some
instances, the weaker friends and the wilier enemies of Revelation
are at one in their conclusions respecting natural phenomena.
The correspondent of the Scottish Press merely regards the views
of the author of the “Vestiges” as possessing “the advantage, in
point of likelihood,” over those of the geologists his antagonists:
his ally the Dean of York goes greatly further, and stands up as
stoutly for the transmutation of species as Lamarck himself.
Descanting, in his New System of Geology, on the various forms
of trilobites, ammonites, belemnites, &c. Dean Cockburn says,—
“These creatures appear to have possessed the power of
secreting from the stone beneath them a limy covering for their
backs, and perhaps, fed partly on the same solid material.
Supposing, now that the first trilobites were destroyed by the
Llandeilo Slates, some spawn of these creatures would arise
above these flags, and, after a time, would be warmed into
existence. These molluscs,[!!] then, having a better material from
which to extract their food and covering, would probably expand
in a slightly different form, and with a more extensive mantle
than what belonged to the parent species. The same would be
still more the case with a new generation, fed upon a new deposit
from some deeper volcano, such as the Caradoc or Wenlock
Limestone, in which lime more and more predominates. Now, if
any one will examine the various prints of trilobites in Sir R.
Murchison’s valuable work, he will find but very trifling differences
in any of them,[!!] and those differences only in the stony
covering of their backs. I knew two brothers once much alike: the
one became a curate with a large family; the other a London
alderman. If the skins of these two pachydermata had been
preserved in a fossil state, there would have been less
resemblance between them than between an Asaphus tyrannus
and an Asaphus caudatus.... A careful and laborious investigation
has discovered, as in the trilobites, a difference in the ammonites
of different strata; but such differences, as in the former case,
exist only in the form of the external shell, and may be explained
in the same manner.[!!] ... As to the scaphites, baculites,
belemnites, and all the other ites which learned ingenuity has so
named, you find them in various strata the same in all important
particulars, but also differing slightly in their outward coverings,
as might be expected from the different circumstances in which
each variety was placed.[!!] The sheep in the warm valleys of
Andalusia have a fine covering like to hair; but remove them to a
northern climate, and in a few generations the back is covered
with shaggy wool. The animal is the same,—the covering only is
changed.... The learned have classed those shells under the
names of terebratula, orthis, atrypa, pecten, &c. They are all
much alike.[!!!] It requires an experienced eye to distinguish
them one from another: what little differences have been pointed
out may readily be ascribed, as before, to difference of
situation.”[!!!]
The author of the “Vestiges,” with this, the fundamental portion
of his case, granted to him by the Dean, will have exceedingly
little difficulty in making out the rest for himself. The passage is,
however, not without its value, as illustrative of the darkness, in
matters of physical science, “even darkness which may be felt,”
that is suffered to linger, in this the most scientific of ages, in the
Church of Buckland, Sedgwick, and Conybeare.
[41] The common objection to that special view which regards
the days of creation as immensely protracted periods of time,
furnishes a specimen, if not of reasoning in a circle, at least of
reasoning from a mere assumption. It first takes for granted, that
the Sabbath day during which God rested was a day of but
twenty-four hours; and then argues, from the supposition, that in
order to keep up the proportion between the six previous working
days and the seventh day of rest, which the reason annexed to
the fourth commandment demands, these previous days must
also have been days of twenty-four hours each. It would, I have
begun to suspect, square better with the ascertained facts, and
be at least equally in accordance with Scripture, to reverse the
process, and argue that, because God’s working days were
immensely protracted periods, his Sabbath must also be an
immensely protracted period. The reason attached to the law of
the Sabbath seems to be simply a reason of proportion;—the
objection to which I refer is an objection palpably founded on
considerations of proportion. And certainly, were the reason to be
divested of proportion, it would be divested also of its distinctive
character as a reason. Were it to run as follows, it could not be at
all understood:—“Six days shalt thou labor, &c., but on the
seventh day shalt thou do no labor, &c.; for in six immensely
protracted periods of many thousand years each did the Lord
make the heavens and earth, &c., and then rested during a brief
day of twenty-four hours; therefore the Lord blessed the brief day
of twenty-four hours, and hallowed it.” This, I repeat, would not
be reason. All, however, that seems necessary to the integrity of
the reason, in its character as such, is, that the proportion of six
parts to seven should be maintained. God’s periods may be
periods expressed algebraically by letters symbolical of unknown
quantity, and man’s periods by letters symbolical of quantities
well known; but if God’s Sabbath be equal to one of his six
working days, and man’s Sabbath equal to one of his six working
days, the integrity of proportion is maintained. When I see the
palpable absurdity of such a reading of the reason as the one
given above, I can see no absurdity whatever in the reading
which I subjoin:—“Six periods (a=a=a=a=a=a) shalt thou labor,
&c., but on the seventh period (b=a) shalt thou do no labor, &c.;
for in six periods (x=x=x=x=x=x) the Lord made heaven and
earth, &c., and rested the seventh period, (y=x;) therefore the
Lord blessed the seventh period, and hallowed it” The reason, in
its character as a reason of proportion, survives here in all its
integrity. Man, when in his unfallen estate, bore the image of
God, but it must have been a miniature image at best;—the
proportion of man’s week to that of his Maker may, for aught that
appears, be mathematically just in its proportions, and yet be a
miniature image too,—the mere scale of a map, on which inches
represent geographical degrees. All those week days and Sabbath
days of man which have come and gone since man first entered
upon this scene of being, with all which shall yet come and go,
until the resurrection of the dead terminates the work of
Redemption, may be included, and probably are included, in the
one Sabbath day of God.

Valuable Works
PUBLISHED BY
GOULD AND LINCOLN,
59 Washington Street, Boston.
HAMILTON’S LECTURES, embracing the Metaphysical and Logical
Courses; with Notes, from Original Materials, and an Appendix,
containing the Author’s Latest Development of his New Logical
Theory. Edited by Rev. Henry Longueville Mansel, B. D., Prof. of
Moral and Metaphysical Philosophy in Magdalen College, Oxford,
and John Veitch, M. A., of Edinburgh. In two royal octavo
volumes, viz.,
I. Metaphysical Lectures. Royal octavo, cloth, 3.50.
II. Logical Lectures. Royal octavo, cloth, 3.50.
☞ G. & L., by a special arrangement with the family of the late Sir William
Hamilton, are the authorized, and only authorized, American publishers of this
distinguished author’s matchless Lectures on Metaphysics and Logic.
The above have already been introduced into nearly all our leading colleges.
LOOMIS’ ELEMENTS OF GEOLOGY; adapted to Schools and
Colleges. With numerous Illustrations. By J. R. Loomis, President
of Lewisburg University, Pa. 12mo, cloth, 1.25.
“It is surpassed by no work before the American public.”—M. B. Anderson, LL.
D., President Rochester University.

PEABODY’S CHRISTIANITY THE RELIGION OF NATURE.


Lectures delivered before the Lowell Institute in 1863, by A. P.
Peabody, D. D., LL. D., Preacher to the University, and Plummer
Professor of Christian Morals, Harvard College. Royal 12mo,
cloth, 1.50.
A masterly production, distinguished for its acuteness and earnestness, its force
of logic and fairness of statement, written in a style of singular accuracy and
beauty.

PALEY’S NATURAL THEOLOGY: Illustrated by forty Plates, with


Selections from the Notes of Dr. Paxton, and Additional Notes,
Original and Selected, with a Vocabulary of Scientific Terms.
Edited by John Ware, M. D. Improved edition, with elegant
illustrations. 12mo, cloth, embossed, 1.75.

MANSEL’S PROLEGOMENA LOGICA; the Psychological Character


of Logical Processes. By Henry Longueville Mansel, B. D. 12mo,
cloth, 1.25.

YOUNG LADIES’ CLASS BOOK: a Selection of Lessons for Reading


of Prose and Verse. By Ebenezer Bailey, A. M. Cloth, embossed,
1.25.

HAVEN’S MENTAL PHILOSOPHY; Including the Intellect, the


Sensibilities, and the Will. By Joseph Haven, Professor of
Intellectual and Moral Philosophy, Chicago University. Royal
12mo, cloth, embossed, 2.00.
It is believed this work will be found preëminently distinguished for the
Completeness with which it presents the whole subject.
HAVEN’S MORAL PHILOSOPHY; Including Theoretical and
Practical Ethics. By Joseph Haven, D. D., late Professor of Moral
and Intellectual Philosophy in Chicago University. Royal 12mo,
cloth, embossed, 1.75.
It is eminently scientific in method, and thorough in discussion, and its views on
unsettled questions in morals are discriminating and sound.

HOPKINS’ LECTURES ON MORAL SCIENCE, delivered before the


Lowell Institute, Boston, by Mark Hopkins, D. D., President of
Williams College. Royal 12mo, cloth, 1.50.
☞ An important work from the pen of one of the most profound thinkers of the
age.

WAYLAND’S ELEMENTS OF MORAL SCIENCE. By Francis


Wayland, D. D., late President of Brown University. 12mo, cloth,
1.75.

WAYLAND’S MORAL SCIENCE ABRIDGED, and adapted to the


use of Schools and Academies, by the Author. Half mor., 70 cts.
The same, Cheap School Edition, boards, 45 cts.

WAYLAND’S ELEMENTS OF POLITICAL ECONOMY. By Francis


Wayland, D. D. 12mo, cloth, 1.75.

WAYLAND’S POLITICAL ECONOMY ABRIDGED, and adapted to


the use of Schools and Academies, by the Author. Half mor., 70
cents.
All the above works by Dr. Wayland are used as text-books in most of the
colleges and higher schools throughout the Union, and are highly approved.

AGASSIZ AND GOULD’S PRINCIPLES OF ZOÖLOGY; Touching


the Structure, Development, Distribution, and Natural
Arrangement, of the Races of Animals, living and extinct, with
numerous Illustrations. For the use of Schools and Colleges.
Part I. Comparative Physiology. By Louis Agassiz and Augustus A.
Gould. Revised edition. 1.50.
PART II. Systematic Zoölogy. In preparation.
“It is simple and elementary in its style, full in its illustrations, comprehensive in
its range, yet well condensed, and brought into the narrow compass requisite for
the purpose intended.”—Silliman’s Journal.

RITTER’S GEOGRAPHICAL STUDIES. Translated from the


German of Carl Ritter, by Rev. W. L. Gage. With a Sketch of the
Author’s Life, and a Portrait. 12mo, cloth, 1.50.
This volume contains the grand generalizations of Ritter’s life-work, the
Erdkünde, in eighteen volumes; his lectures on the Relations of Geography and
History, and a number of important papers on Physical Geography.

PROGRESSIVE PENMANSHIP, Plain and ornamental, for the use


of Schools. By N. D. Gould, author of “Beauties of Writing,”
“Writing Master’s Assistant,” etc. In five parts, each, 20 cts.

ROGET’S THESAURUS OF ENGLISH WORDS AND PHRASES,


so classified and arranged as to facilitate the expression of
ideas, and assist in literary composition. New and improved
edition. By Peter Mark Roget, late Secretary of the Royal Society,
London, etc. Revised and edited, with a List of Foreign Words
defined in English, and other additions, by Barnas Sears, D. D.,
President of Brown University. A New American Edition, with
Additions and Improvements. 12mo, cloth, 2.00.
The first American edition having been prepared by Prof. Sears for strictly
educational purposes, those words and phrases properly termed “vulgar,”
incorporated in the original work, were omitted. These expurgated portions have,
in the present edition, been restored, but by such an arrangement of the matter
as not to interfere with the educational purposes of the American editor. Besides
this it contains important additions not in the English edition, of words and
phrases, and also an alphabetical list of “Foreign Words and Phrases”—Latin,
French, Italian, Spanish, Greek, etc.—which most frequently occur in works of
general literature, defined in English, making it in all respects more full and perfect
than the author’s edition.

GUYOT’S EARTH AND MAN; Lectures on Comparative Physical


Geography, in its relation to the History of Mankind. By Arnold
Guyot. With Illustrations. 12mo, cloth, 1.75.
GUYOT’S MURAL MAPS. A series of elegant Colored Maps,
projected on a large scale for the Recitation Room, consisting of
a Map of the World, North and South America, Geographical
Elements, &c., exhibiting the Physical Phenomena of the Globe.
By Professor Arnold Guyot, viz.,

GUYOT’S MAP OF THE WORLD, mounted, 12.00.

GUYOT’S MAP OF NORTH AMERICA, mounted, 11.00.

GUYOT’S MAP OF SOUTH AMERICA, mounted, 11.00.

GUYOT’S GEOGRAPHICAL ELEMENTS, mounted, 11.00.


☞ These elegant and entirely original Mural Maps are projected on a large scale,
so that when suspended in the recitation room they may be seen from any point,
and the delineations without difficulty traced distinctly with the eye. They are
beautifully printed in colors, and neatly mounted for use.

BARTON’S EASY LESSONS IN ENGLISH GRAMMAR, for Young


Beginners. By W. S. Barton, A. M. 12mo, half mor., 75 cts.
Designed as a Sequel to the Author’s New System of English Grammar, which forms
a gradual introduction to the first principles of composition.

BARTON’S NEW INTERMEDIATE SYSTEM OF ENGLISH


GRAMMAR. By W. S. Barton, A. M. 12mo, half mor., 1.00.

BARTON’S PRACTICAL EXERCISES IN ENGLISH


COMPOSITION; or, The Young Composer’s Guide. By W. S.
Barton, A. M. 12mo, half mor., 1.00.

BARTON’S HIGH SCHOOL GRAMMAR; or, an Exposition of


Grammatical Structure of the English Language. By W. S.
Barton, A. M. 12mo. half mor., 1.50.
The above works by Prof. Barton, designed as text-books for the use of schools
and academies, are the result of long experience, and will be found to possess
many and peculiar merits.
MILLER’S CRUISE OF THE BETSEY; or, a Summer Ramble among
the Fossiliferous Deposits of the Hebrides. With Rambles of a
Geologist; or, Ten Thousand Miles over the Fossiliferous
Deposits of Scotland. 12mo, PP. 524, cloth, 1.75.

MILLER’S ESSAYS, Historical and Biographical, Political and Social,


Literary and Scientific. By Hugh Miller. With Preface by Peter
Bayne. 12mo, cloth, 1.75.

MILLER’S FOOT-PRINTS OF THE CREATOR; or, the Asterolepis


of Stromness, with numerous Illustrations. With a Memoir of the
Author, by Louis Agassiz. 12mo, cloth, 1.75.

MILLER’S FIRST IMPRESSIONS OF ENGLAND AND ITS


PEOPLE. With a fine Engraving of the Author. 12mo, cloth,
1.50.

MILLER’S HEADSHIP OF CHRIST, and the Rights of the Christian


People, a Collection of Personal Portraitures, Historical and
Descriptive Sketches and Essays, with the Author’s celebrated
Letter to Lord Brougham. By Hugh Miller. Edited, with a Preface,
by Peter Bayne, A. M. 12mo, cloth, 1.75.

MILLER’S OLD RED SANDSTONE; or, New Walks in an Old Field.


Illustrated with Plates and Geological Sections. New Edition,
Revised and much Enlarged, by the addition of new matter and
new Illustrations &c. 12mo, cloth, 1.75.

MILLER’S POPULAR GEOLOGY; With Descriptive Sketches from a


Geologist’s Portfolio. By Hugh Miller. With a Resume of the
Progress of Geological Science during the last two years. By
Mrs. Miller. 12mo, cloth, 1.75.

MILLER’S SCHOOLS AND SCHOOLMASTERS; or, the Story of


my Education. An Autobiography. With a full-length Portrait of the
Author. 12mo, 1.75.
MILLER’S TALES AND SKETCHES. Edited, with a Preface, &c., by
Mrs. Miller. 12mo, 1.50.
Among the subjects are: Recollections of Ferguson—Burns—The Salmon Fisher
of Udoll—The Widow of Dunskaith—The Lykewake—Bill Whyte—The Young
Surgeon—George Ross, the Scotch Agent—M’Culloch, the Mechanician—A True
Story of the Life of a Scotch Merchant of the Eighteenth Century.

MILLER’S TESTIMONY OF THE ROCKS; or, Geology in its


Bearings on the two Theologies, Natural and Revealed. “Thou
shalt be in league with the stones of the field.”—Job. With
numerous elegant Illustrations. One volume, royal 12mo, cloth,
1.75.

HUGH MILLER’S WORKS. Ten volumes, uniform style, in an


elegant box, embossed cloth, 17; library sheep, 20; half calf, 34;
antique, 34.

MACAULAY ON SCOTLAND. A Critique from Hugh Miller’s


“Witness.” 16mo, flexible cloth, 37 cts.
*** END OF THE PROJECT GUTENBERG EBOOK THE FOOT-PRINTS
OF THE CREATOR ***

Updated editions will replace the previous one—the old editions


will be renamed.

Creating the works from print editions not protected by U.S.


copyright law means that no one owns a United States
copyright in these works, so the Foundation (and you!) can copy
and distribute it in the United States without permission and
without paying copyright royalties. Special rules, set forth in the
General Terms of Use part of this license, apply to copying and
distributing Project Gutenberg™ electronic works to protect the
PROJECT GUTENBERG™ concept and trademark. Project
Gutenberg is a registered trademark, and may not be used if
you charge for an eBook, except by following the terms of the
trademark license, including paying royalties for use of the
Project Gutenberg trademark. If you do not charge anything for
copies of this eBook, complying with the trademark license is
very easy. You may use this eBook for nearly any purpose such
as creation of derivative works, reports, performances and
research. Project Gutenberg eBooks may be modified and
printed and given away—you may do practically ANYTHING in
the United States with eBooks not protected by U.S. copyright
law. Redistribution is subject to the trademark license, especially
commercial redistribution.

START: FULL LICENSE


THE FULL PROJECT GUTENBERG LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK

To protect the Project Gutenberg™ mission of promoting the


free distribution of electronic works, by using or distributing this
work (or any other work associated in any way with the phrase
“Project Gutenberg”), you agree to comply with all the terms of
the Full Project Gutenberg™ License available with this file or
online at www.gutenberg.org/license.

Section 1. General Terms of Use and


Redistributing Project Gutenberg™
electronic works
1.A. By reading or using any part of this Project Gutenberg™
electronic work, you indicate that you have read, understand,
agree to and accept all the terms of this license and intellectual
property (trademark/copyright) agreement. If you do not agree
to abide by all the terms of this agreement, you must cease
using and return or destroy all copies of Project Gutenberg™
electronic works in your possession. If you paid a fee for
obtaining a copy of or access to a Project Gutenberg™
electronic work and you do not agree to be bound by the terms
of this agreement, you may obtain a refund from the person or
entity to whom you paid the fee as set forth in paragraph 1.E.8.

1.B. “Project Gutenberg” is a registered trademark. It may only


be used on or associated in any way with an electronic work by
people who agree to be bound by the terms of this agreement.
There are a few things that you can do with most Project
Gutenberg™ electronic works even without complying with the
full terms of this agreement. See paragraph 1.C below. There
are a lot of things you can do with Project Gutenberg™
electronic works if you follow the terms of this agreement and
help preserve free future access to Project Gutenberg™
electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation (“the
Foundation” or PGLAF), owns a compilation copyright in the
collection of Project Gutenberg™ electronic works. Nearly all the
individual works in the collection are in the public domain in the
United States. If an individual work is unprotected by copyright
law in the United States and you are located in the United
States, we do not claim a right to prevent you from copying,
distributing, performing, displaying or creating derivative works
based on the work as long as all references to Project
Gutenberg are removed. Of course, we hope that you will
support the Project Gutenberg™ mission of promoting free
access to electronic works by freely sharing Project Gutenberg™
works in compliance with the terms of this agreement for
keeping the Project Gutenberg™ name associated with the
work. You can easily comply with the terms of this agreement
by keeping this work in the same format with its attached full
Project Gutenberg™ License when you share it without charge
with others.

1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside
the United States, check the laws of your country in addition to
the terms of this agreement before downloading, copying,
displaying, performing, distributing or creating derivative works
based on this work or any other Project Gutenberg™ work. The
Foundation makes no representations concerning the copyright
status of any work in any country other than the United States.

1.E. Unless you have removed all references to Project


Gutenberg:

1.E.1. The following sentence, with active links to, or other


immediate access to, the full Project Gutenberg™ License must
appear prominently whenever any copy of a Project
Gutenberg™ work (any work on which the phrase “Project
Gutenberg” appears, or with which the phrase “Project
Gutenberg” is associated) is accessed, displayed, performed,
viewed, copied or distributed:

This eBook is for the use of anyone anywhere in the United


States and most other parts of the world at no cost and
with almost no restrictions whatsoever. You may copy it,
give it away or re-use it under the terms of the Project
Gutenberg License included with this eBook or online at
www.gutenberg.org. If you are not located in the United
States, you will have to check the laws of the country
where you are located before using this eBook.

1.E.2. If an individual Project Gutenberg™ electronic work is


derived from texts not protected by U.S. copyright law (does not
contain a notice indicating that it is posted with permission of
the copyright holder), the work can be copied and distributed to
anyone in the United States without paying any fees or charges.
If you are redistributing or providing access to a work with the
phrase “Project Gutenberg” associated with or appearing on the
work, you must comply either with the requirements of
paragraphs 1.E.1 through 1.E.7 or obtain permission for the use
of the work and the Project Gutenberg™ trademark as set forth
in paragraphs 1.E.8 or 1.E.9.

1.E.3. If an individual Project Gutenberg™ electronic work is


posted with the permission of the copyright holder, your use and
distribution must comply with both paragraphs 1.E.1 through
1.E.7 and any additional terms imposed by the copyright holder.
Additional terms will be linked to the Project Gutenberg™
License for all works posted with the permission of the copyright
holder found at the beginning of this work.

1.E.4. Do not unlink or detach or remove the full Project


Gutenberg™ License terms from this work, or any files
containing a part of this work or any other work associated with
Project Gutenberg™.

1.E.5. Do not copy, display, perform, distribute or redistribute


this electronic work, or any part of this electronic work, without
prominently displaying the sentence set forth in paragraph 1.E.1
with active links or immediate access to the full terms of the
Project Gutenberg™ License.

1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if
you provide access to or distribute copies of a Project
Gutenberg™ work in a format other than “Plain Vanilla ASCII” or
other format used in the official version posted on the official
Project Gutenberg™ website (www.gutenberg.org), you must,
at no additional cost, fee or expense to the user, provide a copy,
a means of exporting a copy, or a means of obtaining a copy
upon request, of the work in its original “Plain Vanilla ASCII” or
other form. Any alternate format must include the full Project
Gutenberg™ License as specified in paragraph 1.E.1.

1.E.7. Do not charge a fee for access to, viewing, displaying,


performing, copying or distributing any Project Gutenberg™
works unless you comply with paragraph 1.E.8 or 1.E.9.

1.E.8. You may charge a reasonable fee for copies of or


providing access to or distributing Project Gutenberg™
electronic works provided that:

• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”

• You provide a full refund of any money paid by a user who


notifies you in writing (or by e-mail) within 30 days of receipt
that s/he does not agree to the terms of the full Project
Gutenberg™ License. You must require such a user to return or
destroy all copies of the works possessed in a physical medium
and discontinue all use of and all access to other copies of
Project Gutenberg™ works.

• You provide, in accordance with paragraph 1.F.3, a full refund of


any money paid for a work or a replacement copy, if a defect in
the electronic work is discovered and reported to you within 90
days of receipt of the work.

• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.

1.E.9. If you wish to charge a fee or distribute a Project


Gutenberg™ electronic work or group of works on different
terms than are set forth in this agreement, you must obtain
permission in writing from the Project Gutenberg Literary
Archive Foundation, the manager of the Project Gutenberg™
trademark. Contact the Foundation as set forth in Section 3
below.

1.F.

1.F.1. Project Gutenberg volunteers and employees expend


considerable effort to identify, do copyright research on,
transcribe and proofread works not protected by U.S. copyright

You might also like