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

eTextbook 978-1285856872 C# Programming: From Problem Analysis to Program Design all chapter instant download

Design

Uploaded by

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

eTextbook 978-1285856872 C# Programming: From Problem Analysis to Program Design all chapter instant download

Design

Uploaded by

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

Download Full Version ebookmass - Visit ebookmass.

com

eTextbook 978-1285856872 C# Programming: From


Problem Analysis to Program Design

https://ebookmass.com/product/etextbook-978-1285856872-c-
programming-from-problem-analysis-to-program-design/

OR CLICK HERE

DOWLOAD NOW

Discover More Ebook - Explore Now at ebookmass.com


Instant digital products (PDF, ePub, MOBI) ready for you
Download now and discover formats that fit your needs...

C++ Programming: From Problem Analysis to Program Design


8th Edition Edition D.S. Malik

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

ebookmass.com

C++ Programming: From Problem Analysis to Program Design


(MindTap Course List) 8th Edition, (Ebook PDF)

https://ebookmass.com/product/c-programming-from-problem-analysis-to-
program-design-mindtap-course-list-8th-edition-ebook-pdf/

ebookmass.com

eTextbook 978-0134448237 C++ How to Program (10th Edition)

https://ebookmass.com/product/etextbook-978-0134448237-c-how-to-
program-10th-edition/

ebookmass.com

Entrepreneurship: Ideas in Action 6th Edition, (Ebook PDF)

https://ebookmass.com/product/entrepreneurship-ideas-in-action-6th-
edition-ebook-pdf/

ebookmass.com
A Documentary History of the Book of Mormon Larry E Morris

https://ebookmass.com/product/a-documentary-history-of-the-book-of-
mormon-larry-e-morris/

ebookmass.com

Jessie's Girl (The Trapper Keeper Diaries Book 1) Naima


Simone

https://ebookmass.com/product/jessies-girl-the-trapper-keeper-diaries-
book-1-naima-simone/

ebookmass.com

Ternary Quantum Dots: Synthesis, Properties, and


Applications (Woodhead Publishing Series in Electronic and
Optical Materials) 1st Edition Oluwatobi Samuel Oluwafemi
https://ebookmass.com/product/ternary-quantum-dots-synthesis-
properties-and-applications-woodhead-publishing-series-in-electronic-
and-optical-materials-1st-edition-oluwatobi-samuel-oluwafemi/
ebookmass.com

Encyclopedia of Spirits: The Ultimate Guide to the Magic


of Fairies, Genies, Demons, Ghosts, Gods & Goddesses

https://ebookmass.com/product/encyclopedia-of-spirits-the-ultimate-
guide-to-the-magic-of-fairies-genies-demons-ghosts-gods-goddesses/

ebookmass.com

The Cerise (Kingdom of Lies Book 1) Bailey Black & Bailey


B.

https://ebookmass.com/product/the-cerise-kingdom-of-lies-
book-1-bailey-black-bailey-b/

ebookmass.com
5 Steps to a 5: 500 AP U.S. Government and Politics
Questions to Know by Test Day 3rd Edition Brian T. Stevens

https://ebookmass.com/product/5-steps-to-a-5-500-ap-u-s-government-
and-politics-questions-to-know-by-test-day-3rd-edition-brian-t-
stevens/
ebookmass.com
vi | C# Programming: From Problem Analysis to Program Design, Fifth Edition

APPENDIX C   Character Sets 1123

APPENDIX D   Operator Precedence 1125

APPENDIX E   C# Keywords 1127

GLOSSARY 1129

INDEX 1143

Copyright 2016 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

© zeljkodan/Shutterstock.com

Prefacexxiii

INTRODUCTION TO COMPUTING
1 AND APPLICATION DEVELOPMENT 1
History of Computers 2
System and Application Software 4
System Software 5
Application Software 7
Software Development Process 7
Steps in the Program Development Process 8
Programming Methodologies 15
Structured Procedural Programming 15
Object-Oriented Programming 18
Evolution of C# and .NET 21
Programming Languages 21
.NET23
Why C#? 25
Types of Applications Developed with C# 26
Web Applications 27
Windows Applications 28
Console Applications 28
Exploring the First C# Program 29
Elements of a C# Program 30
Comments30
Inline Comments 31
Multiline Comments 31

Copyright 2016 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, Fifth Edition

XML Documentation Comments 32


Using Directive 32
Namespace35
Class Definition 36
Main( ) Method 36
Method Body Statements 38
Compiling, Building, and Running an Application 42
Typing Your Program Statements 42
Compilation and Execution Process 42
Compiling the Source Code Using Visual Studio IDE 43
Debugging an Application 50
Syntax Errors 50
Run-time Errors 51
Creating an Application 52
Coding Standards 57
Pseudocode57
Resources 58
Quick Review 59
Exercises 61
Programming Exercises 66

DATA TYPES AND EXPRESSIONS 71


2 Data Representation 72
Bits72
Bytes72
Binary Numbering System 72
Character Sets 75
Kilobyte, Megabyte, Gigabyte, Terabyte, Petabyte. . . 76
Memory Locations for Data
76
Identifiers77
Variables81
Literal Values 81

Copyright 2016 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

Types, Classes, and Objects 82


Types82
Classes83
Objects84
Predefined Data Types 85
Value Types 86
Integral Data Types 87
Floating-Point Types 90
Decimal Types 91
Boolean Variables 92
Declaring Strings 93
Making Data Constant 94
Assignment Statements 94
Basic Arithmetic Operations 98
Increment and Decrement Operations 100
Compound Operations 104
Order of Operations 106
Mixed Expressions 108
Casts109
Formatting Output 110
Width Specifier 115
Coding Standards 125
Naming Conventions 125
Spacing Conventions 126
Declaration Conventions 127
Resources 127
Quick Review 127
Exercises 128
Programming Exercises 134

METHODS AND BEHAVIORS 137


3 Anatomy of a Method 138
Modifiers140
Static Modifier 141
Return Type 142

Copyright 2016 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, Fifth Edition

Method Name 144


Parameters144
Method Body 145
Calling Class Methods 146
Predefined Methods 148
Write( ) Method 149
WriteLine( ) Method 150
Read( ) Method 151
ReadLine( ) Method 153
ReadKey( ) Method 154
Parse( ) Method 154
Methods in the Math Class 157
Writing Your Own Class Methods 163
Void Methods 163
Value-Returning Method 165
Types of Parameters 170
Named and Optional Parameters 175
Default Values with Optional Parameters 176
Named Parameters 177
Coding Standards 186
Naming Conventions 186
Spacing Conventions 186
Declaration Conventions 186
Commenting Conventions 187
Resources 187
Quick Review 187
Exercises 188
Programming Exercises 195

CREATING YOUR OWN CLASSES 197


4 The Object Concept 198
Private Member Data 200
Constructor 204

Copyright 2016 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

Writing Your Own Instance Methods 207


Accessor208
Mutators208
Other Instance Methods 209
Property210
Auto Implemented Properties 212
ToString( ) Method 213
Calling Instance Methods 215
Calling the Constructor 215
Calling Accessor and Mutator Methods 217
Calling Other Instance Methods 218
Testing Your New Class 219
Coding Standards 244
Naming Conventions 244
Classes244
Properties244
Methods245
Constructor Guidelines 245
Spacing Conventions 245
Resources 245
Quick Review 246
Exercises 247
Programming Exercises 253

MAKING DECISIONS 257


5 Boolean Expressions 258
Boolean Results 258
Conditional Expressions 259
Equality, Relational, and Logical Tests 260
Short-Circuit Evaluation 268
Boolean Data Type 270
if. . .else Selection Statements 271
One-Way if Statement 271

Copyright 2016 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, Fifth Edition

Two-Way if Statement 276


TryParse( ) Method 278
Nested if. . .else Statement 283
Switch Selection Statements 289
Ternary Conditional Operator ? : 294
Order of Operations 295
Coding Standards 309
Guidelines for Placement of Curly Braces 309
Guidelines for Placement of else with Nested if Statements 310
Guidelines for Use of White Space with a Switch Statement 310
Spacing Conventions 311
Advanced Selection Statement Suggestions 311
Resources 311
Quick Review 312
Exercises 314
Programming Exercises 322

REPEATING INSTRUCTIONS 325


6 Why Use a Loop? 326
Using the While Statement 326
Counter-Controlled Loop 328
Sentinel-Controlled Loop 334
State-Controlled Loops 345
Using the for Statement Loop 348
Using the Foreach Statement 356
Using the Do. . .while Structure 357
Nested Loops 360
Recursive Calls 365
Unconditional Transfer of Control 368
Continue Statement 369
Deciding Which Loop to Use 370
Coding Standards 384
Guidelines for Placement of Curly Braces 385
Spacing Conventions 385
Advanced Loop Statement Suggestions 385

Copyright 2016 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

Resources 386
Quick Review 386
Exercises 388
Programming Exercises 394

ARRAYS 399
7 Array Basics 400
Array Declaration 401
Array Initializers 404
Array Access 406
Sentinel-Controlled Access 411
Using Foreach with Arrays 412
Array Class 413
Arrays as Method Parameters 419
Pass by Reference 420
Array Assignment 423
Params Parameters 425
Arrays in Classes 426
Array of User-Defined Objects 428
Arrays as Return Types 429
Coding Standards 447
Guidelines for Naming Arrays 447
Advanced Array Suggestions 447
Resources 447
Quick Review 447
Exercises 448
Programming Exercises 455

ADVANCED COLLECTIONS 459


8 Two-Dimensional Arrays 460
Rectangular Array 460
Jagged Array 470
Multidimensional Arrays 470
ArrayList Class 475
String Class 479

Copyright 2016 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, Fifth Edition

String Methods 480


String Interpolation 484
Other Collection Classes 486
BitArray486
Hashtable487
Queue490
Stack491
Coding Standards 500
Guidelines for Naming Collections 500
Advanced Array Suggestions 500
Resources 500
Quick Review 500
Exercises 502
Programming Exercises 509

INTRODUCTION TO WINDOWS PROGRAMMING 513


9 Contrasting Windows and Console Applications 514
Graphical User Interfaces 516
Elements of Good Design 520
Consistency520
Alignment521
Avoid Clutter 521
Color521
Target Audience 521
Using C# and Visual Studio to Create Windows-Based Applications 522
Windows Forms 526
Windows Forms Properties 526
Inspecting the Code Generated by Visual Studio 533
Comparing the Code of Example 9-1 with Example 9-2 534
Windows Forms Events 537
Controls 538
Placing, Moving, Resizing, and Deleting Control Objects 541
Methods and Properties of the Control Class 543
Derived Classes of the System.Windows.Forms.Control Class 545

Copyright 2016 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

Coding Standards 581


Guidelines for Naming Controls 581
Resources 581
Quick Review 582
Exercises 583
Programming Exercises 588

PROGRAMMING BASED ON EVENTS 593


10 Delegates 594
Defining Delegates 594
Creating Delegate Instances 596
Using Delegates 596
Relationship of Delegates to Events 599
Event Handling in C# 599
Event-Handler Methods 600
ListBox Control Objects 601
Creating a Form to Hold ListBox Controls 601
ListBox Event Handlers 604
Multiple Selections with a ListBox Object 605
ComboBox Control Objects 612
Adding ComboBox Objects 613
Handling ComboBox Events 614
Registering other Events 615
Programming Event Handlers 615
MenuStrip Control Objects 617
Adding Menus 618
Adding Predefined Standard Windows Dialog Boxes 622
CheckBox and RadioButton Objects 630
CheckBox Objects 630
Adding CheckBox Objects 631
Registering CheckBox Object Events 631
Wiring One Event Handler to Multiple Objects 633
GroupBox Objects 634
RadioButton Objects 634

Copyright 2016 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, Fifth Edition

Adding RadioButton Objects 634


Registering RadioButton Object Events 636
Windows Presentation Foundation (WPF) 639
TabControl Objects 645
Coding Standards 686
Resources 686
Quick Review 686
Exercises 688
Programming Exercises 695

Advanced Object-Oriented Programming Features 699


11 Object-Oriented Language Features 700
Component-Based Development 701
Inheritance 702
Inheriting from the Object Class 703
Inheriting from Other .NET FCL Classes 703
Creating Base Classes for Inheritance 704
Overriding Methods 707
Creating Derived Classes 709
Making Stand-Alone Components 715
Creating a Client Application to Use the DLL 725
Abstract Classes 729
Abstract Methods 730
Sealed Classes 733
Sealed Methods 734
Partial Classes 734
Creating Partial Classes 735
Interfaces 735
Defining an Interface 736
Implementing the Interface 737
.NET Framework Interfaces 742
Polymorphism 744
Polymorphic Programming in .NET 745
Generics 746

Copyright 2016 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

Generic Classes 746


Generic Methods 751
Dynamic 752
Dynamic data type 752
var data type 753
Coding Standards 773
Resources 774
Quick Review 774
Exercises 777
Programming Exercises 782

DEBUGGING AND HANDLING EXCEPTIONS 785


12 Errors 786
Run-Time Errors 787
Debugging in C# 788
Exceptions 796
Raising an Exception 800
Bugs, Errors, and Exceptions 801
Exception-Handling Techniques 803
Try. . .Catch. . .Finally Blocks 804
Exception Object 808
Exception Classes 810
Derived Classes of the Base Exception Class 810
ApplicationException Class 811
SystemException Class 811
Filtering Multiple Exceptions 813
Exception Filters 816
Throwing an Exception 820
Input Output (IO) Exceptions 821
Coding Standards 839
Resources 840
Quick Review 840
Exercises 841
Programming Exercises 846

Copyright 2016 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, Fifth Edition

WORKING WITH FILES 849


13 System.IO Namespace 850
File and Directory Classes 852
File Class 852
Directory Class 857
FileInfo and DirectoryInfo Classes 858
File Streams 860
Writing Text Files 863
Reading Text Files 869
Adding a Using Statement 873
Random Access 875
BinaryReader and BinaryWriter Classes 876
Other Stream Classes 882
FileDialog Class 883
Coding Standards 897
Resources 897
Quick Review 897
Exercises 899
Programming Exercises 904

WORKING WITH DATABASES 907


14 Database Access 908
Database Management Systems 908
ADO.NET 910
Data Providers 911
Retrieving Data from the Database 916
Processing the Data 920
Updating Database Data 928
Using Datasets to Process Database Records 929
Adding a DataGridView Control to Hold the Dataset 932
Data Source Configuration Tools 937
Add New Data Source 938
Dataset Object 946
TableAdapterManager956

Copyright 2016 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

DataSet Designer 957


Connecting Multiple Tables 968
Language-Integrated Query (LINQ) 975
Query Expressions 976
Implicitly Typed Local Variables 979
Coding Standards 982
Resources 982
Quick Review 982
Exercises 985
Programming Exercises 990

WEB-BASED APPLICATIONS 993


15 Web-Based Applications 994
Web Programming Model 994
Static Pages 995
Dynamic Pages 998
ASP.NET 1000
Visual Studio for Web Development 1000
ASP.NET Programming Models 1001
Web Forms Page 1002
ASP.NET Web Forms Site 1003
Master Pages 1008
Cascading Style Sheet (CSS) 1012
ASP.NET Empty Web Site 1016
Controls 1019
HTML Controls 1019
HTML Server Controls 1025
Web Forms Standard Server Controls 1029
Available Web Forms Controls 1030
Web Forms Controls of the Common Form Type 1031
Adding Common Form-Type Controls 1035
Validation, Custom, and Composite Controls 1038
Validation Controls 1038
Calendar Control 1043

Copyright 2016 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, Fifth Edition

GridView Control 1050


AccessDataSource1060
Using Visual Tools to Connect 1060
Store Databases in App_Data Folder 1062
Setting the Visibility Property 1066
Other Controls 1068
Mobile Applications 1071
Xamarin.Forms1073
iOS Apps 1074
Android Apps 1074
Windows Phone Apps 1075
Silverlight1075
Universal Apps 1076
Running the App 1078
Deploying to an Emulator 1078
Coding Standards 1079
Resources 1079
Quick Review 1080
Exercises 1082
Programming Exercises 1087

Appendix A: Visual Studio Configuration 1089


Customizing the Development Environment 1089
Environment1091
Projects and Solutions 1094
Text Editor 1095
Debugging1099
HTML Designer 1100
Windows Forms Designer 1101
Other Options Settings 1102
Choose Toolbox Items 1102
Customize the Toolbars 1103
Configure and Save Windows Layouts 1104

Copyright 2016 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 | xxi

Appendix B: Code Editor Tools1107


IntelliSense 1107
Syntax Coloring 1108
Colorized Tooltips 1108
Error and Warning Marks 1109
Quick Action Light Bulb Icon 1110
Peek Definition 1112
Refactoring 1112
Extract Method 1113
Rename1114
Other Refactoring Options 1115
Code Snippets 1115
Working with Class Diagrams 1117
Class Details View 1118
Using the Class Diagram to Add Members 1120
Other Code Editor Tips 1121

Appendix C: Character sets1123

Appendix D: OPERATOR PRECEDENCE1125

Appendix E: C# KEYWORDS1127

GLOSSARY1129

INDEX1143

Copyright 2016 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 2016 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 r e fa c e

© zeljkodan/Shutterstock.com

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


introduction to programming but 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 lan-
guage 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. However, 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 appli-
cations. C# is also a great language for mobile application development. It can run on
not only Windows platforms but is very portable and can run on Android and iOS
devices. 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

Copyright 2016 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, Fifth Edition

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. However, this book goes beyond
what is 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 an introduction
to Xamarin for programming applications for mobile devices. 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 Fifth Edition


C# Programming: From Problem Analysis to Program Design, Fifth Edition, has been
revised and updated to reflect the latest release of Visual Studio 2015 and C# 6.0. All
examples are streamlined and unnecessary using statements are removed from each
chapter. The new improvements to the code editor are highlighted from early chap-
ters and summarized in an appendix. 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

Copyright 2016 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

using Visual Studio 2015. All screenshots are updated to the Visual Studio 2015 IDE.
The following summarizes some of the changes in the fifth edition.

1. New C# 6.0 language features such as auto-properties, exception


­filters, and string interpolation are introduced.
2. Beginning with the first example, code is streamlined, reducing the
amount of boilerplate code needed. References to static class mem-
bers are added to all examples throughout this edition to bring static
class members directly into scope.
3. Early introduction of Visual Studio 2015 user interface improvements.
4. New debugging tools, new Windows layout features, enhanced color-
ized tooltips, simplified context menu options, and the new Quick
Action Light Bulb editing tools are illustrated.
5. All screenshots updated to reflect change made in Visual Studio 2015.
6. New Programming Exercises not found in previous editions added
to every chapter. Solutions to all exercises developed by the author.
7. Increased and updated list of Internet sites added at the end of each
chapter in the Resources section for readers to explore.
8. Additional Notes added throughout the book highlighting tips and
“catch you” types of topics.
9. Expanded Glossary provides a reference for keywords tagged
throughout the book.
10. 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 pre-
sented 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 program-
ming. This assumption drives the material presented in this textbook. As new con-
cepts 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 complet-
ing 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 FCL.

Copyright 2016 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, Fifth Edition

Every chapter begins with a list of objectives and a short overview of the previous chap-
ter. 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 chap-
ter contains complete working programs illustrating an application using C#. Every
chapter ends with a Coding Standards section, which provides a summary of acceptable
conventions or guidelines pertaining to the chapter’s topics that focus on style issues.
A list of websites 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 ends with
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 lan-
guage, 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 remain-
der 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 includ-
ing 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 understand-
ing of how types, classes, and objects are related. They also learn how to perform
Copyright 2016 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

arithmetic procedures on the data, how to display formatted data, and how expres-
sions 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.
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.
Chapter 5 introduces 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 com-
pile-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.
Chapter 9 presents 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 fea-
tures 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 intro-
duced. ­Chapter 14 introduces a number of new namespaces collectively called ADO.
NET, which consists of a managed set of library classes that enable interaction with
Copyright 2016 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.
xxviii | C# Programming: From Problem Analysis to Program Design, Fifth Edition

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 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 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 Xamarin used for mobile application
­development. 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 con-
ducive to learning in the classroom and enable you to learn the material at your own pace.

? Multi-color interior design shows accurate C# code and related


comments.

? Learning objectives offer an outline of the concepts discussed in detail


in the chapter.

? Hundreds of visual diagrams throughout the text illustrate difficult


concepts.

? Syntax boxes show the general form for different types of statements.

? 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.

? Notes highlight important facts about the concepts introduced in the


chapter.

Copyright 2016 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 | xxix

? Numerous tables are included that describe and summarize information


compactly for easy viewing.

? 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.

? Internet sites listed including tutorials that can be used to enhance


concepts are presented in the Resources section.

? 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.

? Quick Reviews offer a summary of the concepts covered in the chapter.

? 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.

? Programming Exercises challenge students to write C# programs with a


specified outcome.

? The glossary at the end of the book lists nearly 400 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 paral-
lels 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 Program-
ming Examples are placed at the end of the chapters to pull together many of the con-
cepts 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 2015.

Copyright 2016 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.
F e at u r e s of the Book

Learning
­objectives appear
at the beginning
of each chapter.

Copyright 2016 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.
Numerous
visual ­diagrams
throughout the
text illustrate
­difficult concepts.

Copyright 2016 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.
Numerous tables
are included
that describe
and summarize
information
compactly for
easy viewing.

Copyright 2016 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.
Updated screen
shots of what
readers see in
Visual Studio are
also included
throughout the
book.

Copyright 2016 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.
Another Random Document on
Scribd Without Any Related Topics
Sillä häntä eivät tullimiehet sen jälkeen hyvin puhuttelisi, kun
Lampan ladon luota löytäisivät pelkkää tyhjää. Sillä tullikavaltajat,
kun olisivat onnellisesti päässeet Rantalan ladon ohi, eivät ajaisikaan
Lampalle päin, vaan suoraan Lehmikankaalle eräälle metsäniitylle,
Kortesuolle, joka oli Lampan oma, ja sinne heinälatoihin kätkettäisiin
tavarat. Sieltä he palaisivat yksi kerrallaan ja vasta Vaaralan kylän
kohdalta ajaisivat Suomen puolelle takaisin… Iso-Joonas saisi sitten
heinähäkissä, vähän kerrallaan, kuljettaa tavarat Lampalle.

Niin oli Santeri miettinyt ja nyt selitteli Jussille kamarissaan. Jussin


mielestä oli homma kerrassaan erinomainen eikä hän epäillytkään,
etteikö saisi tullimiehiä uskomaan.

»Ne pitävät minua vähän löylynlyömänä… minua ne uskovat»,


sanoi hän.

»Sitä minäkin! Ja sinä osaat olla perhanan sukkela», kehui häntä


Santeri. »Oinas-Matista ei olisi valehtelemaan, ja Iso-Liisa ei saisi
ketään itseään uskomaan.»

He nauroivat molemmat, ja Santeri tarjosi Jussille taas


kukkuraryypyt ja sikaareja.

Ensi viikolla he aikoivat yrittää. Siihen asti ei tehtäisi mitään,


vaikka Lamppa hoputtaisi kuinka paljon hyvänsä. Valmistuksiakin oli
kaikenlaisia. Pitipä vartavasten ajaa jälkikin Rantalan ladon ohi poikki
Käkisaaren, ja lisäksi» oli paljon muuta, mikä koski aiottua
kavallusretkeä. Luotettavia miehiä piti myös saada kaksi lisää ja
kaksi hevostakin. Oinas-Matti ajaisi Palomäen toisella hevosella ja
Santeri itse oriillaan edellä…
Niin he tuumailivat eivätkä aikoneet Oinas-Matillekaan mitään
puhua ennenkuin samana iltana, jona aiottiin yrittää.

*****

Aiottua poikkivientiä varten oli Santeri saanut jo kaikki kuntoon.


Hän oli kylältä hankkinut kaksi hevosmiestä, jotka olivat ennenkin
olleet »yötöissä» ja tiesivät, mitä muksu markkinoilla maksaa.
Heidän oli määrä vasta hyvin myöhään illalla saapua hevosineen
Palomäkeen, josta yön tullen pantaisiin kuormat liikkeelle.

Määrätyn, päivän aamuna Santeri pani Ranta-Jussin


tiedustelumatkalle Lamppaan. Hän ei ollut käynyt Lampalla koko
viikkoon, vaikka patruuna oli kutsunut harva se päivä, eikä ollut
selittänyt patruunalle mitään, kuinka hänellä oli aikomus ruveta
»luntreijaamaan».

Mutta nyt sattui jotakin ihan odottamatonta — Santeri ei ollut


osannut sellaista aavistaakaan!

Pihalla odotellessaan Ranta-Jussin tuloa Lampasta hän näki, että


Jussi tulla kähmi selkä köyryssä hiivatin kovaa kyytiä pitkin tikkatietä.
Häntä vähän oudostutti, että Jussi noin pian palasi, sillä olihan Jussin
määrä yhtä ja toista ilmoittaa Isolle-Joonaalle… että tämä kävisi
heinässä Kortesuolla, ynnä muuta…

Santeri meni jo kujalle Jussia vastaan. Kalmankalpea oli Jussi


kasvoiltaan, katkonaisesti hän puhui, silmissä pelon ja kauhistuksen
ilme.

Kummia hänellä oli kerrottavana.


Kun hän oli saapunut Lamppaan, oli siellä kova metakka, patruuna
itki ja kirosi. Tilta oli selittänyt, mitä oli tapahtunut. Oinas-Matti oli
viime yönä omin lupinsa mennyt Alaniemeen Vaaralan kylään,
valjastanut Palomäen ruunan, ottanut tupakkakulit heinäladosta ja
lähtenyt ajamaan poikki. Jafetin kohdalta hän oli noussut maalle ja
ajanut Lampalle päin… Mutta siinä juuri tulivat Jafetin kylän
tullimiehet vastaan, Kruukikin joukossa… neljä miestä oli ollut. He
tunsivat kohta hevosen ja kuorman ja tarrasivat kiinni, leikaten
ruomat ja ohjat poikki…

Vastarintaa oli Matti tehnyt, tapellut kuin onneton neljää miestä


vastaan ja lyönyt aisalla Kruukia, että melkein henki lähti… Kiinni
olivat panneet Matin, mutta oli sentään päässyt pakenemaan
Suomen puolelle… Nyt ollaan häntä hakemassa… Suomenkin puolen
viranomaisille on annettu käsky…

»Voi turkanen kuitenkin sitä Mattia!» lopetti Jussi uutisensa, jonka


oli kertonut katkonaisesti ja melkein itkua puserrellen.

Santeri kuunteli näennäisesti tyynenä, mutta silmissä leimusi, ja


näytti siltä kuin hänen punertavat hiuksensa nousisivat niskan takaa
pystyyn.

»Se on patruunan hommaa kaikki… Matti ei olisi uskaltanut omin


lupinsa koskea minun hevoseeni!» sanoi hän, ja hänellä oli
samantapainen katse kuin vimmastuneella elukalla.

Sitten hän kirosi ja katseli vähän epätietoisesti ympärilleen.

He ehtivät tuskin pihaan, kun näkivät Oinas-Matin juoksujalassa ja


takkisillaan tulevan sinne kujasta. Hänen naamansa oli mustelmissa,
ja silmän päällä otsassa nyrkin kokoinen sarvi.
»Jo kävi hullusti… ja taisi kuolla se Kruuki… Vallesmanni ja poliisi
ovat hakemassa… kun pääsisi piiloon!» puhui hän sopertamalla,
pelon vallassa.

Santeri hoksasi pian, että suuri on asia, ja arvasi, että hän itsekin
sotkeutuisi tähän juttuun. Nopeasti hän vei Matin navettaan ja kätki
hänet muurin taakse.

»Patruuna käski!» koki Matti Santerille selittää. »En minä olisi


muuten… ja neljä miestä kun oli… ja ruomat katkaisivat, niin en
päässyt kuormineni…»

Matti jäi navetan muurin taakse kyyröttämään, mutta Santeri meni


pihalle. Hän käski Ranta-Jussin lähteä kotiaan ja olla olevinaan
tietämätön koko asiasta.

Jussi ehti juuri lähteä hiihtämään mökkiänsä kohden, kun Santeri


näki vallesmannin ja poliisin ajavan tiellä. Ohi Palomäen toki ajoivat!

Santeri mietti hetkisen pihalla. Sitten hän painui navettaan ja oli


siellä pitkän aikaa.

Kun hän tuli takaisin, meni hän suoraan tunkiolle mättäitä


pienentämään. Hän oli oikein aavistanut! Vallesmanni ja poliisi
ajoivat palatessaan pihaan.

Oliko Santeri nähnyt Oinas-Mattia?

»Ei ole käynyt pitkään aikaan», vastasi Santeri. »Kuinka niin?»

»Olisi vähän asiaa», selitti vallesmanni ja katsoi tarkasti Santeria,


mutta pieninkään väre Santerin kasvoissa ei ilmaissut, että hän
jotakin tiesi.
Hän oli kuullut, että se hevonen, joka joku aika sitten oli Jafetin
pihalta rajavartijoilta varastettu, oli Santerin. Kuinka sen asian laita
oli?

Saattoi hyvinkin olla hänen entinen ruunansa, — niin oli hänkin


kuullut maailman puhuvan, — mutta hän oli jo ensi kelillä myynyt
ruunansa eräälle pitkäsääriselle kainulaiselle… Ei tiennyt, oliko
kainulainen ehkä myynyt muille…

»Vai niin. Mutta sillä samalla hevosella on Oinas-Matti menneenä


yönä ollut liikkeellä! Kuinka se on selitettävä?»

»No, jopa kuulen! Minun on kyllä mahdoton tietää, onko se valetta


vai totta.»

Santeri naureskeli ja ihmetteli sitä, ettei hän ollut kuullut.

»Eikö vallesmanni joudu talossa käymään?» esitteli hän. »Eihän


niin kiirettä ole…»

Hän liikkui keveästi ja puhui kohteliaalla äänellä.

Vallesmanni kyllä tunsi Santerin, ettei hänen puheisiinsa ollut


luottamista, mutta nyt hän ei ainakaan voinut Santeria mistään
syyttää, kun ei ollut mitään varmuutta.

»Kysyitkö sen kainulaisen nimeä, jolle ruunasi myit?» tiedusti


vallesmanni vielä lähtiessä.

»Kysyin minä nimenkin, mutta nyt en muista… ruotsalainen nimi


se oli», vastasi Santeri arvelematta.

Vallesmanni lähti.
Santeri seisoi kujalla ja katseli heidän menoaan.

»Kiinni olisivat Matin panneet… käsiraudat ja pultit näkyivät olevan


reen sevillä.»

Hän painui sisälle, otti ryypyn ja alkoi miettiä, sormillaan pöytään


naputellen.

Mutta kun ilta pimeni, läksi hän Lampalle, hiihdellen nyt suksilla
alempaa tikkatietä.

Hän oli koko päivän miettinyt ja tehnyt päätöksensä. Ja nyt hän oli
Lampan puheille menossa, miettimisensä tulokset ilmoittaakseen.

Lampan oli syy, että Oinas-Matin oli noin onnettomasti käynyt. Oli
kehoittanut Mattia, varomatonta ja tyhmää, yrittämään, vaikka hän,
Santeri, oli käskenyt odottaa ja luvannut, että kyllä hyvä tulee…
Siten saattoi miehen ansaan, hevosen ja kuorman menettäen…
Kuinka kävisi, jos Matti vielä kiinni saataisiin? Siitä alkaisi juttu ja
lopulta siihen vedettäisiin hänetkin…

Matti piti saada pois sekä tullimiesten että virkakunnan käsistä! Se


olisi heidän kaikkien pelastus! Ja koska patruuna oli syypää siihen,
että Matin niin onnettomasti kävi, niin laittakoon rahat ja hopusti,
jotta Matti pääsee karkaamaan Amerikkaan…

Sieltä eivät näppäisi miestä ensi tilassa. Ja patruunalla oli kyllä


varoja…

Hän oli jo valmiiksi miettinyt Matin karkumatkankin, ettei siitä


mitään jälkipuheita tulisi.
Patruuna käveli edestakaisin konttorinsa lattialla, vähän
kalpeampana entistään, ja kun Santeri astui sisään ja sanoi hyvää
iltaa, tuijotti hän Santeriin aivan kuin ensi kerran näkisi eikä
muistanut vastatakaan.

Pelästyksissään näytti patruuna olevan eikä olisi nyt juuri tahtonut


Santeria puhutella.

Kun he pääsivät puheen alkuun, niin patruuna alkoi väitellä


vastaan, ettei muka ollut kehoittanut Mattia »luntreijaamaan». Mutta
Santeri tiesi sanoa, että Iso-Joonas oli sitä varten käynyt Mattia
hakemassakin…

Patruuna koetti vieläkin peitellä asiaa, ettei se tulisi hänen


syykseen, mutta Santeri sanoi jyrkästi:

»Tässä ei auta valheet, sillä Matti on itse minulle selittänyt…»

Mutta kun Santeri sitten sanoi, että niin ja niin oli toimitettava,
jotta Matti pääsisi pakenemaan Amerikkaan, ja patruunan oli siihen
matkarahat annettava, niin silloin Lamppa suuttui, löi nyrkkiä
pöytään, ihan Santerin nokan alla, ja sanoi:

»Semmoiselle lorville minä en anna penniäkään…»

»En minä ole käskenyt suoraan tullimiesten syliin…»

Santeri vain naurahti patruunan kiukulle.

»Ottakoot sitten Matin kiinni!» hän sanoi välinpitämättömästi.


»Minuun se ei kuulu. Mutta uskon kyllä että huonoa jälkeä alkaa
teidän talossanne tulla, jos Matti kiinni joutuu…»
Patruuna tuijotti Santeriin pelästyneenä.

»Mitä sinä tarkoitat?» kysyi hän.

»Sitä, mitä sanoin», vastasi Santeri kolkosti ja aikoi lähteä.

Santeri oli osannut arkaan paikkaan. Patruuna tiesi hyvin, että


Santeri voisi häntä paljonkin vahingoittaa, jos tahtoisi… ilmoittaisi
rajavartijoille, missä hän, Lamppa, säilytti luvattomasti maahan
tuotuja tavaroita, voisipa ilmiantaa viinanmyynninkin…

»Elä vielä mene… istu nyt!» kielsi hän Santeria.

Santeri seisahtui ovensuuhun. »Mitäpä siinä on… ottakoot Matin


kiinni… vallesmanni ja poliisi kävivät jo hakemassa…»

Santeri yritti taas lähteä.

»Tulehan tänne, Santeri! Ajatellaan vielä asiaa», sanoi patruuna,


ja hänen äänensä oli muuttunut veljelliseksi.

He menivät konttorin viereiseen huoneeseen ja panivat oven


lukkoon.

Kun Santeri puolen yön aikaan hiihteli takaisin kotiinsa, oli hänellä
povitaskussaan matkarahat Oinas-Matin Amerikkaan matkaamista
varten.
IV

Rajavartija Kruuki, jota Oinas-Matti oli Jafetin luona sattuneessa


kahakassa iskenyt aisalla päähän, ei kuitenkaan kuollut, vaikka
monta päivää vaappui elämän ja kuoleman välillä. Alkoi vähitellen
tointua, ja toivoa oli hänen täydellisestä paranemisestaan.

Näinä viikkoina oli ollut paljon huhupuheita liikkeellä. Milloin tuotiin


sanomia, että Kruuki oli kuitenkin kuollut, ja milloin taas, että Oinas-
Matti oli vangittu. Mattia oli etsitty sekä Suomen että Ruotsin
puolelta, mutta kukaan ei ollut nähnyt, eivätkä huhut tienneet
sitäkään, mistä Matti Palomäen ruunan ja kuorman oli osunut
käsiinsä saamaan. Vihdoin tiesi huhu, että Matti oli mennyt
Amerikkaan ja että Lamppa oli antanut rahat.

Tiedusteltiin Matin vaimolta, Eeva-Priitalta, joka kahden lapsen


kanssa asui torpassa, tiesikö hän, mihin Matti oli joutunut. Mutta
vaimo ei sanonut tietävänsä eikä mitään kuulleensa.

Ja niin jäi Matin katoaminen huhupuheeksi.

Mutta Palomäen Santeri nousi kuin veden alta.


Häntä vastaan ei ollut ilmaantunut minkäänlaisia epäluuloja eikä
oikeastaan kukaan muu tiennytkään kuin hän itse ja Lamppa, kuinka
ja mihin Matti oli mennyt. Ja kun lisäksi Kruukikin paranemistaan
parani ja huhut Matin Amerikkaan menosta alkoivat vanheta, uskoi
Santeri vähitellen kaiken unhottuvan. Sillä muita puheita liikkui
myöskin. Sekä ylempää jokivarrelta että alempaa, Haaparannalta
asti, kerrottiin kaikenlaisia juttuja tullikavaltajain ja tullimiesten
kahakoista. Vahinkoja oli sattunut monelle Suomen puolelaiselle.

Niinpä oli Vauhtilan Nissiltäkin, jonka Santeri hyvin tunsi, otettu


kaksi hyvää hevosta »peslaakiin», kun hän oli yrittänyt
Haaparannalla myydä niitä, vaikka ne olisivat tullaamattomia.
Etelästä, Tampereelta asti, oli Nissi ostanut hevoset, tänne
myydäkseen, ja voittaakseen ne tuonut, niinkuin muutkin jokivarren
hevosmiehet, ja noin ne nyt menivät kuin kissanhäntään.
Toistatuhatta markkaa oli tullut vahinkoa. Samoin oli käynyt Perälän
Petterinkin, kuuluisan hevosmiehen ja tullikavaltajan. Häneltä ei
kuitenkaan ollut saatu kuin yksi hevonen, eikä sekään ollut kovin
kallis. Ja monelle muulle oli vahinko sattunut, mille isompi, mille
pienempi.

Santeri oli tosin menettänyt ruunansa hänkin, mutta Lampan oli


täytynyt sekin maksaa. Muutoin olisivat välit Santerin kanssa
menneet pilalle, ja Lampalle olisi voinut sattua isompia vaurioita.

Hyvät veljet, samoin kuin ennenkin, olivat taas Lamppa ja Santeri.


Ryyppäsivät Santerin käydessä Lampalla ja pitivät uusia tuumia.
Lamppakin ymmärsi, että hän oli tehnyt tyhmästi kehoittaessaan
Oinas-Mattia… ja oli tainnut tulla annetuksi Matille liika paljon
väkevää matkaan. Semmoinen perso juoppo ei malttanut olla
juomatta itseään hutikkaan silloin, kun olisi pitänyt selvin päin
toimia.

Mutta se asia oli nyt selvä. Matti oli merten takana, eikä vaimo,
Eeva-Priita, näyttänyt paljoakaan ikävöivän. Työteliäs vaimo kun oli,
hän eläisi uhkeammin yksin kuin juopon miesheittiön kanssa.

Näin patruuna ja Santeri arvelivat.

*****

Eräänä iltana joulun jälkeen päättivät Santeri ja Ranta-Jussi


vihdoin yrittää ja ruveta toteuttamaan ennen mietittyä poikkivientiä.
Santeri oli hommannut kaikki valmiiksi. Hän oli saanut
kumppaneikseen kylän kaksi rohkeinta tullikavaltajaa, ja Oinas-Matin
osaa oli aikonut esittää Iso-Liisa, mieheksi puettuna. Oli sydäntalven
pakkas-ilta, kun Ranta-Jussi läksi hiihtämään Ruotsin puolelle sitä
taloa kohden, jossa tullimiehet asuivat. Hiihtäessään hän vielä kerran
muisteli Santerin neuvoja ja varoituksia ja muita seikkoja, jotka
täytyi ottaa lukuun. Ellei hän puolen yön ajaksi palaisi Palomäkeen,
oli se merkkinä, että tullimiehet olivat lähteneet Jussin kanssa
Käkisaareen »luntreijaajia» vahtimaan. Ja silloin Santerikin saisi
lähteä hevosineen ja miehineen…

Ranta-Jussin sydän pamppaili aika lailla, kun hän lähestyi taloa,


sillä hän arvasi, etteivät tullimiehet semmoisten tapausten jälkeen
hyvin puhuttelisi häntäkään, vaikkeivät olleetkaan nähneet häntä
liikkeellä koko talvena. Hän karkaisi kuitenkin luontoaan ja hiihti
rohkeasti pihalle.

Saalkreeni pullahti heti portaille, ja vaikka olikin pimeä, tunsi hän


Jussin.
»Mitä sinä nyt olet täällä nuuskimassa?» sanoi hän karskisti
Jussille.

Jussi tekeytyi surkeaksi ja kuiskasi Saalkreenin korvaan:

»Nyt teille sopisi, jos tahtoisitte…»

Ja hän alkoi siinä pihalla selittää Saalkreenille, mitä Palomäen


Santeri ensi yönä aikoi hommata. Hän oli saanut kaikki tietää Isolta-
Liisalta, joka myöskin oli suuttunut Santerille. Ja niin oli hän nyt
päättänyt, että hän kostaa Santerille, lurjukselle ja hävyttömälle…

»Ja sitäkö varten sinä olet tänne tullut?» kysyi Saalkreeni tuimasti.

Jussi vakuutti niin olevan.

Vai niin», sanoi Saalkreeni. »Tuleppas sisälle, lurjus! Taidat olla


valheen kengillä liikkeellä!»

Jussi totteli ja meni nöyränä Saalkreenin kanssa sisälle. Kruukin


sijaan oli tullut uusi tullimies. Se oli iso ja vankka kuin hevonen, ja
äänikin kuului kuin tynnyristä.

He alkoivat puhella keskenään ruotsia, ja Jussi seisoi ovensuussa


kuin tuomittu. Saalkreeni selitti toisille ja viittasi välistä Jussiin päin.

Häntä alkoi vähän epäilyttää, kuinka tässä oikein kävisi, kun


Saalkreeni samassa astui hänen eteensä ja sanoi tuimasti:

»Sinun pitää lähteä Käkisaareen meidän mukanamme… ja


varjelkoon sinua, jos valehtelet…»

Sitähän Jussi juuri oli toivonutkin, että hänet otettaisiin mukaan.


»Uskallan minä lähteä… epäilemättä tänä yönä tuovat poikki…
Iso-Liisa tiesi ihan varmaan sanoa… ja hommassa oli jo iltahämyssä
Santeri ollut…»

Kun Jussi niin mielellään lupasi lähteä mukaan, alkoi Saalkreenikin


uskoa, että miehellä taisi olla tosi tarkoitus! Ei olisi uskaltanut
muutoin noin valehdella! Ja olihan tapahtunut tämmöistä ennenkin
takavuosina. Kerrankin oli Makon kylästä muuan mies, Köykky-
Jaakko, tullut ilmoittamaan, että Viikluntiin tuodaan seuraavana yönä
voita koko kuorma… Niin oli tuotukin, ja hyvän takavarikon silloin
saivat…

Mutta jos tämä nyt olisi totta, mitä Jussi kertoi, että neljä
kuormaa… ja kalliita tavaroita… ja hyvät hevoset siihen…

Hän alkoi puhutella Jussia ystävällisemmin, tarjosipa sikaarejakin.


Fynke ja myöskin iso, uusi tullimies ottivat osaa keskusteluun.

Saalkreeni tahtoi vielä tietää, mistä Jussi oli niin pahasti suuttunut
Palomäen Santerille. Jussi antoi kiitettävän selityksen ja vakuutti
vielä moneen kertaan, että puolen yön aikana tulevat… Tiesi senkin,
että Rantalan heinäladon ohi oli jo tie valmiina…

Ja lopuksi Jussi rukoili itkusilmin, väräjävällä äänellä, etteivät vain


tullimiehet vahingossakaan antaisi häntä ilmi…

»Santeri epäilemättä tappaisi minut… siksi sydämetön hän on ja


julma.»

Mutta kunniansa kautta vakuuttivat tullimiehet, etteivät missään


tapauksessa hiiskuisi sanaakaan Jussista.
Ja nyt he kaikki uskoivat Jussin puhuvan täyttä totta ja olivat
hyvillään.

Sitten he kyselivät Jussilta, tiesikö hän mitään Jafetin pihalla


tapahtuneesta varkaudesta — siinä olisi ansa Santerille, sanoivat, —
ja tiedustelivat Oinas-Matistakin. Mutta Jussi ei sanonut niistä mitään
tietävänsä. Hän ja Santeri olivat kaiken syksyä olleet vihoissa
toisilleen eikä hän muuta tiennyt noista jutuista kuin sen, mitä oli
kuullut kylällä puhuttavan.

Ja sikaaria poltellen he juttelivat myöhään iltaan.

*****

Ennen puolta yötä he läksivät hiihtelemään Käkisaareen päin. Jussi


kulki edellä, Saalkreeni hänen jäljessään ja viimeisenä Fynke. Sillä
uusi tullimies, joka oli kaikkein vankin ja luonnostaan raudanrohkea,
ei seurannutkaan Käkisaareen. He olivat keskenään asiaa miettineet,
että uusi tullimies ei lähdekään Käkisaareen, vaan Lampan
heinälatoon, vainion laitaan, vartioimaan. Voisihan näet käydä
niinkin, etteivät kavaltajat panisi tavaroita heinälatoon, vaan
kätkisivät jonnekin muualle…

»Se on oikein, mutta heinälatoon ne pannaan», sanoi Jussi.


»Isolle-Liisalle oli Joonas selittänyt, että hän ajaa siitä ladosta heiniä
vähemmäksi, jotta tavarat mahtuvat.»

Ja Saalkreeni oli tänään todellakin nähnyt Joonaan noutavan


heiniä vainioladosta.

Jussi puhui siis totta.


Pakkas-yö oli, taivas oli täynnä tähtiä, mutta revontulet eivät tänä
yönä syttyneetkään, niin että oli jotenkin pimeä.

Halki väylää he hiihtelivät Käkisaarta kohden. Lampassakin oli jo


sammutettu tulet, eikä Suomenkaan puolelta mistään näkynyt tulia.
Verkalleen Jussi hiihteli edellä, ja kun Saalkreeni jotakin kysyi,
seisahtui hän selittymään ja muisti aina rukoilla, etteivät vain häntä
ilmiantaisi. Jopa viimein, kun jo noustiin joelta saareen, tuumaili,
että kaiketi nyt tullimiehet antaisivat pienen palkinnon hänelle,
köyhälle miehelle… kun nyt niin ison saaliin saisivat… neljä kuormaa
ja kalliita tavaroita… nisujauhojakin kuorman…

Luvattiin antaa, jos nyt vain nähtäisiin poikkituotavan.

»Tuossa nyt on Rantalan lato!» sanoi Jussi, kun olivat päässeet


likelle latoa.

Siitä menikin ihan ladon vieritse tie, jota pitkin nähtävästi oli
paljon kuljettu. He kätkivät suksensa ladon seinälle, siirsivät vähän
ikkunalautoja syrjään ja kiipesivät sisälle latoon, joka oli puolillaan
heiniä. Sinne he asettuivat pitkäkseen ja juttelivat.

»Yö alkaa olla puolessa», sanoi Saalkreeni, joka tulitikun valossa


katsoi kelloansa.

»Pian tulevat, jos tulevat», vakuutti Jussi.

»Niin… jos tulevat… Et taidakaan olla varma», ärähti Saalkreeni


Jussille.

»Kyllä tulevat… St!… Mikä se oli?»

Kaikki kuuntelivat.
Kuului kuin olisi joku hiihtänyt edempänä.

»Santerilla on vakoojia saaressa», arveli Saalkreeni.

Saattaa hyvinkin olla… Olipa hyvä, että menimme latoon sisälle»,


arveli Jussikin.

Mutta kuu he taas olivat hetken aikaa hiljaa ja kuuntelivat, alkoi


Suomen puolelta päin kuulua reenjalasten kitinää. Selvästi siellä joku
ajoi saarta ja latoa kohden, mutta mitään ei vielä näkynyt.

»Nyt tulevat!» kuiskasi Jussi.

Jos onkin vain joku heinännoutaja», epäili Saalkreeni.

Ei öisin heiniä noudeta», vakuutti Jussi. »Santerin joukkoa se on…


niin uskon…»

Hetken päästä kuului hyvin jo hevosen kävelykin ja rislan ritinä,


kun se pakkasessa liitteissään rääkyi…

Saalkreeni ja Fynke kapusivat ihan ikkunan pieleen, paremmin


nähdäkseen, sillä tie kulki ikkunan ohi…

Tulija oli jo lähellä, eikä hevosella ollut minkäänlaista tiukua, jonka


puute myös oli tavallista tullikavaltajille. Korkea näytti kuorma
olevan, ja mies istui kuin pilvissä sen päällä. Kävelyä hän ajoi ja oli
tuossa juuri tulossa ladon nurkalle…

Silloin Jussi rykäisi.

»Mitä helvettiä sinä alat rykiä!» noitui hänelle Saalkreeni.


Silloin kulkija oli juuri vieressä ja istui selin latoon päin, mutta
kaikki tunsivat aivan varmasti, että se oli Palomäen Santeri.

Saalkreenilla syhyivät jo kynnet, ja hän puhui hampaittensa


välistä.

»Siinä oli ensimmäinen kuorma», sanoi Jussi hyvillään. »Puhuinko


valetta?»

»Totta olet puhunut. Mutta eipäs muita kuormia tulekaan», epäili


Saalkreeni ja aikoi jo lähteä Santerin perään.

»Odottakaa hetkinen… kyllä ne tulevat, saatte paljon enemmän!»


kehoitteli Jussi.

Ja kun he lakkasivat puhelemasta, kuului selvästi, että monella


hevosella ajettiin Suomen puolelta päin.

»Nyt ne tulevat!» sanoi Jussi.

Nämä tulijat ajoivatkin hyvää juoksua ja olivat äkkiä ladon luona.


Niillä oli matalammat kuormat, ja ajajat olivat nostaneet
turkinkauluksensa pystyyn, niin ettei heitä tunnettu. Ei sanonut
Jussikaan tuntevansa.

Heti kun viimeinen hevonen oli mennyt ohitse, yritti Saalkreeni


lähteä, mutta Fynke kielsi, ettei vielä…

Molemmat olivat niin hyvillään, että vapisivat, ja Saalkreeni pisti


setelirahan Jussin käteen — vaivain palkkioksi.

»Nyt ei muuta kuin hiihdätte suoraa päätä Lampan ladolle»…


selitti
Jussi.

»Kyllä me tämän asian hoidamme!» vakuutti Saalkreeni.

Jussi rukoili vieläkin, etteivät vain hänestä mitään mainitsisi…

Kiireesti he ottivat suksensa ladon seinältä. Jussi lähti kovasti


hiihtämään Suomen puolelle, mutta ilosta hytkyvin mielin samosivat
tullimiehetkin, turkit auki reuhtoen, Lampalle päin suoraan, entistä
suksenlatua noudattamatta.

Paikoittain sukset vaipuivat syvälle pehmeään pakkasen puremaan


lumeen, ja se hidastutti kulkua, varsinkin kun turkit tekivät hiihtäessä
haittaa. Mutta nuoria miehiä kun olivat, he lykkäsivät lujasti, sillä
olihan varma, suuri saalis tiedossa — niinkuin hyllyltä otettava.

He kaarsivat Lampan kartanon, siten oikaisten taivalta ja


pikemmin joutuakseen heinäladon luokse vainion laitaan.

Oltiin jo hyvin lähellä, jotta olisi pitänyt alkaa kuulua liikettä ladolta
ja jotakin näkyäkin.

Mutta mitään ei kuulunut eikä liioin näkynytkään. Ei näkynyt


Jönssoniakaan — isoa tullimiestä…

He seisahtuivat likelle latoa. Siinä näkyi suksenjälkiä, jotka


varmaan olivat jääneet Jönssonin suksista.

Mitään ei kuulunut. Ja kavaltajain olisi jo pitänyt hyvinkin ehtiä


tänne asti.

Saalkreeni puhalsi pilliinsä. Silloin kuului samanlainen vastaus


metsänreunasta, ladon takaa. Ja pian ilmestyi Jönsson suksineen
toisten luo.

»Eikö ole kuulunut mitään?» kysyi Saalkreeni hätäisesti.

»Ei mitään ole kuulunut eikä ketään näkynyt liikkeellä!»

»He ovat sitten ajaneet suoraan Lampan pihaan!» päätti


Saalkreeni.

Sen pitemmälle he eivät keskustelleet, vaan lähtivät pyrynä


hiihtämään
Lampalle.

Mutta kun he pääsivät pihalle, ei siellä liikkunut ketään. Talo oli


aivan pimeänä ja kaikki ovet kiinni. Näytti siltä, että Lampalla
nukuttiin niinkuin rauhallisessa talossa ainakin.

»Mitä tämä merkitsee?» puuskui Saalkreeni. »Onkohan se lurjus ja


heittiö Joonas kotona?»

»Niin… se olisi hyvä tietää», sanoivat toisetkin, mutta kaikkien


hämmästys näytti olevan suuri.

He menivät pirtin puolelle, missä tiesivät Joonaan nukkuvan.


Takoivat oveen ja ikkunoihin ja pyysivät päästä sisälle.

Pitkän ajan perästä kuului sisältä liikettä ja ovien aukomista ja


kolinaa. Joonas ilmestyi alushousuillaan ovelle ja kirosi kysyen, kutka
siellä semmoista meteliä pitivät.

»Me täällä olemme», vastasi Saalkreeni kaikkien puolesta.

»Mitä on asiaa?» liuskasi Joonas kiukkuiselta äänellä.


Niin, mitä heillä olikaan asiaa!

Ei ollutkaan selvillä, mitä sanoisi, kun tapasivat Joonaan yösijalta.

Kun he eivät virkkaneet mitään, paiskasi Joonas oven kiinni ja


murahti:

»Painukaa helvettiin ihmisiä herättelemästä…»

He jäivät hetkiseksi neuvottomina seisomaan pihalle, pakkas-


yöhön.
»Perhana!» noitui Saalkreeni omasta ja toistenkin puolesta.

Kamala aavistus, että heitä sittenkin oli petetty, lensi Saalkreenin


mieleen. Mutta tämä oli ennenkuulumatonta!

Hän raivostui siinä itselleen ja koko maailmalle, mutta hätä keksii


keinoja, eikä ollut aikaa hukata yhtään minuuttia. Tullikavaltajat eivät
olleetkaan ajaneet Lampalle, vaan alaspäin!

Oliko tämä kaikki keksittyä ja oliko Ranta-Jussi sittenkin heitä


puijannut…

Niinkuin se, joka ei oikein käsitä, mitä on tehtävä, kun on tulinen


kiire, lähtivät kaikki kolme hiihtämään maantielle ja sitä pitkin
alaspäin. Saalkreeni hiihti edellä, Jönsson kaahotti turkki auki
perässä, ihan kantapäillä; mutta vähän jäljempänä heistä ahersi
Fynke kuin riivattu koettaen pysyä mukana, sillä hän oli huonompi
hiihtäjä kuin toiset.

Niin he hiihtivät tulisissa ajatuksissa pakkas-yössä. Saalkreeni


uskoi, että kavaltajat, kun he kerran olivat onnellisesti päässeet
Ruotsin puolen maantielle, kääntyvätkin menemään alas päin,
uskaltamatta tulla suoraan Lampalle. Ja samassa juolahti hänen
päähänsä, että ehkä kavaltajilla oli jossakin läheisessä kylän talossa
paikka, johon tavarat ensiksi kätkettäisiin.

Sellaiseksi paikaksi hän uskoi Lassilan riihtä, joka oli metsän


laidassa puolen penikulman päässä Lampalta. Lassila oli näet
Lampan veli, ja Saalkreeni tiesi veljeksillä olevan yhteisiä tavaroitakin
Suomen puolella.

Sinnepäin he siis hiihtivät tulista vauhtia ohi Kortesuon tienhaaran,


joka Lehmikankaan kohdalta poikkesi metsään ja josta kavaltajat
olivat kääntäneet…

He toivoivat jonkun kulkijan, rahtimiehen tai kyydillä ajavan,


tulevan vastaansa, jotta saisivat tietää, oliko ehkä kuormahevosia
näkynyt liikkeellä. Mutta vastaantulijoita ei kuulunut, ja pian he olivat
taipaleen päässä.

Mutta kun he pääsivät Lassilan riihen kohdalle, joka oli joen


puolella tietä, rantametsän laidassa, ei mitään näkynyt, eikä riihelle
ollut yhtään jälkeäkään.

Epätoivoissaan he seisahtuivat tielle palavissaan ja väsyksissä ja


kirosivat kukin niin paljon kuin suusta ehti tulla.

Kenen syy tämä oli?

Ei oikein osattu syyttää Ranta-Jussiakaan. Omaa tyhmyyttään he


kirosivat, kun eivät heti Rantalan ladolta lähteneet jäljestä
hiihtämään, vaan riensivät kuin hullut ensiksi Lampalle.

Mutta koko yön he kuitenkin hiihtelivät Lampan ympäristöllä ja


poistuivat vasta sitten kun Iso-Joonas aamulla varhain meni talliin.
V

Vasta viikon perästä kertoivat huhut Suomen puolella, kuinka


rohkeasti Palomäen Santeri oli tullimiehiä pettänyt. Ja molemmin
puolin naurettiin tullimiesten tyhmyydelle, sillä sitä eivät huhut olleet
tienneet kertoa, että tullimiehet olivat menneet Ranta-Jussin neuvon
mukaan Käkisaareen.

Santeri, samoin kuin hänen »avustajansakin», kielsivät kaikki.


Huihai!
Kuinka kukaan on voinut olla niin rohkea! Ei Santeri ainakaan.

Raivoissaan olivat tullimiehet yötä päivää vaaniskelleet Lampan


ympäristöllä. Heidän ei ollut onnistunut saada vähintäkään vihiä siitä,
mihin Käkisaaren kautta tuodut kuormat oli kätketty. Mutta he
ymmärsivät, että ne lopultakin tuotaisiin Lamppaan, ja koettivat
pitää siitä huolta. Pihalla he seisoskelivat ja penkoivat jokaisen
kulkijan reen, tulipa kulkija Suomen tai Ruotsin puolelta. Mutta
tyhjää penkoivat.

Liike alkoikin taas vilkastua, sillä Ylikainuun markkinat lähestyivät.


Tullimiehillä oli niin kova kiire, ettei ollut rauhaa yöllä eikä päivällä, ei
pyhänä eikä arkena. Sillä Suomenkin puolen hevosmiehet alkoivat
nyt hommata, ja vahtimista oli joka haaralla.

Etelä-Suomesta asti olivat Suomen puolen hevosmiehet käyneet


ostamassa uljaita, kiiltävän lihavia hevosia — pian alkaville
markkinoille, jolloin hevosten hinta oli verrattoman korkea. Mutta
tullimaksu Ruotsin puolelle tuodusta hevosesta oli melkoinen, ja
kukin koetti sitä suorittamatta livahtaa rajan yli.

Heistäkin alkoi nyt tullimiehillä olla kova vaarinpito.

Santeri tiesi sen. Hän ei ollut käynyt Lampalla sitten viime


»luntreijauksen» kuin yhden kerran — silloinkin yöllä. Mutta nyt hän
lähti päivällä, ajoi hevosella ja kappireellä ja oli vielä pannut ylleen
parhaan turkkinsa, niin että näytti aivan kuin herralta. Muitakin
poikkikulkijoita oli, edestakaisin ajoi hevosia, kulkuset kilisivät ja
tiu'ut soivat.

Santeri antoi oriinsa mennä vihaista juoksua Lampan pihaan ja


ajoi tallin seinälle. Mutta ennenkuin hän ehti reestäkään nousta,
olivat tullimiehet hänen ja hevosensa ympärillä. Joukossa oli outoja,
mutta Saalkreenin ja Fynken hän tunsi.

»Mitäs herroille kuuluu?» kysyi Santeri, kun pani hevostaan kiinni.

»Katselemme tätä sinun uljasta orittasi… jos toistenkin


näkisimme!» vastasi Saalkreeni, ja Santeri ymmärsi Saalkreenin
viittaavan siihen, että hänkin ehkä aikoi mennä Kainuun markkinoille
hevosta myymään.

»Se on oikein! Katselkaa tarkoin!» kehoitti Santeri ja naurahti.


Saalkreenin silmät iskivät tulta, mutta mitäpä hän Santerille
mahtoi!

Mutta lähtiessään hevosensa luota puotiin päin Santeri näki


tullimiesten penkovan hänen kappirekeään.

Samassa hän myös näki Joonaan, joka heinähäkin päällä


köllöttäen ajoi pihaan.

Hän meni konttoriin. Leveästi nauraen patruuna otti vieraansa


vastaan.

»Jopa oli hyvä, että tulit… jopa oli hyvä…» hoki hän. »Tulit kuin
kutsuttu… Käy istumaan… pane sikaari palamaan… riisu turkki
yltäsi…»

Erinomaisen hyvällä tuulella nyt patruuna olikin. Kaikki oli


onnistunut niin kovin hyvin.

»Ja ajattele, etteivät ne pöllöt, vaikka tässä pyörivät yöt päivät,


ole kertaakaan hoksanneet mennä rautakrasseillaan sysimään
heinähäkkiä», puheli hän hyvillään.

Ja kertoi lisäksi, että Joonas oli vähän kerrallaan saanut


kuljetetuksi kaikki tavarat Kortesuon ladosta kotia. Heinähäkkiin oli
pohjalle latonut tavaraa, niinkuin Santeri oli neuvonut, ja heiniä alle,
päälle ja laidoille… Osa tavaroista oli jo saatu viedyksi Ylikainuulle,
mutta lisää tarvitsisi… Markkinat olivat pian tulossa.

Ja senvuoksi olikin hyvä, että Santeri tuli neuvottelemaan, kuinka


nyt alettaisiin menetellä.

Sen Santeri oli tiennytkin ja miettinyt jo valmiiksi.


Ja nyt hän kertoi patruunalle uusimmasta aiheestaan.

Patruuna kuunteli ja lasketteli väliin pitkiä nauruja. Jopa oli viisas


ja kavala mies tuo Santeri! Mistä hemmetistä se aina hoksasikin!

Santeri selitti moneen kertaan, kuinka Joonaan piti menetellä. Hän


itse kyllä huolehtisi, että tavarat saataisiin joen poikki.

»Kyllä, kyllä… Jäveln anamma… jäveln anamma!» nauroi ja


ihmetteli patruuna Santerin rohkeutta.

Kauan ei Santeri tällä kertaa viipynyt Lampassa. Ja kun hän lähti,


oli hänellä molemmat povet pullollaan, mitä lie ollutkaan…

Fynke näkyi kävelevän vieläkin pihalla, mutta muita tullimiehiä


Santeri ei havainnut.

Kun hän palasi kotiinsa, oli sinne saapunut vieraita.

Vaaralan kylän Alaniemen sukulaisisäntä oli toinen ja


alatorniolainen hevossaksa Miukin Matti toinen. Kummallakin oli kaksi
hevosta, ja Santeri älysi heti, minne heillä oli matka, kun pihalla kuuli
rengiltä, keitä vieraat olivat. Ylikainuun markkinoille tietenkin.

Emäntä oli jo laittamassa vieraille päivällistä.

Santeri toivotti vieraat tervetulleiksi taloon, ja kun oli maisteltu


muutamia väkeviä punssikuppeja, menivät talliin katsomaan hevosia.

Vieraat olivat päässeet hyvälle puhetuulelle, ja Miukin Matti rähisi


ja kiitteli hevosiaan kuin olisi jo ollut markkinapaikalla. Alaniemen
isäntäkin kiitteli hevosiaan, mutta ei rähissyt niin paljon kuin Matti.
Hyviä, lihavia ja uljaita hevosia ne olivat. Santeri kehui hevosta
minkä kerkisi.

Mutta kun oli syöty ja molemmat vieraat olivat päihtyneet aika


lailla, alkoivat he tuumailla, kuinka päästäisiin rajan yli, ettei tarvitsisi
tullia maksaa.

»Ajakaa menemään vain»! kehoitti Santeri.

»Mitä helvettiä… suoraan tullihurttain suuhunko?» kivahti Miukin


Matti.

»Niinpä tietenkin», nauroi Santeri.

»Elä sinä luule meitä niin tyhmiksi!» jankkasi Alaniemen isäntäkin,


joka ei tiennyt, puhuiko Santeri leikillään vai tosissaan.

Santeri oli myös juovinaan silloin kun vieraatkin ryyppäsivät, mutta


ei kuitenkaan juonut, ei muuta kuin vähän maistoi.

Uutisia oli vierailla paljon kerrottavana. Tullikavallusjuttuja he


kertoivat ja nauroivat, että koko maailmalle oli tullut tunnetuksi,
kuinka riivatun rohkeasti ja vikkelästi Santeri oli Käkisaaressa
pettänyt tullihurttia.

Santeri kielsi kaikki. Ei sanonut olleensa niillä maillakaan.

Ja vieraat tiesivät, että Ylikainuulle tulee paljon hevoskauppiaita.


Tietoja oli muka saapunut, että ostajia oli tulossa edempänä
Ruotsista asti ja että hevosten hinnat olivat nousseet.

»Vai semmoista kuuluu», arveli Santeri.


Illempänä he maistelivat yhä enemmän. Sillä molemmat vieraat,
sekä Alaniemen isäntä että Miukin Matti, olivat persoja viinalle,
varsinkin kun saivat juoda ilmaiseksi. Ja miksei olisi juotu, kun oltiin
hyvässä talossa, jossa isäntä tarjosi, ja hevoset olivat lämpimässä
tallissa.

Silloin he alkoivat esitellä Santerille, eikö hän hommaisi heidän


hevosiaan poikki rajan… Nyt varsinkin, kun Santerilla ei itsellään ollut
myymähevosia eikä aikomusta tänä talvena markkinoillekaan lähteä.

»Huomenna saadaan asiasta puhella», lupaili Santeri.

Illalla myöhään molemmat vieraat nukkuivat. Miukin Matti ei


päässyt sänkyynkään, vaikka oli tehty vuode, vaan nukkui
ovensuuhun turkkinsa päälle. Alaniemen isäntä retkotti sängyssä,
vaatteet yllään.

— Kauniita markkinamiehiä! — tuumi Santeri nauraen, kun katseli


väsyneitä vieraitaan.

Mutta Santeri tiesi entisestä kokemuksesta, etteivät nämä vieraat


pitäneet kiirettä talosta lähteäkseen, kun hevoset olivat tallissa ja
heillä itsellään hyvä olo. Kainuun markkinatkaan eivät vielä
hoputtaneet. Tässähän ne voisivat makailla ja syödä monta päivää,
varsinkin kun tiesivät hänellä olevan viinan viljaa… Kalliiksi niitä tuli
ruokkia… neljää hevosta ja kahta miestä. Pois ne piti toimittaa!

Sitäpaitsi hänellä oli omia hommia joka yöksi markkinoihin asti!


Tässä ei joutaisi muuta tekemään kuin jaarittelemaan kaiket päivät!

Hän jätti vieraansa nukkumaan ja meni talliin.


Ranta-Jussi hommaili siellä niinkuin isäntä oli käskenyt. Vieraitten
hevoset seisoivat vierekkäin, ja talon hevoset olivat toisella seinällä.

Ranta-Jussi oli tehnyt, niinkuin isäntä oli käskenyt. Jokaiselta


hevoselta hän oli leikannut hännät lyhyiksi.

Se oli Santerin omaa keksintöä, ja sillä konstilla hän oli


takavuosina tullimiehiä pettänyt. Sillä ruotsalaisten tapana oli pitää
hevosten hännät noin lyhyinä. Tullimiehet olivatkin tähän asti
uskoneet, kun lyhythäntäisen hevosen näkivät, että se oli Ruotsin
puolen hevosia.

»Hyvä on!» sanoi Santeri. »Ei muuta kuin pannaan toiset


valjaisiin, toiset kiinni reslain perään!»

Kaikki helisevät tiu'ut ja kulkuset Santeri leikkasi remmeistä irti, ja


pian he olivat valmiit lähtemään.

Santeri oli sillä aikaa, kun hänen vieraansa ryypiskelivät, ehtinyt


hommata paljon. Iso-Liisakin oli liikkeellä. Hänet oli Santeri
toimittanut Lamppaan katsomaan, näkyikö tullimiehiä missään.

Liisaa nyt vain odotettiin, muuten oltiin valmiit lähtemään. Santerin


tarkoitus oli ajaa hevosilla Kainuuseen menevää tietä ensimmäiseen
kylään, joka ei ollut kaukana, ja jättää ne sinne erääseen tuttuun
taloon, johon hän oli ennenkin salaa vienyt hevosia. Vieraat saisivat
huomenna mennä hiihtäen perässä ja ottaa sieltä hevosensa ja
jatkaa matkaansa Kainuuseen.

Sillä Santeri tiesi, ettei vieraista muuten pääsisi erilleen, eikä


heistä ollut »luntreijaajiksi», siksi tolvanoita ja juoppoja he olivat.

Hänen piti tässä olla apuna.


Jopa Liisa hiihtää kaahotti takaisin Lampalta, eikä ollut yhtään
tullimiehiä näkynyt liikkeellä. Ison-Joonaan hän oli herättänyt ja
kertonut, mitä oli tekeillä. Joonaskin oli vakuuttanut, että tullihurtat
olivat nyt nukkumassa, kun oli täytynyt niin monta yötä rehkiä ja
valvoa. Hän oli luvannut olla hereillään…

»Hyvä on!» sanoi Santeri. »Otappa tuosta vahvistukseksi ryyppy!»

Ja hän tarjosi Liisalle pulloa.

»Tule sitten huomenillalla!» kuiskasi hän Liisalle.

Yöllä oli pakkanen. Santeri istuutui etumaiseen reslaan, jonka


valjaissa oli Miukin Matin toinen hevonen, juoksijatamma, ja toinen,
vankka ruuna, oli köytetty marhaminnasta reslan perään. Ranta-Jussi
ajoi Alaniemen isännän hevosia, jotka olivat lihavan kiiltäviä ja
kookkaita ruunia molemmat.

Virkut hevoset porhalsivat pyrynä jäälle ja sitten kiivasta vauhtia


poikki joen pitkin viitoitettua tietä Lampalle.

Joonas seisoi portailla ja huusi, kun Santeri ajoi ohitse:

»Antakaa mennä vain! Selvä on tie!»

Ja vielä Jussillekin, joka tuli vähän jälempänä, hän huusi:

»Anna mennä perässä!»

Hän seisoi portailla niin kauan kuin kuuli kavioiden kopsetta, ja


meni sitten sisälle, arvaten, että Santeri ja Jussi olivat jo Kainuuseen
menevällä tiellä ja ettei siellä ollut pelkoa tullimiehistä.
Aamupuolella yötä Santeri ja Ranta-Jussi palasivat suksilla, jotka
lähtiessä olivat ottaneet mukaansa.

*****

Aamulla varhain olivat talon vieraatkin taas pystyssä.

Santeri vielä kiusoitteli vähän kumpaakin, ennenkuin sanoi, mitä


oli yöllä hommaillut sillä aikaa kun toimet nukkuivat.

Molemmat vieraat pelästyivät ensin pahasti, näkivät pilttuut tyhjinä


tallissa ja surkuttelivat, että taas piti juoda itsensä niin
sikahumalaan…

Mutta pian he nyt tointuivat kohmelostaan. Ja niin tuli kiire


kummallekin, että aamuhämyssä jo lähtivät kävellen Ruotsin puolelle
ja alkoivat yhtä kyytiä painua Kainuuseen päin siihen taloon, johon
Santeri oli yöllä vienyt heidän hevosensa.

Santeri katseli heidän menoaan ja arveli kujalla itsekseen:

— Hyvin näppärästipä näistä vieraista päästiinkin!

Ja hän naurahti keksinnölleen.

Koko päivän hän sitten oli kovassa puuhassa. Kun emäntä hänelle
jotakin sanoi, ärähti hän heti kärsimättömästi. Hän ei sietänyt enää
vaimoaan, jonka tapana oli lakkaamatta itkeskellä ja haikealla
äänellä varoitella miestään, ennustaen kaikenlaista. Tänään emäntä
olikin ollut tavallista itkuisempi, arvatenkin vierasten vuoksi ja siitä,
että talossa oli viljemmälti liikuteltu viinoja. Nyt hän muistutti
Santerille Oinas-Mattiakin — sitä ei ollut ennen tehnyt. Mutta kiivaan
ja tylyn vastauksen hän sai Santerilta.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookmass.com

You might also like