100% found this document useful (3 votes)
51 views

C Programming From Problem Analysis to Program Design 4th Edition Barbara Doyle pdf download

The document provides links to various programming textbooks, including C and Java programming from problem analysis to program design, available for instant download in multiple formats. It highlights the fourth edition of 'C# Programming: From Problem Analysis to Program Design' by Barbara Doyle, along with other editions and related programming books. Additionally, it includes copyright information and details about the content structure of the C# programming textbook.

Uploaded by

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

C Programming From Problem Analysis to Program Design 4th Edition Barbara Doyle pdf download

The document provides links to various programming textbooks, including C and Java programming from problem analysis to program design, available for instant download in multiple formats. It highlights the fourth edition of 'C# Programming: From Problem Analysis to Program Design' by Barbara Doyle, along with other editions and related programming books. Additionally, it includes copyright information and details about the content structure of the C# programming textbook.

Uploaded by

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

C Programming From Problem Analysis to Program

Design 4th Edition Barbara Doyle pdf download

https://ebookgate.com/product/c-programming-from-problem-
analysis-to-program-design-4th-edition-barbara-doyle/

Get Instant Ebook Downloads – Browse at https://ebookgate.com


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

Java Programming From Problem Analysis to Program Design


4th Edition D. S. Malik

https://ebookgate.com/product/java-programming-from-problem-analysis-
to-program-design-4th-edition-d-s-malik/

ebookgate.com

C Programming From Problem Analysis to Program Design 5th


5th Edition D. S. Malik

https://ebookgate.com/product/c-programming-from-problem-analysis-to-
program-design-5th-5th-edition-d-s-malik/

ebookgate.com

C Programming Program design including data structures


5ed. Edition Malik D.S.

https://ebookgate.com/product/c-programming-program-design-including-
data-structures-5ed-edition-malik-d-s/

ebookgate.com

C Programming Program Design Including Data Structures 7th


Edition D. S. Malik

https://ebookgate.com/product/c-programming-program-design-including-
data-structures-7th-edition-d-s-malik/

ebookgate.com
C Programming Program Design Including Data Structures 6th
Edition D. S. Malik

https://ebookgate.com/product/c-programming-program-design-including-
data-structures-6th-edition-d-s-malik/

ebookgate.com

Fixed Income Analysis 4th edition Edition Barbara S Petitt

https://ebookgate.com/product/fixed-income-analysis-4th-edition-
edition-barbara-s-petitt/

ebookgate.com

Programming in Objective C 4th Edition Stephen Kochan

https://ebookgate.com/product/programming-in-objective-c-4th-edition-
stephen-kochan/

ebookgate.com

C Programming Data Structures 4th Edition E. Balagurusamy

https://ebookgate.com/product/c-programming-data-structures-4th-
edition-e-balagurusamy/

ebookgate.com

Reading the Middle Ages From c 900 to c 1500 3. ed.


Edition Barbara H. Rosenwein

https://ebookgate.com/product/reading-the-middle-ages-
from-c-900-to-c-1500-3-ed-edition-barbara-h-rosenwein/

ebookgate.com
C# PROGRAMMING:
FROM PROBLEM ANALYSIS TO PROGRAM DESIGN

FOURTH EDITION

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
This is an electronic version of the print textbook. Due to electronic rights restrictions,
some third party content may be suppressed. Editorial review has deemed that any suppressed
content does not materially affect the overall learning experience. The publisher reserves the right
to remove content from this title at any time if subsequent rights restrictions require it. For
valuable information on pricing, previous editions, changes to current editions, and alternate
formats, please visit www.cengage.com/highered to search by ISBN#, author, title, or keyword for
materials in your areas of interest.

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
C# PROGRAMMING:
FROM PROBLEM ANALYSIS TO PROGRAM DESIGN

FOURTH EDITION

BARBARA DOYLE

Australia l Brazil l Japan l Korea l Mexico l Singapore l Spain l United Kingdom l United States

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
C# Programming: From Problem Analysis © 2014 Cengage Learning
to Program Design, Fourth Edition
ALL RIGHTS RESERVED. No part of this work covered by the copyright
Barbara Doyle herein may be reproduced, transmitted, stored or used in any form or
by any means graphic, electronic, or mechanical, including but not
Executive Editor: Kathleen McMahon
limited to photocopying, recording, scanning, digitizing, taping, Web
Senior Product Manager: Alyssa Pratt distribution, information networks, or information storage and
Editorial Assistant: Sarah Ryan retrieval systems, except as permitted under Section 107 or 108 of the
1976 United States Copyright Act, without the prior written permission
Content Project Manager: Jennifer Feltri-George
of the publisher.
Art Director: Cheryl Pearl, GEX
Manufacturing Planner: Julio Esperas
Cover Designer: GEX Publishing Services For product information and technology assistance, contact us at
Cover Photo: ©iurii /Shutterstock Cengage Learning Customer & Sales Support,
www.cengage.com/support
Copyeditor: Andrea Schein
Indexer: Sharon Hilgenberg For permission to use material from this text or product,
submit all requests online at cengage.com/permissions
Compositor: Integra
Further permissions questions can be e-mailed to
permissionrequest@cengage.com

Library of Congress Control Number: 2013932312


ISBN-13: 978-1-285-09626-1
ISBN-10: 1-285-09626-6
Cengage Learning
20 Channel Center Street
Boston, MA 02210
USA

Some of the product names and company names used in this book have
been used for identification purposes only and may be trademarks or
registered trademarks of their respective manufacturers and sellers.
Any fictional data related to persons or 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 persons or companies.
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.
Cengage Learning is a leading provider of customized learning
solutions with office locations around the globe, including
Singapore, the United Kingdom, Australia, Mexico, Brazil, and Japan.
Locate your local office at: www.cengage.com/global
Cengage Learning products are represented in Canada by Nelson
Education, Ltd.
To learn more about 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

Printed in the United States of America


1 2 3 4 5 6 7 19 18 17 16 15 14 13
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
B RIEF C ONTENTS

Neale Cousland / Shutterstock.com

PREFACE xxi

1. Introduction to Computing and Programming 1

2. Data Types and Expressions 65

3. Methods and Behaviors 131

4. Creating Your Own Classes 191

5. Making Decisions 247

6. Repeating Instructions 313

7. Arrays 383

8. Advanced Collections 439

9. Introduction to Windows Programming 493

10. Programming Based on Events 577

11. Advanced Object-Oriented Programming Features 691

12. Debugging and Handling Exceptions 775

13. Working with Files 837

14. Working with Databases 893

15. Web-Based Applications 979

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
vi | C# Programming: From Problem Analysis to Program Design, Fourth Edition

APPENDIX A Visual Studio Configuration 1083

APPENDIX B Code Editor Tools 1099

APPENDIX C Character Sets 1111

APPENDIX D Operator Precedence 1113

APPENDIX E C# Keywords 1115

GLOSSARY 1117

INDEX 1131

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
TABLE OF C ONTENTS

Neale Cousland / Shutterstock.com

Preface xxi

INTRODUCTION TO COMPUTING AND PROGRAMMING 1


1 History of Computers 2
System and Application Software 4
System Software 4
Application Software 6
Software Development Process 6
Steps in the Program Development Process 7
Programming Methodologies 13
Structured Procedural Programming 14
Object-Oriented Programming 16
Evolution of C# and .NET 19
Programming Languages 19
.NET 21
Why C#? 23
Types of Applications Developed with C# 24
Web Applications 24
Windows Applications 25
Console Applications 26
Exploring the First C# Program 27
Elements of a C# Program 28
Comments 28
Using Directive 30
Namespace 32
Class Definition 32

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
viii | C# Programming: From Problem Analysis to Program Design, Fourth Edition

Main( ) Method 33
Method Body Statements 34
Compiling, Building, and Running an Application 38
Typing Your Program Statements 38
Compilation and Execution Process 39
Compiling the Source Code Using Visual Studio IDE 39
Debugging an Application 45
Syntax Errors 45
Run-time Errors 47
Creating an Application 47
Coding Standards 52
Pseudocode 52
Resources 53
Quick Review 53
Exercises 56
Programming Exercises 61

DATA TYPES AND EXPRESSIONS 65


2 Data Representation 66
Bits 66
Bytes 66
Binary Numbering System 66
Character Sets 69
Kilobyte, Megabyte, Gigabyte, Terabyte, Petabyte. . . 70
Memory Locations for Data 70
Identifiers 71
Variables 75
Literal Values 75
Types, Classes, and Objects 76
Types 76
Classes 77
Objects 78
Predefined Data Types 79
Value Types 80

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Table of Contents | ix

Integral Data Types 82


Floating-Point Types 85
Decimal Types 86
Boolean Variables 87
Declaring Strings 88
Making Data Constant 88
Assignment Statements 89
Basic Arithmetic Operations 92
Increment and Decrement Operations 95
Compound Operations 98
Order of Operations 100
Mixed Expressions 102
Casts 103
Formatting Output 104
Width Specifier 109
Coding Standards 119
Naming Conventions 119
Spacing Conventions 119
Declaration Conventions 120
Resources 120
Quick Review 120
Exercises 121
Programming Exercises 127

METHODS AND BEHAVIORS 131


3 Anatomy of a Method 132
Modifiers 134
Return Type 137
Method Name 138
Parameters 138
Method Body 139
Calling Class Methods 141
Predefined Methods 143
Writing Your Own Class Methods 157
Void Methods 157
Value-Returning Method 159
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
x | C# Programming: From Problem Analysis to Program Design, Fourth Edition

Types of Parameters 164


Named and Optional Parameters 169
Default Values with Optional Parameters 170
Named Parameters 171
Coding Standards 180
Naming Conventions 180
Spacing Conventions 180
Declaration Conventions 180
Commenting Conventions 181
Resources 181
Quick Review 181
Exercises 182
Programming Exercises 189

CREATING YOUR OWN CLASSES 191


4 The Object Concept 192
Private Member Data 193
Constructor 197
Writing Your Own Instance Methods 200
Accessor 200
Mutators 201
Other Instance Methods 202
Property 202
ToString( ) Method 204
Calling Instance Methods 206
Calling the Constructor 206
Calling Accessor and Mutator Methods 208
Calling Other Instance Methods 209
Testing Your New Class 210
Coding Standards 235
Naming Conventions 235
Classes 235
Properties 235
Methods 236

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Table of Contents | xi

Constructor Guidelines 236


Spacing Conventions 236
Resources 236
Quick Review 237
Exercises 238
Programming Exercises 244

MAKING DECISIONS 247


5 Boolean Expressions 248
Boolean Results 248
Conditional Expressions 249
Equality, Relational, and Logical Tests 250
Short-Circuit Evaluation 258
Boolean Data Type 260
if. . .else Selection Statements 261
One-Way if Statement 261
Two-Way if Statement 266
Nested if. . .else Statement 273
Switch Selection Statements 279
Ternary Operator ? : 283
Order of Operations 285
Coding Standards 298
Guidelines for Placement of Curly Braces 299
Guidelines for Placement of else with Nested if Statements 299
Guidelines for Use of White Space with a Switch Statement 299
Spacing Conventions 300
Advanced Selection Statement Suggestions 300
Resources 300
Quick Review 301
Exercises 302
Programming Exercises 310

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
xii | C# Programming: From Problem Analysis to Program Design, Fourth Edition

REPEATING INSTRUCTIONS 313


6 Why Use a Loop? 314
Using the While Statement 314
Counter-Controlled Loop 316
Sentinel-Controlled Loop 321
State-Controlled Loops 332
Using the for Statement Loop 335
Using the Foreach Statement 342
Using the Do...while Structure 343
Nested Loops 346
Recursive Calls 351
Unconditional Transfer of Control 354
Continue Statement 355
Deciding Which Loop to Use 356
Coding Standards 370
Guidelines for Placement of Curly Braces 371
Spacing Conventions 371
Advanced Loop Statement Suggestions 371
Resources 372
Quick Review 372
Exercises 373
Programming Exercises 379

ARRAYS 383
7 Array Basics 384
Array Declaration 385
Array Initializers 388
Array Access 390
Sentinel-Controlled Access 394
Using Foreach with Arrays 395
Array Class 396
Arrays as Method Parameters 401
Pass by Reference 401
Array Assignment 405
Params Parameters 406

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Table of Contents | xiii

Arrays in Classes 408


Array of User-Defined Objects 410
Arrays as Return Types 410
Coding Standards 428
Guidelines for Naming Arrays 428
Advanced Array Suggestions 428
Resources 429
Quick Review 429
Exercises 430
Programming Exercises 437

ADVANCED COLLECTIONS 439


8 Two-Dimensional Arrays 440
Rectangular Array 440
Jagged Array 450
Multidimensional Arrays 450
ArrayList Class 455
String Class 459
Other Collection Classes 465
BitArray 466
Hashtable 467
Queue 469
Stack 470
Coding Standards 479
Guidelines for Naming Collections 479
Advanced Array Suggestions 479
Resources 479
Quick Review 480
Exercises 481
Programming Exercises 488

INTRODUCTION TO WINDOWS PROGRAMMING 493


9 Contrasting Windows and Console Applications 494
Graphical User Interfaces 496

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
xiv | C# Programming: From Problem Analysis to Program Design, Fourth Edition

Elements of Good Design 500


Consistency 500
Alignment 500
Avoid Clutter 501
Color 501
Target Audience 501
Using C# and Visual Studio to Create Windows-Based
Applications 502
Windows Forms 505
Windows Forms Properties 505
Inspecting the Code Generated by Visual Studio 511
Windows Forms Events 515
Controls 517
Placing, Moving, Resizing, and Deleting Control Objects 520
Methods and Properties of the Control Class 521
Derived Classes of the System.Windows.Forms.Control Class 524
Coding Standards 567
Guidelines for Naming Controls 567
Resources 567
Quick Review 568
Exercises 569
Programming Exercises 574

PROGRAMMING BASED ON EVENTS 577


10 Delegates 578
Defining Delegates 578
Creating Delegate Instances 579
Using Delegates 580
Relationship of Delegates to Events 583
Event Handling in C# 583
Event-Handler Methods 584
ListBox Control Objects 585
Creating a Form to Hold ListBox Controls 585
ListBox Event Handlers 588
Multiple Selections with a ListBox Object 589
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Table of Contents | xv

ComboBox Control Objects 601


Adding ComboBox Objects 602
Handling ComboBox Events 602
Registering a KeyPress Event 603
Programming Event Handlers 603
MenuStrip Control Objects 605
Adding Menus 606
Adding Predefined Standard Windows Dialog Boxes 610
CheckBox and RadioButton Objects 618
CheckBox Objects 618
Adding CheckBox Objects 619
Registering CheckBox Object Events 619
Wiring One Event Handler to Multiple Objects 621
GroupBox Objects 622
RadioButton Objects 622
Adding RadioButton Objects 622
Registering RadioButton Object Events 624
Windows Presentation Foundation (WPF) 633
TabControl Objects 639
Coding Standards 680
Resources 680
Quick Review 680
Exercises 682
Programming Exercises 688

ADVANCED OBJECT-ORIENTED PROGRAMMING


11 FEATURES 691
Object-Oriented Language Features 692
Component-Based Development 693
Inheritance 694
Inheriting from the Object Class 695
Inheriting from Other .NET FCL Classes 695
Creating Base Classes for Inheritance 696
Overriding Methods 699
Creating Derived Classes 700
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
xvi | C# Programming: From Problem Analysis to Program Design, Fourth Edition

Making Stand-Alone Components 705


Creating a Client Application to Use the DLL 715
Using ILDASM to View the Assembly (Optional) 719
Abstract Classes 721
Abstract Methods 721
Sealed Classes 724
Sealed Methods 725
Partial Classes 725
Creating Partial Classes 726
Interfaces 726
Defining an Interface 727
Implementing the Interface 728
.NET Framework Interfaces 733
Polymorphism 734
Polymorphic Programming in .NET 736
Generics 737
Generic Classes 737
Generic Methods 741
Dynamic 742
Dynamic data type 743
var data type 744
Coding Standards 764
Resources 765
Quick Review 765
Exercises 767
Programming Exercises 772

DEBUGGING AND HANDLING EXCEPTIONS 775


12 Errors 776
Run-Time Errors 777
Debugging in C# 778
Exceptions 786
Raising an Exception 790
Bugs, Errors, and Exceptions 791

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Table of Contents | xvii

Exception-Handling Techniques 793


Try. . .Catch. . .Finally Blocks 794
Exception Object 798
Exception Classes 799
Derived Classes of the Base Exception Class 799
ApplicationException Class 800
SystemException Class 801
Filtering Multiple Exceptions 802
Throwing an Exception 809
Input Output (IO) Exceptions 810
Coding Standards 828
Resources 829
Quick Review 829
Exercises 830
Programming Exercises 835

WORKING WITH FILES 837


13 System.IO Namespace 838
File and Directory Classes 840
File Class 840
Directory Class 844
FileInfo and DirectoryInfo Classes 845
File Streams 848
Writing Text Files 851
Reading Text Files 856
Adding a Using Statement 860
Random Access 863
BinaryReader and BinaryWriter Classes 863
Other Stream Classes 869
FileDialog Class 870
Coding Standards 884
Resources 884
Quick Review 884
Exercises 885
Programming Exercises 890

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
xviii | C# Programming: From Problem Analysis to Program Design, Fourth Edition

WORKING WITH DATABASES 893


14 Database Access 894
Database Management Systems 894
ADO.NET 895
Data Providers 896
Connecting to the Database 899
Retrieving Data from the Database 901
Processing the Data 905
Updating Database Data 913
Using Datasets to Process Database Records 913
Data Source Configuration Tools 921
Add New Data Source 921
Dataset Object 931
TableAdapterManager 941
DataSet Designer 942
Connecting Multiple Tables 953
Displaying Data Using Details View 959
Language-Integrated Query (LINQ) 962
Query Expressions 963
Implicitly Typed Local Variables 966
LINQ with Databases 966
LINQ to SQL 968
Coding Standards 969
Resources 969
Quick Review 969
Exercises 971
Programming Exercises 976

WEB-BASED APPLICATIONS 979


15 Web-Based Applications 980
Web Programming Model 980
Static Pages 981
Dynamic Pages 984

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Table of Contents | xix

ASP.NET 986
Visual Studio for Web Development 986
ASP.NET Programming Models 987
Web Forms Page 988
Creating an ASP.NET Web Forms Site 988
Master Pages 993
Cascading Style Sheet (CSS) 997
ASP.NET Empty Web Site 1001
Controls 1004
HTML Controls 1004
HTML Server Controls 1008
Web Forms Standard Server Controls 1012
Available Web Forms Controls 1012
Web Forms Controls of the Common Form Type 1014
Adding Common Form-Type Controls 1018
Validation, Custom, and Composite Controls 1021
Validation Controls 1021
Calendar Control 1026
GridView Control 1033
AccessDataSource 1039
Using Visual Tools to Connect 1040
Setting the Visibility Property 1045
Other Controls 1047
Web Services 1050
Web Services Protocols 1050
Windows Communication Foundation (WCF) 1052
Smart Device Applications (Optional) 1052
Windows 7.x Phone 1053
Silverlight 1054
Creating a Smart Device Application for Windows 7.x Phones 1054
Windows 8 Phone Apps 1061
Creating a Windows 8 Phone App 1063
XML 1064
Code-Behind File 1065
XAML Code 1067
Running the App 1068
Deploying to an Emulator 1068
Deploying to a Device 1071
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
xx | C# Programming: From Problem Analysis to Program Design, Fourth Edition

Coding Standards 1073


Resources 1074
Quick Review 1075
Exercises 1076
Programming Exercises 1081

APPENDIX A: VISUAL STUDIO CONFIGURATION 1083


Customizing the Development Environment 1083
Environment 1085
Projects and Solutions 1088
Text Editor 1089
Debugging 1093
HTML Designer 1093
Windows Forms Designer 1094
Other Options Settings 1095
Choose Toolbox Items 1096
Customize the Toolbars 1097

APPENDIX B: CODE EDITOR TOOLS 1099


Code Snippets 1099
Refactoring 1101
Extrace Method 1102
Rename 1104
Other Refactoring Options 1105
Working with Class Diagrams 1106
Class Details View 1107
Using the Class Diagram to Add Members 1108
Other Code Editor Tips 1109

APPENDIX C: CHARACTER SETS 1111

APPENDIX D: OPERATOR PRECEDENCE 1113

APPENDIX E: C# KEYWORDS 1115

GLOSSARY 1117

INDEX 1131

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
P REFACE

Neale Cousland / Shutterstock.com

C# Programming: From Problem Analysis to Program Design requires no previous introduction to


programming and only a mathematical background of high school algebra. The book uses C#
as the programming language for software development; however, the basic programming
concepts presented can be applied to a number of other languages. Instead of focusing on the
syntax of the C# language, this book uses the C# language to present general programming
concepts. It is the belief of the author that once you develop a thorough understanding of one
programming language, you can effectively apply those concepts to other programming
languages.

Why C#?
C# has gained tremendous popularity in the industry. C# is a true object-oriented language
that includes a rich set of instruction statements. C# was the language used for development
of much of .NET, the Microsoft programming paradigm that includes a collection of
more than 2,000 predefined classes that make up the Framework Class Library (FCL).
Thus, C# has access to a large collection of predefined classes similar to those available to
Java. C# provides tools that make it easy to create graphical user interfaces—similar to the
tools Visual Basic programmers have employed for years. C# also provides the pure data
crunching horsepower to which C/C++ programmers have become accustomed. But
unlike other languages, C# was designed from scratch to accommodate Internet and
Windows applications. C# is an elegant and simple object-oriented language that allows
programmers to build a breadth of applications. For these reasons, C# was chosen as the
language for this book.

Going Beyond the Traditional CS1 Course


This book was written for the Computer Science 1 (CS1) student and includes all of the
basic programming constructs normally covered in the traditional CS1 foundation course
for the Computer Science curriculum. Readers begin developing applications
immediately in the first chapter. It includes lots of examples and figures illustrating
basic concepts. A heavy emphasis on illustrating the visual tools that can be used to
create applications is included in this edition. But this book goes beyond what is

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
xxii | C# Programming: From Problem Analysis to Program Design, Fourth Edition

traditionally found in most CS1 textbooks and, because of the inclusion of a number of
advanced applications, this textbook could also be used in an intermediate course for
students who have already been exposed to some programming concepts.

Advanced Topics
After building a solid programming foundation, this book presents rapid application
development techniques that can be used to build a number of advanced types of
applications including Windows, data-driven applications using a database, and Web and
mobile applications for smart devices. Generics, delegates, ArrayLists, dynamic data types,
abstract classes, interfaces, and many advanced object-oriented concepts are introduced.
Readers retrieve data from files and store data both to sequential and binary files. Solutions
involving multidimensional arrays and other advanced collection classes are demonstrated.
Illustrating the drag-and-drop construction approach used with Visual Studio, Windows and
Web applications are created. Readers are introduced to the event-driven programming
model, which is based on interactively capturing and responding to user input on Windows
and Web forms. Class libraries, Windows Forms applications, and Windows Presentation
Foundation client applications are created. Two full chapters are devoted to programming
based on events and then those topics are integrated throughout the remainder of the
book. Readers are introduced to ASP.NET for Web applications and ADO.NET for
working with databases.
For first-time programmers, this book is unusual in introducing applications that retrieve
and update data in databases such as those created using Microsoft Access. A number of
visual development tools are illustrated to connect to data sources. Other interesting
topics include retrieving data using Language-Integrated Query (LINQ), developing
stand-alone .dll components (class libraries), and programming applications for mobile
devices such as tablets and smart phones. All of these advanced features are discussed
after the reader has gained a thorough understanding of the basic components found in
programming languages.

Changes in the Fourth Edition


C# Programming: From Problem Analysis to Program Design, Fourth Edition, has been revised and
updated to reflect the latest release of Visual Studio 2012 and C#. Exception-handling
techniques are introduced much earlier and incorporated into exercises throughout the
book. Additional advanced object-oriented concepts are included. Each chapter includes
new programming exercises not seen in previous editions. All example programs, exercises,
and the solution set have been updated using Visual Studio 2012. All screenshots are updated
to the Visual Studio 2012 IDE. Readers are introduced to Visual Studio’s mobile Software
Development Kit for creating applications for smart devices. Apps are created for both
Windows 7.x and Windows 8 phones. The following summarizes some of the changes in
the fourth edition.

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Preface | xxiii

1. Early introduction of exception-handling techniques with numbered Examples


modified to integrate those concepts throughout the book.
2. New Windows Forms controls introduced for creating Windows applications.
3. Guided illustrations of developing smart device apps for the Windows Phone.
4. New Programming Exercises not found in previous editions added to every
chapter. Solutions to all exercises developed by the author.
5. Expanded Coding Standards section at the end of each chapter summarizes C#
key development standards and guidelines.
6. Increased list of Internet sites added at the end of each chapter in the Resources
section for readers to explore.
7. Additional Notes added throughout the book highlighting tips and ‘‘catch you’’
types of topics.
8. Expanded Glossary provides a reference for keywords tagged throughout
the book.
9. Revised Appendices include special sections, Customizing the Visual Studio
Development Environment and Code Editor Tools, with updated illustrations
and figures.

Approach
A problem-solving methodology based on object-oriented software development is
introduced early and used throughout the book. Programming Examples are presented at
the end of each chapter, and each example follows a consistent approach: analyzing the
problem specifications, designing a solution, implementing the design, and verifying or
validating the solution structures.
The author believes that the best way to learn to program is to experience programming. This
assumption drives the material presented in this textbook. As new concepts are introduced,
they are described using figures and illustrations. Examples are shown and discussed as they
relate to the concept being presented. With a hands-on approach to learning, readers practice
and solidify the concepts presented by completing the end of the chapter exercises. Readers
are also encouraged throughout the book to explore and make use of the more than 2,000
classes that make up the Framework Class Library (FCL).
Every chapter begins with a list of objectives and a short overview of the previous
chapter. Text in each chapter is supplemented with figures and tables to help visual
learners grasp the concepts being presented. Each chapter is sprinkled with useful tips and
hints as NOTES on the concepts being presented. Code snippets and numbered examples
are embedded as new concepts are introduced in each chapter. In addition, each chapter
contains complete working programs illustrating an application using C#. Every chapter
ends with a Coding Standards section, which provides a summary of acceptable
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
xxiv | C# Programming: From Problem Analysis to Program Design, Fourth Edition

conventions or guidelines pertaining to the chapter’s topics that focus on style issues.
A list of Web sites for readers to explore is included in a special Resources section at
the end of each chapter. A summary of the major points covered in that chapter and
review exercises in both objective and subjective formats are included. Every chapter
contains 10 programming exercises that give readers an opportunity to experience
programming.

Using this Book for Two Different Courses


Although this book is primarily intended for a beginning programming course, it will also
work well in an intermediate course. For courses introducing students to programming,
Chapters 1 through 8 should be covered in detail. Depending on how quickly students are
able to grasp the material, the course could end in any of the chapters following Chapter 8. For
example, ending with Chapter 9, Introduction to Windows Programming, would give
students an opportunity to get excited about continuing their work in programming in
upcoming semesters.
For an intermediate course, where the first course was taught using a different language, the
last part of Chapter 1 along with Appendices A and B could be read to orient the readers to
running an application using Visual Studio. Students could be encouraged to scan Chapters 2
through 7 and review Chapter 8 more extensively. Scanning these chapters, students could
compare and contrast the details of the C# language with the programming languages they
already know.
For the intermediate course where the first course was taught using C#, Chapters 4, 7, and 8
should be reviewed, because topics covered in these chapters—Creating your Own Classes
and Arrays—are often more difficult for the student to grasp. The remainder of the book
beginning in Chapter 9 would be included for the intermediate course.

Overview of the Chapters


Chapter 1 briefly reviews the history of computers and programming languages including the
evolution of C# and .NET. This chapter explains the difference between structured and
object-oriented programming and includes the software development methodology used
throughout the remainder of the book. This chapter describes the different types of
applications that can be developed using C#. It discusses the basic elements found in a C#
program and illustrates how to compile, run, and debug an application.
The focus in Chapter 2 is data types and expressions. Readers gain an understanding of how
types, classes, and objects are related. They also learn how to perform arithmetic procedures on
the data, how to display formatted data, and how expressions are evaluated using operator
precedence. Chapter 3 extends the manipulation of the data through introducing methods and
behaviors of the data. Readers learn to write statements that call methods and to write their
own class methods. They learn how to pass arguments to methods that return values and to
those that do not.

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Preface | xxv

Readers learn to create their own classes in Chapter 4. This chapter introduces the
components of a class including the data, property, and method members. Special methods,
including constructors, are written.
Chapters 5 and 6 introduce control structures that alter the sequential flow of execution.
Selection control constructs are introduced in Chapter 5. One-way, multiway, switch, and
ternary operators used to make decisions are illustrated. Looping is introduced in Chapter 6.
The rich set of iteration operators including while, for, do while, and foreach are
explored. Recursive solutions are also explored.
Chapter 7 discusses arrays. This chapter describes how to declare and perform compile-time
initialization of array elements. The Array class and its many members are introduced.
Methods of the string and ArrayList classes are included in Chapter 8. Multidimensional
arrays and other collection classes, including stacks, queues, and hash tables are also
introduced in Chapter 8.
Chapters 9 and 10 present a different way of programming, which is based on interactively
responding to events. A number of classes in the FCL that are used to create Windows
applications are introduced. Elements of good design are discussed in Chapter 9. Delegates
are also explored in Chapter 9. Visual Studio’s drag-and-drop approach to rapid application
development is introduced and used in these chapters. The Windows Presentation Foundation
(WPF) is also introduced in Chapter 10 as an alternative approach to Windows Forms for
creating Windows applications.
Advanced object-oriented programming features are the focus of Chapter 11. Readers are
introduced to component-based development and learn how to create their own class library
files. Inheritance, interfaces, abstract classes, sealed classes, generic types, partial classes, and
polymorphic programming are discussed in detail. Advanced features such as overriding,
overloading, and the use of virtual methods are also included in Chapter 11. Static versus
dynamic typing is also investigated in Chapter 11.
Chapter 12 discusses debugging and exception handling techniques. The chapter introduces
one of the tools available in Visual Studio, the Debugger, which can be used to observe the
run-time environment, take an up-close look at the code, and locate logic errors. The try. . .
catch. . .finally block is discussed for handling exceptions. In addition to discussing .NET
exception classes, custom exceptions are designed.
Chapter 13 presents the basics of creating, opening, closing, reading, and writing files. The
major classes used to work with file and directory systems are introduced. Chapter 14
introduces a number of new namespaces collectively called ADO.NET, which consists of a
managed set of library classes that enables interaction with databases. The chapter illustrates
how ADO.NET classes are used to retrieve and update data in databases. The visual
programming tools and wizards available with Visual Studio, which simplify accessing data,
are covered in this chapter. The Language-Integrated Query (LINQ) is also introduced in
Chapter 14.
The focus of Chapter 15 is on Web applications. Readers explore how the design of Web-
based applications differs from Windows applications. They discover the differences between

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
xxvi | C# Programming: From Problem Analysis to Program Design, Fourth Edition

static and dynamic Web pages and how HTML and Web server controls differ. Master pages
and Cascading Style Sheets are introduced. Also included in Chapter 15 is an introduction to
mobile applications that can be viewed with small smart devices such as the Windows Phone.
Chapter 15 illustrates how validation controls can be used to check users’ input values and
shows how the ADO.NET classes, introduced in Chapter 14, can also be used with Web
applications to access database records.
Appendix A presents suggestions for customizing the appearance and behavior of the
Integrated Development Environment (IDE). Appendix B discusses the Code Editor
features of Visual Studio. Code snippets and refactoring are described. These new features
improve programmer productivity by reducing the number of keystrokes required to enter
program statements. This appendix also illustrates developing applications visually using class
diagrams. Appendix C lists the Unicode and ASCII (American Standard Code for Information
Interchange) character sets. Appendix D shows the precedence of the C# operators and
Appendix E lists the C# keywords.

Features
Every chapter in this book includes the following features. These features are both conducive
to learning in the classroom and enable you to learn the material at your own pace.
l Multi-color interior design shows accurate C# code and related comments.
l Learning objectives offer an outline of the concepts discussed in detail in the chapter.
l Hundreds of visual diagrams throughout the text illustrate difficult concepts.
l Syntax boxes show the general form for different types of statements.
l Numbered examples illustrate the key concepts with their relevant code, and the code
is often followed by a sample run. An explanation follows that describes the functions
of the most difficult lines of code.
l Notes highlight important facts about the concepts introduced in the chapter.
l Numerous tables are included that describe and summarize information compactly for
easy viewing.
l A Coding Standards section provides a summary of acceptable conventions or guidelines
pertaining to the chapter’s topic. These coding/programming guidelines help ensure
consistency and reduce the number of bugs and errors entered into programming projects.
l Internet sites listed including tutorials that can be used to enhance concepts are
presented in the Resources section.
l Programming Examples are complete programs featured at the end of the chapter. The
examples contain the distinct stages of preparing a problem specification, analyzing the
problem, designing the solution, and coding the solution.
l Quick Reviews offer a summary of the concepts covered in the chapter.

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Preface | xxvii

l Exercises further reinforce learning and ensure that students have, in fact, absorbed the
material. Both objective and subjective types of questions are included at the end of
each chapter.
l Programming Exercises challenge students to write C# programs with a specified
outcome.
l The glossary at the end of the book lists nearly four-hundred key terms in alphabetical
order along with definitions for easy reference. Throughout this text the terms set in
bold indicate that they are defined in the glossary.
From beginning to end, the concepts are introduced at a pace that is conducive to learning.
The writing style of this book is simple and straightforward, and it parallels the teaching style of
a classroom. The concepts introduced are described using examples and small programs.
The chapters have two types of programs. The first type includes small programs that are part
of the numbered examples and are used to explain key concepts. This book also features
numerous case studies called Programming Examples. These Programming Examples are
placed at the end of the chapters to pull together many of the concepts presented
throughout the chapter. The programs are designed to be methodical and workable. Each
Programming Example starts with a Problem Analysis and is then followed by the Algorithm
Design. Every step of the algorithm is then coded in C#. In addition to teaching problem-
solving techniques, these detailed programs show the user how to implement concepts in an
actual C# program. Students are encouraged to study the Programming Examples very
carefully in order to learn C# effectively.
All source code and solutions have been written, compiled, and tested by quality assurance
with Visual Studio Professional 2012.
Microsoft Visual C# can be packaged with this text. Please contact your Course
Technology Sales Representative for more information.

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
FEATURES OF THE BOOK

Numerous visual
diagrams
throughout the
text illustrate
difficult concepts.
Updated screen
shots of what
readers see in
Visual Studio are
also included
throughout the
book.

Multi-color
interior design
shows accurate
C# code and
related
comments.
Throughout the
book, keywords
are shown in blue
and comments
appear in green.

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Syntax boxes
show the general
form for different
types of
statements.

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Notes provide short quick
tips highlighting important
concepts and features that
might be overlooked.

Non-keyword code appears


in a different font
throughout the text so
readers can quickly
distinguish program
statements from normal
text.

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Numbered
examples
illustrate the key
concepts with
their relevant
code, and the
code is often
followed by a
sample run. An
explanation
follows that
describes the
functions of the
most difficult
lines of code.

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Programming
Examples are complete
programs featured at
the end of the chapter.
The examples contain
the distinct stages of
preparing a problem
specification,
analyzing the problem,
designing the solution,
and coding the
implementation.

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Coding/programming
style guidelines and
suggestions are
featured at the end
of each chapter.

A special Resources
section at the end of
each chapter offers a
number of Web sites
for the reader to
explore.

Quick Review offers


a summary of the
concepts covered in
the chapter.

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Exercises further
reinforce learning
and ensure that
students have, in
fact, absorbed the
material. Both
objective and
subjective types of
activities are
included at the end
of each chapter.

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Programming
Exercises challenge
students to write C#
programs with a
specified outcome.

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
xxxvi | C# Programming: From Problem Analysis to Program Design, Fourth Edition

Instructor Resources
The following teaching tools are available for download at our Instructor Companion Site.
Simply search for this text at login.cengage.com. An instructor login is required.
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.
ExamView. This textbook is accompanied by ExamView, a powerful testing software
package that allows instructors to create and administer printed, computer (LAN-based), and
Internet exams. ExamView includes hundreds of questions that correspond to the topics
covered in this text, enabling students to generate detailed study guides that include page
references for further review. These computer-based and Internet-testing components allow
students to take exams at their computers, and save the instructor time because each exam is
graded automatically.
PowerPoint Presentations. This book comes with Microsoft PowerPoint slides for each
chapter. These are included as a teaching aid for classroom presentations, either to make
available to students on the network for chapter review, or to be printed for classroom
distribution. Instructors can add their own slides for additional topics that they introduce to
the class.
Source Code for Examples. The complete Visual Studio project files for the examples
included within each chapter are available for instructors and are also posted for students on
www.cengagebrain.com. Individual source code files are stored with a .cs extension inside the
project subdirectory.
Programming Exercises Solution Files. The complete Visual Studio project files for the
solutions to all programming exercises included at the end of the chapters are provided. The
individual source code files are stored with a .cs extension inside the project subdirectory.

Acknowledgments
I would like to express my gratitude for the opportunity to complete the fourth edition of this
book. Like the other editions, it was a huge undertaking for me. Special thanks go out to
Alyssa Pratt, Senior Product Manager at Cengage Learning, for her positive comments,
guidance, and support. She was a pleasure to work with again on this new edition. I am
grateful to the Quality Assurance team members who verified that each of the examples and
exercise solutions worked properly. Also thanks to the Content Manager and Copy Editor,
Jennifer Feltri-George and Andrea Schein, who provided great suggestions as we progressed
with the project.
I am very grateful to the following reviewers for their uplifting comments and suggestions for
improvements:

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Preface | xxxvii

Zaina Ajackie: American InterContinental University


Kevin Lertwachara: California Polytechnic State University
Syed Raza: Trenholm State Technical College
Dale Wallentine: Stevens-Henager College
I hope that the reviewers will see that many of their suggestions were implemented. The
textbook is much improved because of their contributions.

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Neale Cousland / Shutterstock.com
CHAPTER
1
I NTRODUCTION TO
COMPUTING AND
P ROGRAMMING
I N T H I S C H A P T E R , YO U W I L L :

. Learn about the history of computers


. Learn to differentiate between system and application software
. Learn the steps of software development
. Explore different programming methodologies
. Learn why C# is being used today for software development
. Distinguish between the different types of applications that can
be created with C#
. Explore a program written in C#
. Examine the basic elements of a C# program
. Compile, run, build, and debug an application
. Create an application that displays output
. Work through a programming example that illustrates the
chapter's concepts

All Microsoft screenshots used with permission from Microsoft Corporation.


Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
2 | Chapter 1: Introduction to Computing and Programming

Computers have penetrated every aspect of our society and have greatly simplified many
tasks. Can you picture yourself typing a paper on an electric typewriter? Would you use an
eraser to make your corrections? Would you start from scratch to increase or decrease
your margins or line spacing? Can you imagine living in an age without electronic
messaging or e-mail capability? What would you do without an automatic teller machine
(ATM) in your neighborhood?
Computers have become such an integral part of our lives that many of their functions are
taken for granted. Yet, only a few years ago, mobile apps, text messaging and cloud
computing were unknown. Social media technologies like internet forums, weblogs,
wikis, podcasts and social networks like Facebook were unknown. In 2012 social media
became one of the most powerful sources for news updates through platforms like Twitter
and Facebook. Advances in computing are occurring every day, and the programs that are
loaded on your computer have become very complex. The technology of wireless
communication is advancing quickly. Expectations are that tablet sales will grow by 200
percent through 2016. Over 100 million units will be sold in 2012. For most consumers,
tablets are not replacements for their conventional computers, but are added devices
they’ll purchase. Mobile applications for smartphones, pocket and tablet PCs, and other
handheld wireless computers are increasingly in demand. To reach this level of
complexity, software development has gone through a number of eras, and today
technical advances accumulate faster and faster. What new types of computer services
and programs will be integral to our daily lives in the future? This book focuses on
creating software programs. Before beginning the journey into software development, a
historical perspective on computing is included to help you see the potential for
advancements that awaits you.

History of Computers
Computing dates back some 5000 years. Many consider the abacus to be the first computer.
Used by merchants of the past and present for trading transactions, the abacus is a calculating
device that uses a system of sliding beads on a rack for addition and subtraction.
In 1642, another calculating device, called the Pascaline, was created. The Pascaline had
eight movable dials on wheels that could calculate sums up to eight figures long. Both the
abacus and Pascaline could perform only addition and subtraction. It was not until the
1830s that the first general-purpose computer, the Analytical Engine, was available.
Charles Babbage and his assistant, Lady Augusta Ada Bryon, Countess of Lovelace,
designed the Analytical Engine. Although it was very primitive by today’s standards, it
was the prototype for what is known today as a general-purpose computer. The Analytical
Engine included input devices, memory storage, a control unit that allowed processing
instructions in any sequence, and output devices.

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
History of Computers | 3

In the 1980s, the U.S. Defense Department named the Ada programming language in honor 1
of Lady Lovelace. She has been called the world’s first programmer. Controversy surrounds
her title. Lady Byron was probably the fourth or fifth person to write programs. She did
programming as a student of Charles Babbage and reworked some of his calculations.

Many computer historians believe the present day to be in the fifth generation of modern
computing. Each era is characterized by an important advancement. In the mid-1940s, the
Second World War, with its need for strategic types of calculations, spurred on the first
generation of general-purpose machines. These large, first-generation computers were
distinguished by the use of vacuum tubes. They were difficult to program and limited in
functionality. The operating instructions were made to order for each specific task.
The invention of the transistor in 1956 led to second-generation computers, which were
smaller, faster, more reliable, and more energy efficient than their predecessors. The
software industry was born during the second generation of computers with the
introduction of FORTRAN and COBOL.
The third generation, 1964–1971, saw computers become smaller, as transistors were
squeezed onto small silicon discs (single chips), which were called semiconductors.
Operating systems, as they are known today, which allowed machines to run many
different programs at once, were also first seen in third-generation systems.
As time passed, chips kept getting smaller and capable of storing more transistors, making
computers more powerful and less expensive. The Intel 4004 chip, developed in 1971,
placed the most important components of a computer (central processing unit, memory,
and input and output controls) on a minuscule chip about half the size of a dime. Many
household items such as microwave ovens, television sets, and automobiles benefited from
the fourth generation of computing.
During the fourth generation, computer manufacturers tried to bring computing to
general consumers. In 1981, IBM introduced its personal computer (PC). The 1980s
saw an expansion in computer use as clones of the IBM PC made the personal computer
even more affordable. We also saw the development of Graphical User Interfaces (GUIs)
and the mouse as a handheld input device. The number of personal computers in use more
than doubled from two million in 1981 to 5.5 million in 1982. Ten years later, 65 million
PCs were in use.

According to the October 2010 U.S. Census Bureau’s Current Population Survey, released
in July 2012, over 76% of households in the United States had computers.

Defining a fifth generation of systems is somewhat difficult because the generation is still
young. Computers can now accept spoken word instructions, imitate human reasoning
through artificial intelligence, and communicate with devices instantaneously around the

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
4 | Chapter 1: Introduction to Computing and Programming

globe by transmitting digital media. Mobile apps are growing. By applying problem-
solving steps, expert systems assist doctors in making diagnoses. Healthcare professionals
are now using handheld devices in patients’ rooms to retrieve and update patient records.
Using handheld devices, drivers of delivery trucks are accessing global positioning systems
(GPS) to verify locations of customers for pickups and deliveries. Sitting at a traffic light,
you can check your e-mail, make airline reservations, remotely monitor and manage
household appliances, and access your checking and savings accounts. Using wireless
networks, students can access a professor’s notes when they enter the classroom.
Major advances in software are anticipated as integrated development environments
(IDEs) such as Visual Studio make it easier to develop applications for the Internet
rapidly. Because of the programmability of the computer, the imagination of software
developers is set free to conjure the computing functions of the future.
The real power of the computer does not lie in the hardware, which comprises the
physical components that make up the system. The functionality lies in the software
available to make use of the hardware. The hardware processes complex patterns of 0s and
1s. The software actually transposes these 0s and 1s into text, images, and documents that
people can read. The next section begins the discussion on software.

System and Application Software


Software consists of programs, which are sets of instructions telling the computer exactly
what to do. The instructions might tell the computer to add up a set of numbers, compare
two names, or make a decision based on the result of a calculation. Just as a cook follows a
set of instructions (a recipe) to prepare a dish, the computer follows instructions without
adding extra salt to perform a useful task. The next sections describe the two major
categories of software: system software and application software.

System Software
System software is loaded when you power on the computer. When thinking of system
software, most people think of operating systems. Operating systems such as Windows 8,
Android, iOS, Windows 7, and Linux are types of programs that oversee and coordinate the
resources on the machine. Included are file system utilities, small programs that take care of
locating files and keeping up with the details of a file’s name, size, and date of creation.
System software programs perform a variety of other functions: setting up directories;
moving, copying, and deleting files; transferring data from secondary storage to primary
memory; formatting media; and displaying data on screens. Operating systems include
communication programs for connecting to the Internet or connecting to output devices
such as printers. They include user interface subsystems for managing the look and feel of
the system.

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
System and Application Software | 5

Operating systems are one type of system software. They are utility programs that make it 1
easier for you to use the hardware.

Another type of system software includes compilers, interpreters, and assemblers. As you
begin learning software development, you will write instructions for the computer using a
programming language. Modern programming languages are designed to be easy to
read and write. They are called high-level languages because they are written in
English-like statements. The programming language you will be using is C#
(pronounced see sharp). Other high-level computer programming languages include
Visual Basic, FORTRAN, Pascal, C, C++, and Java.
Before the computer can execute the instructions written in a programming language such
as C#, the instructions must be translated into machine-readable format. A compiler
makes this conversion. Figure 1-1 shows what a machine language instruction looks like.

ª 2013 Cengage Learning

FIGURE 1-1 A machine language instruction

Just as the English language has rules for sentence construction, programming languages
such as C# have a set of rules, called syntax, that must be followed. Before translating
code into machine-readable form, a compiler checks for rule violations. Compilers do not
convert any statements into machine language until all syntax errors are removed. Code
can be interpreted as well as compiled. Intepreters translate one statement of code into
machine-readable form and then they execute that line. They then translate the next
instruction, execute it, and so on. Unlike compilers, which look at entire pieces of code,
interpreters check for rule violations line by line. If the line does not contain an error, it
is converted to machine language. Interpreters are normally slower than compilers. Many
languages offer both compilers and interpreters, including C, BASIC, Python, and Lisp.
Assemblers convert the assembly programming language, which is a low-level

Copyright 2013 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Other documents randomly have
different content
The Project Gutenberg eBook of In Trust: The Story of
a Lady and Her Lover
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.

Title: In Trust: The Story of a Lady and Her Lover

Author: Mrs. Oliphant

Release date: March 20, 2021 [eBook #64888]


Most recently updated: October 18, 2024

Language: English

Credits: Chuck Greif and the Online Distributed Proofreading Team at


http://www.pgdp.net (This file was produced from images
available at The Internet Archive)

*** START OF THE PROJECT GUTENBERG EBOOK IN TRUST: THE


STORY OF A LADY AND HER LOVER ***
IN TRUST

Ballantyne-Press
BALLANTYNE, HANSON AND CO
EDINBURGH AND LONDON

IN TRUST
THE STORY OF A LADY AND HER LOVER

BY

M. O. W. OLIPHANT

AUTHOR OF ‘THE CHRONICLES OF CARLINGFORD’ ETC.

NEW EDITION

LONDON
LONGMANS, GREEN, AND CO.
1883

All rights reserved


CONTENTS
CHAPTER PAGE
I. Father and Daughter 1
II. The Rest of the Family 11
III. The ‘Game’ 22
IV. Under the Beeches 34
V. Explanations 47
VI. Good-bye 59
VII. Cross-examination 70
VIII. The Meadowlands’ Party 83
IX. Cosmo 94
X. Family Counsels 108
XI. Projects of Marriage 121
XII. Mistress and Maid 134
XIII. Heathcote Mountford 146
XIV.The Spectator’s View 160
XV. Tampering with a Lawyer 171
XVI. Good Advice 184
XVII. The Absolute and the Comparative 198
XVIII. Afterthoughts 211
XIX. The Catastrophe 228
XX. The Will 239
XXI. When all was Over 252
XXII. Sophistry 268
XXIII. Heathcote’s Proposal 279
XXIV. A Visitor 292
XXV. Packing Up 307
XXVI. Going Away 318
XXVII. A New Beginning 331
XXVIII. Heathcote’s Career 342
XXIX. Charley Interferes 356
XXX. The Rector Satisfied 370
XXXI. Fallen from her High Estate 383
XXXII. Rose on her Defence 397
XXXIII. The Man of the Period 414
XXXIV. The Heiress’s Trial 422
XXXV. A Simple Woman 442
XXXVI. The Last 456
IN TRUST.
CHAPTER I.

FATHER AND DAUGHTER.

‘My dear, the case is as plain as noonday; you must give this man up.’
‘The case is not plain to me, father—at least, not in your sense.’
‘Anne, you are very positive and self-opinionated, but you cannot—it is
not possible—set up your judgment against mine on such a point. You, an
inexperienced, prejudiced girl, a rustic with no knowledge of the world!
What do you know about the man? Oh, I allow he is well enough to look at;
he has had the usual amount of education, and so forth; but what do you
know about him? that is what I ask.’
‘Not much, father,’ said Anne, steadily; ‘but I know him.’
‘Stuff! you, a girl not much over twenty, know a man! Does he tell you,
do you suppose, all the adventures of his life? Does he confess his sins to
you? A young fellow that has been trained at a public school, that has been
at the university, that has knocked about the world—is he going to confide
all that to you? He would be unworthy the name of gentleman if he did.’
‘Would he not be more unworthy the name of gentleman if he had done
things which he could not confide to me?’ said Anne; then reddening
suddenly, she added, ‘And even if it were so, father, if in those days he had
done things unfit for my ears, let him be silent; I will not ask any questions:
I know what he is now.’
‘Oh, stuff, I tell you! stuff and nonsense, child! You know what he is
now! Yes, what he is when his best coat is on, when he is going to church
with his hymn-book in his pocket and you on his arm; that is a very
edifying aspect of him; but if you think that is all, or nearly all——’
Anne was silent. It was not that she was convinced, but that her
indignation took words from her. She could not make any reply to such
calumnies; and this was troublesome to her father, who preferred an
argument to a distinct and unsupported statement. He looked at her for a
moment, baffled, feeling himself cut short in the full flow of utterance—
then picked up the thread again, and resumed:
‘You would be a fool to trust in any man in that unguarded way: and
above all in a lawyer. They are all rogues; it is in them. When did you ever
hear a good word spoken for that class of men? I will not consent to any
such nonsense: and if you act without my consent, you know the
consequence. I will not give your mother’s money to maintain in luxury a
man who is—who will be—never mind! You shall not have it. I will give it
to Rose, as I have the power.’
‘You would not be so unjust,’ said Anne.
‘Unjust! I will do it if you defy me in this way. Rose has always been a
better child to me than you have been; and she shall have the money if you
don’t mind.’
Whoever had looked at Anne Mountford then would not have given
much for the chance of her submission. She said nothing, but her upper lip
shut down upon the lower with an unrelenting, immovable determination.
She would not even add a word to her protest against the possibility of the
injustice with which she had been threatened. She was too proud to repeat
herself; she stood still, unbending, betraying no impatience, ready to receive
with calmness everything that might be said to her, but firm as the house
upon its foundations, or the hills that are called everlasting. Her father knew
something of the character of his eldest child; he knew very well that no
small argument would move her, but perhaps he was not aware how far
beyond his power she was. He looked at her, however, with a passionate
annoyance very different from her calm, and with something vindictive and
almost spiteful in his reddish-grey eyes. Most likely he had felt himself
dashed against the wall of her strong will before now, and had been
exasperated by the calm force of opposition which he could make no head
against.
‘You hear what I say,’ he repeated roughly; ‘if you insist, I shall exercise
the right your mother gave me; I shall alter my will: and the fortune which
is no doubt your chief attraction in this man’s eyes—the fortune he has been
calculating upon—I will give to Rose. You hear what I say?’
‘Yes,’ said Anne. She bowed her head gravely; no doubt that she
understood him, and equally no doubt that what he said had moved her as
much as a shower of rain might have done, and that she was fully
determined to take her own way.
‘On your own head be it then,’ he cried.
She bowed again, and after waiting for a moment to see if he had
anything further to say to her, went quietly out of the room. It was in the
library of a country house that this interview had taken place—the
commonplace business room of a country gentleman of no very great
pretensions. The walls were lined with bookcases in which there was a
tolerable collection of books, but yet they did not tell for much in the place.
They were furniture like the curtains, which were rather shabby, and the old
Turkey carpet—most respectable furniture, yet a little neglected, wanting
renewal. Mr. Mountford’s writing-table was laden with papers; he had
plenty of business to transact, though not of a strictly intellectual kind. He
was an old man, still handsome in his age, with picturesque snow-white hair
in masses, clearly-cut, fine features, and keen eyes of that reddish hazel
which betokens temper. Those eyes constantly burned under the somewhat
projecting eyebrows. They threw a sort of angry lurid light on his face. The
name of the house was Mount; it had been in the Mountford family for
many generations; but it was not a beautiful and dignified house any more
than he was a fine old English gentleman. Both the place and the man had
traditionary rights to popular respect, but neither man nor place had
enforced this claim by any individual beauty or excellence. There was no
doubt as to the right of the Mountfords to be ranked among the gentry of the
district, as good as the best, in so far that the family had been settled there
for centuries; but they were of that curiously commonplace strain which is
prevalent enough among the smaller gentry, without any splendour of
wealth to dazzle the beholder, and which rouses in the mind of the spectator
a wonder as to what it is that makes the squire superior to his neighbours.
The Mountfords from father to son had got on through the world without
any particular harm or good, uninteresting, ordinary people, respectable
enough, yet not even very respectable. They were not rich, they were not
able; they had nothing in themselves to distinguish them from the rest of the
world; yet wherever the name of Mountford appeared, throughout all the
southern counties at least, the claims of its possessor to gentility were
founded on his relationship to the Mountfords of Mount. Most curious of all
the triumphs of the aristocratical principle! Or rather perhaps it is the more
human principle of continuance which is the foundation of this prejudice to
which we are all more or less subject. A family which has lasted, which has
had obstinacy enough to cling to its bit of soil, to its old house, must have
something in it worth respect. This principle, however, tells in favour of the
respectable shopkeeper quite as much as the squire, but it does not tell in
the same way. The Mountfords felt themselves of an entirely different order
from the shopkeeper—why, heaven knows! but their estimate was accepted
by all the world.
Mount had the distinction of being entailed; it was not a large estate nor
a valuable one, and it had been deeply mortgaged when the present Mr.
Mountford, St. John by name, came of age. But he had married an heiress,
who had liberated his acres and added greatly to his social importance. The
first Mrs. Mountford had died early, leaving only one daughter, and at the
same time her entire fortune in the hands of her husband, to do with it what
he pleased. These were the days when public opinion was very unanimous
as to the impropriety and unnecessariness of female rights of any kind, and
everybody applauded Mrs. Mountford for resisting all conditions, and
putting herself and her child unreservedly in her husband’s hands. He had
re-married two years after her death, but unfortunately had succeeded in
obtaining only another girl from unpropitious fate. His first wife’s daughter
was Anne, universally considered as the natural heiress of the considerable
fortune which, after clearing the estate, had remained of her mother’s
money, and which her father had kept scrupulously ‘in a napkin,’ like the
churl in the parable, neither increasing nor diminishing the store. The other
daughter was Rose. Such was the household at Mount in the days when this
history begins. The reigning Mrs. Mountford was a good sort of easy
woman who did not count for much. She was one of the Codringtons of
Carrisford—a ‘very good family’ of the same class as the Mountfords.
Nothing could be better than the connections on both sides—or duller. But
the girls were different. It is very hard to say why the girls should have been
different—perhaps because the present new wave of life has distinctly
affected the girls more than any other class of society. At all events, the
point was indisputable. Anne perhaps might have taken after her mother,
who was of an entirely new stock, not a kind which had ever before been
ingrafted on the steady-going family tree. She had come out of a race partly
mercantile, partly diplomatic; her grandfather had been Spanish; it was even
suspected that one of her ancestors had been a Jew. All kinds of out-of-the-
way sources had furnished the blood which had been destined to mix with
the slow current in the Mountford veins; and probably Anne had inherited
certain bizarre qualities from this jumble. But Rose had no such mixed
antecedents. There was not a drop of blood in her veins that did not belong
to the county, and it was difficult to see how she could have ‘taken after’
her sister Anne, as was sometimes suggested, in respect to peculiarities
which had come to Anne from her mother; but if she did not take after
Anne, who did she take after, as Mrs. Mountford often demanded?
Rose was now eighteen and Anne just over one-and-twenty. They were
considered in the neighbourhood to be attractive girls. A household
possessing two such daughters is naturally supposed to have all the
elements of brightness within it; and perhaps if there had been brothers the
girls would have taken their natural place as harmonisers and peacemakers.
But there were no brothers, and the girls embodied all the confusing and
disturbing influences natural to boys in their own persons, with certain
difficulties appropriate to their natural character. It is true they did not get
into scrapes or into debt; they were not expelled from school or ‘sent down’
from College. Duns did not follow them to the paternal door, or roistering
companions break the family peace. But yet Anne and Rose contrived to
give as much trouble to Mr. and Mrs. Mountford as if they had been Jack
and Tom. These good people had lived for about a dozen years in their rural
mansion like the cabbages in the kitchen garden. Nothing had disturbed
them. There had been no call upon their reasoning faculties, no strain upon
their affections: everything had gone on quite tranquilly and comfortably,
with that quiet persistence of well-being which makes trouble seem
impossible. They had even said to themselves with sighs, that to have only
girls was after all good for something. They could not be tormented as
others were, or even as the rector, one of whose boys had gone ‘to the bad.’
The thing which had been was that which should be. The shocks, the
discoveries, the commotions, which the restless elements involved in male
youth bring with them, could not trouble their quiet existence. So they
consoled themselves, although not without a sigh.
Alas, good people! they had reckoned without their girls. The first storm
that arose in the house was when Anne suddenly discovered that her
governess never detected her false notes when she played, and passed the
mistakes which she made, on purpose to test her, in her grammar. ‘I want
some one who can teach me,’ the girl said. She was only fifteen, but she had
already made a great deal more use of that pernicious faculty of reading
which works so much mischief in the world than Mrs. Mountford approved.
Someone who could teach her! That meant a lady at seventy-five or a
hundred pounds a year, instead of thirty-five, which was what they had
hitherto given. Mrs. Mountford nearly cried over this most unreasonable
demand. Miss Montressor was very nice. She was of a family which had
seen better days, and she was fully conscious of her good fortune in having
gained an entry into a county family. After all, what did it matter about false
notes or mistakes in grammar? It was a ladylike person that was everything.
But when Rose too declared in her little treble that she wanted somebody
who could teach her, Miss Montressor had to go; and the troubles that
followed! To do them justice, the Squire and his wife did their very best to
satisfy these unreasonable young people. They got a German governess
with all kinds of certificates, who taught Rose to say ‘pon chour;’ they got a
French lady, who commended herself to the best feelings of Mrs.
Mountford’s nature by making her up the sweetest cap, but who taught the
girls that Charles I. was all but rescued from the scaffold by the generous
exertions of a Gascon gentleman of the name of D’Artagnan and three
friends who were devoted to him. Mrs. Mountford herself was much
pleased with this information, but Anne and her father were of a different
opinion. However, it would be too long to follow them minutely through all
these troubles. At seventeen Anne wanted Greek and to ‘go in for’
examinations—which gave a still more complete blow to the prejudices of
the house. ‘The same as a young man!’ It was improper in the highest
degree, almost wicked; Mrs. Mountford did not like to think of it. It seemed
to her, as to some of our ablest critics, that nothing but illicit longings after
evil could make a girl wish to pass examinations and acquire knowledge.
She must want to read the naughty books which are written in Greek and
Latin, and which deprave the minds of young men, the good woman
thought. As for the certificates and honours, they might be all very well for
the governesses of whom Mrs. Mountford had such melancholy experience;
but a young lady of a county family, what did she want with them? They
would be things to be ashamed, not proud of. And on this point Anne was
vanquished. She was allowed to learn Greek with many forebodings, but
not to be examined in her knowledge. However, this decision was chiefly
intended to prevent Rose from following her sister, as she always did; for to
refuse Girton to Rose would have been more difficult than to neglect Anne’s
entreaties. For, though Anne was the eldest sister, it was Rose who was the
princess royal and reigned over the whole demesne.
This desire of the higher education on the part of Rose, who still said
‘pon chour,’ and was not at all certain that two and two always make four,
would have been enough to keep the house in commotion if there had not
occurred just then one of the family troubles appropriate to girls after so
many that could not be called feminine. It has already been said that the
rector of the parish had a son who had ‘gone to the bad.’ He had two other
sons, rocks ahead for the young ladies at Mount. Indeed these two young
men were such obvious dangers that Mrs. Mountford had taken precautions
against them while Rose was still in her cradle. One was a curate, his
father’s probable successor; but as the living was in Mr. Mountford’s hands,
and it was always possible that someone else might be preferred to Charley,
some Mountford connection who had a nearer claim, that prospect did not
count for much. The other was nothing at all, a young man at Oxford, not
yet launched upon life. But fortunately these young men, though very
familiar in the house, were not handsome nor dangerously attractive, and
this peril is one which must always be encountered in the country, even by
people of much higher pretensions than the Mountfords. The first trouble,
however, did not come from this obvious quarter, though it came through
there. It was not one of the Ashleys; but it was a person still less
satisfactory. One of the curate’s friends arrived suddenly on a visit in the
late summer—a young Mr. Douglas, a barrister, which sounds well enough;
but not one of the Douglasses who have ever been heard of. They did not
find this out for some time, imagining fondly that he belonged, at a distance
perhaps, to the Morton family, or to the house of Queensberry, or at least to
Douglasses in Scotland, of whom it could be said that they were of
Lanarkshire or Selkirkshire or some other county. Indeed, it was not until
the whole household was thrown into commotion by a morning call from
Mr. Douglas, who asked for Mr. Mountford, and boldly demanded from him
the hand of Anne, that it burst upon them that he was a Douglas of nowhere
at all. He had been very well educated, and he was at the bar; but when he
was asked what branch of the Douglasses he belonged to, he answered
‘None,’ with a smile. ‘I have no relations,’ he said. Relations can be
dispensed with. There is no harm in being without them; but a family was
indispensable, and he belonged to nobody. It was just like Anne, however,
not to care. She did not in the least care, nor did she see any harm in her
lover’s countyless condition. And when Mr. Mountford politely declined the
honour of an alliance with this Mr. Douglas of nowhere at all, she did not
hesitate to say that she entirely disagreed with her father. This was the state
in which things were at the time of the interview I have recorded. Mr.
Mountford was determined, and so was his daughter. This struggle of wills
had taken place before, but never before had it gone so far. In former cases
Anne had given in, or she had been given in to, the one as much as the
other. But now there was no yielding on one side or the other. The father
had declared himself inexorable; the daughter had said little, but her
countenance had said much. And the threat with which he wound up had
introduced an entirely new element into the discussion. What was to come
of it? But that was what at this moment nobody could venture to say.
CHAPTER II.

THE REST OF THE FAMILY.

The old house of Mount was a commodious but ugly house. It was not even
so old as it ought to have been. Only in one corner were there any
picturesque remains of antiquity, and that was in the back of the house, and
did not show. The only thing in its favour was that it had once been a much
larger place than it was now, and a detached bit of lime avenue—very fine
trees, forming in the summer two lovely walls of tender shade—was
supposed in the traditions of the place to indicate where once the chief
entrance and the best part of the mansion had been. At the foot of the
terrace on which these trees stood, and at a considerably lower altitude, was
the flower-garden, very formally laid out, and lying along the side of the
house, which was of dull brick with very flat windows, and might almost
have been a factory, so uninteresting was it; but the lawns that spread
around were green and smooth as velvet, and the park, though not large,
was full of fine trees. Mr. Mountford’s room was in the back of the house,
and Anne had to go from one end to another to reach the common morning-
room of the family, which was the hall. This had been nothing but a mere
passage in former days, though it was square and not badly proportioned;
but the modern taste for antiquity had worked a great change in this once
commonplace vestibule. It had been furnished with those remains which are
always to be found about an old house, relics of past generations, curtains
which had been rejected as too dingy for wear a hundred years ago, but now
were found to be the perfection of tone and taste—old folding screens, and
chairs and tables dismissed as too clumsy or too old-fashioned for the
sitting-rooms of the family. All these together made a room which strangers
called picturesque, but which old neighbours regarded with contempt, as a
thing of shreds and patches. There was but one huge window reaching from
the ceiling almost to the floor, and an equally large mantelpiece almost
matching the window and opposite to it. The large round table before the
fire was covered with an old Indian shawl carefully darned and mended for
this use—a use which had revolted all the old ladies in the county—and
with books, magazines, and newspapers, carefully arranged by old
Saymore, the butler, in a kind of pattern; for Saymore followed his young
ladies, and took a great interest in everything that was artistic. A work-table
in one corner overflowed with crewels; in another stood an easel. The place
was full of the occupations and fancies of the two girls who had fashioned it
into its present shape. While Anne was having the conversation with her
father which has been recorded, Mrs. Mountford and Rose were pursuing
their different employments in this room. Mrs. Mountford was a
contradiction to everything about her. She wore ribbons of the most
pronounced brightness, dresses of the old gay colours; and did worsted
work. She was a round plump woman, with rosy cheeks and a smiling
mouth; but she was not quite so innocent and easy as her looks indicated.
She could stand very fast indeed where any point of interest was concerned
—and she was doubly immovable in consequence of the fact that her
interests were not her own but those of Rose, and therefore she could not be
made to feel guilty in respect to them. She had a little table of her own in
the midst of all the properties—which she called rubbish—accumulated by
the girls, and there pursued her placid way week after week and year after
year, working, as if she had been born a century earlier, groups of roses and
geraniums for cushions and footstools, and strips of many coloured work
for curtains and rugs. Had she been permitted to have her will, the house
would have been furnished with these from garret to basement; but as Rose
was ‘artistic,’ poor Mrs. Mountford’s Berlin wools were rarely made any
use of. They were given away as presents, or disposed of at bazaars. There
was a closet in her own room which was full of them, and a happy woman
was she when any girl of her acquaintance married, or a fancy fair was
announced for any charitable object, which reduced her stores. A
workbasket full of the most brilliant wools in the tidiest bundles, a German
pattern printed in squares, a little pile of tradesmen’s books in red covers,
and a small brown basket full of keys, were the signs of her little settlement
in the hall. These possessions stood upon a small table with three legs,
decorated with a broad band of Mrs. Mountford’s work. She had said boldly
that if she were not permitted to put her own work upon her own table, she
did not know what the world would come to. And upon hearing this protest
Anne had interfered. Anne was the only person who ever interfered to save
her stepmother from the tyranny exercised over her by her own child; but
Mrs. Mountford was not grateful enough to return this service by taking
Anne’s part.
Rose was the presiding spirit of the hall. Though she did not originate
anything, but followed her sister’s lead, yet she carried out all the
suggestions that ever glanced across the surface of Anne’s mind with an
energy which often ended in making the elder sister somewhat ashamed of
her initiative. Anne’s fancies became stereotyped in Rose’s execution, and
nothing but a new idea from the elder changed the current of the younger
girl’s enthusiasm. When Anne took to ornamental design, Rose painted all
the panels of the doors and window shutters, and even had begun a pattern
of sunflowers round the drawing-room (which had been newly decorated
with a dado and three kinds of wall-papers), when Anne fortunately took to
sketching from nature, and saved the walls by directing her sister’s thoughts
in another direction. The easel remained a substantial proof of these studies,
but a new impulse had changed the aspect of affairs. In the course of the
sketching it had been discovered that some of the cottages on the estate
were in the most wretched condition, and Anne, with the instinct of a
budding squire and philanthropist united, had set to work upon plans for
new houses. The consequence of which was that Rose, with compasses and
rulers and a box of freshly-cut pencils, was deep in the question of
sculleries and wash-houses, marking all the measurements upon the plan,
with her whole heart in the work.
‘Anne is a long time with papa,’ said Mrs. Mountford; ‘I suppose she is
trying to talk him over; she might just as well try to move the house. You
girls never will understand that it is of no use arguing with papa.’
‘One never can help thinking that reason must prevail,’ said Rose,
without raising her head, ‘at the end.’
‘Reason!’ said Mrs. Mountford, lifting her hands and her eyebrows; ‘but,
even if it were always reason, what would that matter? As for Anne, she has
a great deal too much self-confidence; she always thinks she is right.’
‘And so she is—almost always,’ said Rose, very busy with her
measuring. ‘Do you happen to remember, mamma, whether it is ninety feet
or a hundred that the pigsty must be off the house?’
‘What should I know about pigsties? I am sure I often wonder papa takes
all the trouble he does when you are both so headstrong. Fortunately for
him he has me to talk to where you are concerned; but Anne!—--oh, here
she is—don’t say anything, she may not like to have it talked about. So here
you are at last, Anne; we thought you were never coming. But I wish I had
someone to do my work for me when I am busy about something else, as
Rose does for you. She never takes so much trouble on my account.’
‘It is not her work,’ said Rose, offended, ‘it is my own. Mayn’t I have
something now and then that is my own? How many yards, Anne, do you
remember, must the pigsty be off the house?’
Anne did not remember this important piece of knowledge. ‘But,’ she
said, ‘it is in that book of specifications. It is dry to read, but it is a very
good book; you should have it on the table to refer to. You have made the
living room too large in comparison with the rest of the house.’
‘Because they are poor,’ said Rose, indignantly. ‘is that to say that they
are to have nothing pretty in their lives?’
‘But there must be a good scullery,’ said Anne. She stood with a very
grave face behind her sister, looking over her shoulder at the drawings
spread out on the table. Whether it was the importance of the scullery, or of
the other matters concerning her own happiness which she had in her head,
it is certain that Anne’s countenance was very serious. The very tone of her
voice proved to those who knew her so well that her mood was graver than
usual. At other times the importance of the scullery would have brought a
tone of laughter, an accent of fun into her voice; but her gravity was now
quite real and unbroken by any lighter sentiment. She was taller than her
sister, and of a different order altogether. Anne was rather pale than
otherwise, with but a slight evanescent colour now and then; her features
good, her face oval, her eyes dark grey, large and lucid, and with long
eyelashes curling upwards. But Rose, though she had all that beauté de
diable which is the privilege of youth, was, like her mother, round and rosy,
though her pretty little face and figure had not the solidity, nor her
complexion the set and rigid tone which placid middle age acquires. The
one face over the other contrasted pleasantly; the elder serious, as if nothing
in heaven or earth could ever make her smile again; the younger bent with
momentary gravity and importance over her work. But they had no air of
belonging to each other. Nothing but an accident could have linked together
two beings so little resembling. The accident was Mr. Mountford, whom
neither of them was at all like. They were not Mountfords at all, as
everybody in the neighbourhood allowed. They took after their mothers, not
the one and indivisible head of the family; but that did not really matter, for
these two girls, like their mothers, were no more than accidents in the
house.
The ancient estate was entailed, and knew nothing of such slight things
as girls. When their father died they would have to give up Mount and go
away from it. It was true that there still would be a great deal of land in the
county belonging to one of them at least, for Mr. Mountford had not been
able to resist the temptation of buying and enlarging his estate at the time
when he married his first wife, and thought of no such misfortune as that of
leaving only a couple of girls behind him. A long life and boys to succeed
him were as certainties in his thoughts when he bought all the lands about
Charwood and the estate of Lower Lilford. There they lay now, embracing
Mount on every side, Mount which must go to Heathcote Mountford, the
head of the other family. It was grievous, but it could not be helped. And
the girls were not Mountfords, either the one or the other. They betrayed,
shall we say, an inherent resentment against the law of entail and all its
harsh consequences, by resembling their mothers, and declining to be like
the race which thus callously cast them forth.
Mrs. Mountford looked at them with very watchful eyes. She knew what
it was which had made her husband send for his eldest daughter into his
study after breakfast. It was a circumstance which often galled Anne, a
high-spirited girl, that her stepmother should be in the secret of all her
personal concerns; but still man and wife are one, and it could not be
helped. This fact, however, that everything was known about her, whether
she would or not, shut her lips and her heart. Why should she be
confidential and open herself to their inspection when they knew it all
beforehand without her? This stopped all inclination to confide, and had its
effect, no doubt, as all repression has, on Anne’s character. Her heart was in
a turmoil now, aching with anger and annoyance, and disappointment, and a
sense of wrong. But the only effect of this was to make her more serious
than ever. In such a mood to win a smile from her, to strike her sense of
humour, which was lively, or to touch her heart, which was tender, was to
open the floodgates, and the girl resented and avoided this risk with all the
force of her nature. And, truth to tell, there was little power, either in Mrs.
Mountford or her daughter, to undo the bonds with which Anne had bound
herself. It was seldom that they appealed to her feelings, and when they
made her laugh it was not in sympathy, but derision—an unamiable and
unsatisfactory kind of laughter. Therefore it happened now that they knew
she was in trouble, and watched her keenly to see the traces of it; and she
knew they knew, and sternly repressed any symptom by which they might
divine how much moved she was.
‘You build your cottages your way,’ cried Rose, ‘and I will build mine in
mine. Papa will let me have my choice as well as you, and just see which
will be liked best.’
‘If Heathcote should have to be consulted,’ said Anne, ‘it will be the
cheapest that he will like best.’
‘Anne! I shouldn’t have thought that even you could be so unfeeling. To
remind us that dear papa——’ cried Mrs. Mountford; ‘dear papa! Do not
speak of his life in that indifferent way, at least before Rose.’
‘Oh, it would not matter,’ said Rose, calmly, ‘whatever happens; for they
are for the Lilford houses on our very own land. Heathcote hasn’t anything
to do with them.’
‘Anne might say, “Nor you either,” my Rosie,’ said her mother; ‘for
everybody knows that you are cut off out of it in every way. Oh, I don’t find
any fault. I knew it when I married, and you have known it all your life. It is
rather hard, however, everything turning out against us, you and me, my
pet; part of the property going away altogether to a distant cousin, and the
rest all tied up because one of you is to be made an eldest son.’
‘Mamma!’ said Rose, petulantly, giving a quick glance up at her mother,
and shrugging her shoulders with the superiority of youth, as who would
say, Why speak of things you don’t understand? Then she closed her
compasses and put down her pencil. ‘Are we to have a game this
afternoon?’ she said; ‘I mean, Anne, are you going to play? Charley and
Willie are sure to come, but if you go off as usual, it will be no good, for
three can’t play.’
The colour came in a flood over Anne’s pale face. ‘Mamma plays better
than I do,’ she said. ‘I have a headache. I don’t think I shall do anything this
afternoon.’
‘Will Mr. Douglas have a headache too?’ said Rose; ‘he generally has
when you have. It is not much fun,’ she added, with a little virtuous
indignation, ‘for Charley and Willie to play with mamma.’
Mrs. Mountford showed no resentment at this frank speech. ‘No,’ she
said, ‘it is not much fun for Charley and Willie. I don’t think it has been
much fun for them since Mr. Douglas came. Anne likes his talk; he is a very
fine talker. It is more interesting to listen to him than to play.’
‘Sometimes it is,’ said Anne gravely, though with another blush; and
then the two others laughed.
‘My dear, you bring it on yourself; if we are not to have your confidence,
we must have our laugh. We have eyes in our head as well as other people
—or, at least, I have eyes in my head,’ said the mother. Anne could not but
acknowledge that there was reason in what she said, but it was not said in a
way to soften the wounded and angry girl.
‘I do not ask you not to laugh,’ she said.
‘You look more like crying,’ said Rose; and she got up and threw her
arms suddenly about her sister, being an impulsive little person whose
sympathies were not to be calculated upon. ‘What is it, dear: tell me,’ she
cried, with her soft lips upon her sister’s cheek.
Anne’s heart swelled as if it would burst out of her breast. There are
states of mind in which everything can be borne but sympathy. The gates so
hastily rolled to and pushed close began to open. The tears came to her
eyes. But then she remembered that the threat her father had made was not
one to be confided to them.
‘Never mind. I have been talking to my father, and he and I don’t see
things in the same light. We don’t always—one can’t help that,’ said Anne,
in a subdued voice.
‘Come up to my room,’ said Rose in her ear. ‘Never mind mamma—oh,
come up to my room, Anne darling, and tell me all about it! I never was
anyone’s confidant before.’
But this was not a process which Anne, shy with a fervour of feeling
more profound than Rose could understand, or she herself express, felt at all
disposed to go through. She put her younger sister gently aside, and brought
her plans too to the table. ‘We had better settle about the pigsties,’ she said,
with a little relaxation of her gravity. She laughed in spite of herself. ‘It is a
safe subject. Show me, Rosie, what you have done.’
Rose was still fresh to this pursuit, and easily recalled to it, so she
produced her drawings with little hesitation, and after a while forgot the
more interesting matter. They sat with their heads together over the plans,
while Mrs. Mountford pursued her worsted work. A moralist might have
found in the innocent-seeming group all that inscrutableness of human
nature which it is so easy to remark and so impossible to fathom. Rose, it
was true, had not much in her little mind except the cottages, and the hope
of producing a plan which should be approved as the best, having in her
heart a childish desire to surpass Anne, which by no means diminished her
faithful allegiance to her as the origin of all impulses and setter of every
fashion. But Anne’s heart, underneath the fresh crispness of her muslin
dress, and the apparent interest with which she pursued her work, and
discussed her sculleries, was beating high with much confused and painful
emotion. Indignation and a sense of wrong, mingled with a certain contempt
even for the threat which had wounded her as an empty menace, never to be
carried out—a false and fictitious weapon meant for no end but that of
giving her pain; and, on the other hand, the disappointment of her hopes,
and a certainty of severance from the love which had been a revelation to
her of so much in heaven and earth of which she was unaware before—
filled her being. She would not give him up, but she would be parted from
him. He would go away, and any intercourse they might hereafter keep up
must be maintained in resistance to the authority under which she had lived
all her life. Thus what she had supposed to be the crown and glory of
existence was summarily turned into bitterness and wrong. She was turning
it over and over in her mind, while she sat there steadily comparing her
measurements with those of her sister, and wondering how long she must
go on with this in order to confound her stepmother’s suspicions, and prove
that she was neither discouraged nor rendered unhappy by what had
happened. Naturally, in her inexperience, Anne gave great importance to
this feat of baffling her stepmother’s observation, and looking ‘just as
usual;’ and naturally, also, she failed altogether in the attempt. Mrs.
Mountford was an experienced woman. She knew what it meant when a girl
looked too much as if nothing had happened. And she watched with great
vigilance, partly by simple instinct, partly with a slight sense of
gratification, that the elder daughter, who was so much more important than
her own child, should feel that she was mortal. It was not any active
malevolence that was in Mrs. Mountford’s mind. She would have been
horrified had it been suggested to her that she wished Anne any harm. She
wished her no harm; but only that she might feel after all that life was not
one triumph and scene of unruffled success and blessedness—which is the
best moral discipline for everybody, as is well known.
CHAPTER III.

THE ‘GAME.’

The name of the parish in which Mount was the principal house was
Moniton, by some supposed to be a corruption of Mount-ton, the village
being situated on the side of a circular hill looking more like a military
mound than a natural object, which gave the name alike to the property and
the district. Mount Hill, as it was called with unnecessary amplification,
was just outside the park gates, and at its foot lay the Rectory, the nearest
neighbouring house with which the Mountfords could exchange civilities.
When one comes to think of it, the very existence of such ecclesiastical
houses close by the mansions of the English gentry and nobility is a
standing menace and danger to that nobler and more elevated class—now
that the family living is no longer a natural provision for a younger son. The
greatest grandee in the land has to receive the clergyman’s family as equals,
whatever may be his private opinion on the subject; they are ladies and
gentlemen, however poor they may be, or little eligible to be introduced
into closer connection with members of the aristocracy, titled or otherwise;
and, as a matter of fact, they have to be so received, whence great trouble
sometimes arises, as everybody knows. The young people at the Hall and
the parsonage grow up together, they meet continually, and join in all each
other’s amusements, and if they determine to spend their lives together
afterwards, notwithstanding all those social differences which are politely
ignored in society, until the moment comes when they must be brought into
prominence, who can wonder at it? The wonder is that on the whole so little
harm occurs. The young Ashleys were the nearest neighbours of the
Mountford girls. They called each other by their Christian names; they
furnished each other with most of their amusements. Had the boys not been
ready to their call for any scheme of pleasure or use, the girls would have
felt themselves aggrieved. But if Charley or Willie had fallen in love with
Anne or Rose, the whole social economy would have been shaken by it, and
no earthquake would have made a greater commotion. Such catastrophes
are constantly happening to the confusion of one district after another all
over the country; but who can do anything to prevent it? That it had not
happened (openly) in the present case was due to no exceptional philosophy
or precaution on any side. And the chance which had made Mr. Cosmo
Douglas speak first instead of his friend, the curate, was in no way a
fortunate one, except in so far, indeed, that, though it produced great pain
and sorrow, it, at least, preserved peace between the two families. The
Rector was as much offended, as indignant as Mr. Mountford could be, at
the audacity of his son’s friend. A stranger, a chance visitor, an intruder in
the parish, he, at least, had no vested rights.
The facts of the case were as yet, however, but imperfectly known.
Douglas had not gone away, though it was known that his interview with
Mr. Mountford had not been a successful one; but that was no reason why
the Ashleys should not stroll up to Mount on this summer afternoon, as was
their very general practice. There was always some business to talk about—
something about the schools, or the savings bank, or other parochial affairs;
and both of them were well aware that without them ‘a game’ was all but
impossible.
‘Do you feel up to it, old fellow?’ Willie said to Charley, who was the
curate. The elder brother did not make any distinct reply. He said, ‘There’s
Douglas to be thought of,’ with a somewhat lugubrious glance behind him
where that conquering hero lay on the grass idly puffing his cigar.
‘Confound Douglas!’ said the younger brother, who was a secular person
and free to speak his mind. Charley Ashley replied only with a stifled sigh.
He might not himself have had the courage to lay his curacy and his hopes
at Anne’s feet, at least for a long time to come, but it was not to be expected
that he could look with pleasure on the man who had rushed in where he
feared to tread, his supplanter, the Jacob who had pushed him out of his
path. But yet he could not help in a certain sense admiring his friend’s
valour. He could not help talking of it as they took their way more slowly
than usual across the park, when Douglas, with a conscious laugh, which
went sharply, like a needle, through the poor curate’s heart, declined to join
them but begged they ‘would not mind’ leaving him behind.
‘When a fellow has the pluck to do it, things generally go well with
him,’ Charley said.
The two brothers were very good friends. The subject of Anne was one
which had never been discussed between them, but Willie Ashley knew by
instinct what were his brother’s sentiments, and Charley was conscious that
he knew. The little roughness with which the one thrust his arm into the
other’s spoke of itself a whole volume of sympathy, and they walked
through the sunshine and under the flickering shadows of the trees, slowly
and heavily, the curate with his head bent, and his brown beard, of which he
was as proud as was becoming to a young clergyman, lying on his breast.
‘Pluck carries everything before it,’ he said, with a sigh. ‘I never was one
of your plucky ones.’
‘If you call that pluck!’ cried the other, ‘when a fellow thinks of nothing
but himself, and goes straight before him, whatever happens.’
The curate pressed his brother’s arm with tacit thanks, but he sighed
even more. ‘All the same it was a plucky thing to do,’ he said.
The young men were seen approaching for a long time before they
reached the house. ‘I wonder what has happened,’ said Rose; ‘they walk as
if they were going to a funeral; but I suppose I had better go and see that
everything is ready for the game.’ After all this was the important matter,
and the Ashleys, though of no great consequence in themselves, were at
least the only young men in the parish; and if the Woodheads came, as Rose
expected, it looked a poor sort of thing to have no men. What the game was
I can scarcely pretend to say. It might be croquet, or it might be lawn tennis.
This is entirely a chronological question, and one upon which, as the date of
this commencement is a little vague, I cannot take upon me to decide. And
just as Willie and Charley approached slowly, in a solemn march, the
familiar house to which they had so often turned with steps and hearts less
weighted, the Woodheads appeared on the other side.
‘I was sure they would come,’ cried Rose; ‘here are Gerty and Fanny.’
These young ladies were a clergyman’s daughters, and might have paired
off most suitably with the Ashleys and no harm done; but perverse
humanity may be so far trusted as to make sure that none of the four
thought of any such sensible arrangement.
As for Anne, a sigh of satisfaction and relief came from her bosom, not
like that deeper sigh which breathed forth the curate’s cares. As soon as she
had seen the game begun and all comfortable, she would escape to her own
business. Her heart beat high with the thought of the meeting that awaited
her, and of the long, confiding, lover’s talk, the pouring out of all her cares
into another heart which was her own. Anne had not been accustomed to
Welcome to Our Bookstore - The Ultimate Destination for Book Lovers
Are you passionate about books and eager to explore new worlds of
knowledge? At our website, we offer a vast collection of books that
cater to every interest and age group. From classic literature to
specialized publications, self-help books, and children’s stories, we
have it all! Each book is a gateway to new adventures, helping you
expand your knowledge and nourish your soul
Experience Convenient and Enjoyable Book Shopping Our website is more
than just an online bookstore—it’s a bridge connecting readers to the
timeless values of culture and wisdom. With a sleek and user-friendly
interface and a smart search system, you can find your favorite books
quickly and easily. Enjoy special promotions, fast home delivery, and
a seamless shopping experience that saves you time and enhances your
love for reading.
Let us accompany you on the journey of exploring knowledge and
personal growth!

ebookgate.com

You might also like