100% found this document useful (1 vote)
9 views

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

The document provides information about various editions of the book 'C Programming From Problem Analysis to Program Design' by Barbara Doyle and other related programming books. It includes links for purchasing or downloading these books in different formats. Additionally, it contains copyright information and details about the content and structure of the C# Programming textbook.

Uploaded by

akdereogy88
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
9 views

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

The document provides information about various editions of the book 'C Programming From Problem Analysis to Program Design' by Barbara Doyle and other related programming books. It includes links for purchasing or downloading these books in different formats. Additionally, it contains copyright information and details about the content and structure of the C# Programming textbook.

Uploaded by

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

C Programming From Problem Analysis to Program

Design 5th Edition Barbara Doyle pdf download

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

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


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

C Programming From Problem Analysis to Program Design


2nd Edition Barbara Doyle

https://ebookname.com/product/c-programming-from-problem-
analysis-to-program-design-2nd-edition-barbara-doyle/

C Programming From Problem Analysis to Program Design


6th Edition D. S. Malik

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

C Programming Program Design Including Data Structures


Fourth edition D. S. Malik

https://ebookname.com/product/c-programming-program-design-
including-data-structures-fourth-edition-d-s-malik/

Elements of Information Theory Second Edition Thomas M.


Cover

https://ebookname.com/product/elements-of-information-theory-
second-edition-thomas-m-cover/
Garden Insects of North America The Ultimate Guide to
Backyard Bugs Second Edition Whitney Cranshaw

https://ebookname.com/product/garden-insects-of-north-america-
the-ultimate-guide-to-backyard-bugs-second-edition-whitney-
cranshaw/

A Guide to IT Contracting Checklists Tools and


Techniques Michael R. Overly

https://ebookname.com/product/a-guide-to-it-contracting-
checklists-tools-and-techniques-michael-r-overly/

Do It Yourself Kitchens Stunning Spaces on a Shoestring


Budget 1st Edition Better Homes And Gardens

https://ebookname.com/product/do-it-yourself-kitchens-stunning-
spaces-on-a-shoestring-budget-1st-edition-better-homes-and-
gardens/

Meet and Grow Rich How to Easily Create and Operate


Your Own Mastermind Group for Health Wealth and More
1st Edition Joe Vitale

https://ebookname.com/product/meet-and-grow-rich-how-to-easily-
create-and-operate-your-own-mastermind-group-for-health-wealth-
and-more-1st-edition-joe-vitale/

The Retail Doctor s Guide to Growing Your Business A


Step by Step Approach to Quickly Diagnose Treat and
Cure 1st Edition Bob Phibbs

https://ebookname.com/product/the-retail-doctor-s-guide-to-
growing-your-business-a-step-by-step-approach-to-quickly-
diagnose-treat-and-cure-1st-edition-bob-phibbs/
The Blackwell Guide to the Philosophy of Science Peter
Machamer

https://ebookname.com/product/the-blackwell-guide-to-the-
philosophy-of-science-peter-machamer/
C# PROGRAMMING:
FROM PROBLEM ANALYSIS TO PROGRAM DESIGN

FIFTH EDITION

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.
C# PROGRAMMING:
FROM PROBLEM ANALYSIS TO PROGRAM DESIGN

FIFTH EDITION

BARBARA DOYLE

"VTUSBMJBt#SB[JMt+BQBOt,PSFBt.FYJDPt4JOHBQPSFt4QBJOt6OJUFE,JOHEPNt6OJUFE4UBUFT

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

Important Notice: Media content referenced within the product description or the product text may not be available in the eBook version.

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.
C# Programming: From Problem Analysis to © 2016, 2014 Cengage Learning
Program Design, Fifth Edition WCN: 02-200-203
Barbara Doyle
ALL RIGHTS RESERVED. No part of this work covered by the
copyright herein may be reproduced, transmitted, stored, or used
Product Director: Kathleen McMahon
in any form or by any means graphic, electronic, or mechanical,
Product Team Manager: Kristin McNary including but not limited to photocopying, recording, scanning,
Senior Product Manager: Jim Gish digitizing, taping, Web distribution, information networks, or
information storage and retrieval systems, except as permitted
Senior Content Developer: Alyssa Pratt
under Section 107 or 108 of the 1976 United States Copyright Act,
Product Assistant: Abigail Pufpaff without the prior written permission of the publisher.
Marketing Manager: Eric LaScola Microsoft ® is a registered trademark of the Microsoft
Senior Production Director: Wendy Troeger Corporation.
Production Director: Patty Stephan Unless otherwise noted all screenshots are courtesy of Microsoft
Corporation
Senior Content Project Manager: Jennifer
K. Feltri-George Unless otherwise noted all tables/figures exhibits are
© Cengage Learning®
Managing Art Director: Jack Pendleton
Cover image: © zeljkodan/Shutterstock.com
Production Service: SPi Global For product information and technology assistance, contact us at
Cengage Learning Customer & Sales Support, 1-800-354-9706
Compositor: SPi Global
For permission to use material from this text or product,
submit all requests online at www.cengage.com/permissions.
Further permissions questions can be e-mailed to
permissionrequest@cengage.com

Library of Congress Control Number: 2015937761


ISBN: 978-1-285-85687-2

Cengage Learning
20 Channel Center Street
Boston, MA 02210
USA

Cengage Learning is a leading provider of customized learning


solutions with employees residing in nearly 40 different countries
and sales in more than 125 countries around the world. Find your
local representative at www.cengage.com.
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
Notice to the Reader
Publisher does not warrant or guarantee any of the products described
herein or perform any independent analysis in connection with any of the
product information contained herein. Publisher does not assume, and
expressly disclaims, any obligation to obtain and include information other
than that provided to it by the manufacturer. The reader is expressly warned
to consider and adopt all safety precautions that might be indicated by the
activities described herein and to avoid all potential hazards. By following
the instructions contained herein, the reader willingly assumes all risks in
connection with such instructions. The publisher makes no representations or
warranties of any kind, including but not limited to, the warranties of fitness
for particular purpose or merchantability, nor are any such representations
implied with respect to the material set forth herein, and the publisher takes
Printed in the United States of America no responsibility with respect to such material. The publisher shall not be
liable for any special, consequential, or exemplary damages resulting, in
Print Number: 01 Print Year: 2015 whole or part, from the readers’ use of, or reliance upon, this material.

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.
BRIEF CONTENTS

© zeljkodan/Shutterstock.com

PREFACE xxiii

1. Introduction to Computing and Application Development 1

2. Data Types and Expressions 71

3. Methods and Behaviors 137

4. Creating Your Own Classes 197

5. Making Decisions 257

6. Repeating Instructions 325

7. Arrays 399

8. Advanced Collections 459

9. Introduction to Windows Programming 513

10. Programming Based on Events 593

11. Advanced Object-Oriented Programming Features 699

12. Debugging and Handling Exceptions 785

13. Working with Files 849

14. Working with Databases 907

15. Web-Based Applications 993

APPENDIX A Visual Studio Configuration 1089

APPENDIX B Code Editor Tools 1107

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

Preface xxiii

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
.NET 23
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
Comments 30
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
Namespace 35
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
Pseudocode 57
Resources 58
Quick Review 59
Exercises 61
Programming Exercises 66

DATA TYPES AND EXPRESSIONS 71


2 Data Representation 72
Bits 72
Bytes 72
Binary Numbering System 72
Character Sets 75
Kilobyte, Megabyte, Gigabyte, Terabyte, Petabyte. . . 76
Memory Locations for Data 76
Identifiers 77
Variables 81
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


Types 82
Classes 83
Objects 84
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
Casts 109
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
Modifiers 140
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


Parameters 144
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


Accessor 208
Mutators 208
Other Instance Methods 209
Property 210
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
Classes 244
Properties 244
Methods 245
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
BitArray 486
Hashtable 487
Queue 490
Stack 491
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
Consistency 520
Alignment 521
Avoid Clutter 521
Color 521
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
TableAdapterManager 956

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


AccessDataSource 1060
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.Forms 1073
iOS Apps 1074
Android Apps 1074
Windows Phone Apps 1075
Silverlight 1075
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
Environment 1091
Projects and Solutions 1094
Text Editor 1095
Debugging 1099
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 TOOLS 1107


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
Rename 1114
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 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.
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.
Another Random Document on
Scribd Without Any Related Topics
The Project Gutenberg eBook of The
Adventures of Ulysses the Wanderer
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: The Adventures of Ulysses the Wanderer

Author: Guy Thorne


Homer

Illustrator: Will G. Mein

Release date: January 28, 2013 [eBook #41935]


Most recently updated: October 23, 2024

Language: English

Credits: Produced by Mark C. Orton, Sam W. and the Online


Distributed
Proofreading Team at http://www.pgdp.net (This file was
produced from images generously made available by The
Internet Archive)

*** START OF THE PROJECT GUTENBERG EBOOK THE


ADVENTURES OF ULYSSES THE WANDERER ***
THE
ADVENTURES OF ULYSSES
THE WANDERER

An Old Story Retold by


C. RANGER-GULL
AUTHOR OF
“THE HYPOCRITE,” “FROM THE BOOK BEAUTIFUL,”
“BACK TO LILAC LAND,” ETC.

Illustrated
BY
W. G. MEIN

London
GREENING and COMPANY, Ltd.
20 CECIL COURT, CHARING CROSS ROAD
1902

BY THE SAME AUTHOR


THE HYPOCRITE.
Seventh Edition. 2s. 6d.

BACK TO LILAC LAND.


Second Edition. 6s.
MISS MALEVOLENT.
Second Edition. 3s. 6d.

THE CIGARETTE SMOKER.


Second Edition. 2s. 6d.

FROM THE BOOK BEAUTIFUL.


Being Old Lights Re-lit. 3s. 6d.
————

IN PREPARATION.
THE SERF. A Tale of the Times of King
Stephen.

HIS GRACE’S GRACE. A Story of


Oxford Life.
HE STARED STEADILY AT THEM WITH HIS SINGLE EYE
FOR A FULL MINUTE.
Page 32. Frontispiece.

TO

HERBERT BEERBOHM TREE


IN APPRECIATION OF HIS SCHOLARSHIP
IN ADMIRATION OF HIS ART
TO ONE OF THE FEW GREAT ARTISTS
WHO HAS NEVER BEEN UNTRUE
TO THE HIGHEST IDEALS OF HIS CALLING
AND IN SPECIAL MEMORY
OF THE FIRST NIGHT OF “HAMLET”
AT MANCHESTER
CONTENTS
PAGE
Foreword 9
Brief Account of Principal Characters in the Odyssey 13
The First Episode—How They blinded the Son of Poseidon 21
The Second Episode—The Adventure of the Palace in the
Wood 39
The Third Episode—How Ulysses walked in Hell, and of the
Adventure of the Sirens and Scylla 48
The Fourth Episode—How Ulysses lost his Merry Men and
came a Waif to Calypso with the Shining Hair 63
The Last Episode—How the King came Home again after the
Long Years 80
A Note on Homer and Ulysses 98
LIST OF ILLUSTRATIONS
HE STARED STEADILY AT THEM WITH HIS
SINGLE EYE FOR A FULL MINUTE Frontispiece
THEN HE CAME SWIFTLY UPON THE
GLEAMING PALACE facing page 45
THEN HE WAS, IN AN INSTANT MOMENT,
AWARE OF A MORE THAN MORTAL
PRESENCE ” 49
THEY CAME TO THE BRINK OF THE RIVER ” 52
“WHO AM I THAT I CAN COMBAT THE WILL
OF ZEUS OR THE HARDNESS OF YOUR
HEART?” ” 78
“NAY, IF YOU LOVE ME,” HE SAID, “NONE OF
THAT, MY FRIEND” ” 83
FOREWORD
Seven fair and illustrious cities of the dim, ancient world, Argos,
Athenæ, Chios, Colophon, Salamis, Rhodos, Smyrna, fought a war of
words over Homer’s birthplace.
Each claimed the honour.
And if, indeed, such an accident of chance confers an honour upon a
town, then the birthplace of the Greatest Poet of all time should be a
place of pilgrimage.
For, among the weavers of Epos, Drama, and Romance, he who was
called Melesegenes is first of all and wears an imperishable crown.
For 3000 years his fame has streamed down the ages.
The world has changed. Great empires have risen, flowered and
passed. Christianity came, flooding mankind with light, at a time
when, though Homer was a dim tradition, his work was a living force
in the world. When Christ was born, Homerus was dead 900 years.
A man with such immensity of glory ceases to be a man. He
becomes a Force.
Of the two imperishable monuments Homer has left us, the decision
of critical scholarship has placed the Iliad first. It has been said that
the Iliad is like the midday, the Odyssey like the setting sun. Both
are of equal splendour, though the latter has lost its noonday heat.
But I would take that adroit simile and draw another meaning from
it.
When deferred, expected night at last approaches, when the sun
paints the weary west with faëry pictures of glowing seas, of golden
islands hanging in the sky, of lonely magic waterways unsailed by
mortal keels; then, indeed, there comes into the heart and brain
another warmth,—the mysterious quickening of Romance.
For I think that the ringing sound of arms, the vibrant thriddings of
bows, the clash of heroes, are far less wonderful than the long,
lonely wanderings of Ulysses.
Through all the Odyssey the winds are blowing, the seas moaning,
and the estranged sad spectres of the night flit noiselessly across the
printed page.
Through new lands, among new peoples—friends and foes—
touching at green islands set like emeralds in wine-coloured seas,
the immortal mariner moves to the music of his creator’s verse. The
Sirens’ voices, the Fairy’s enchanted wine, the Twin Monsters of the
Strait pass and are forgotten.
His wife’s tears bid him ever towards home.
I sometimes have wondered if Vergil thought of Ulysses when he
made his own lesser wanderer say:—

“Per varios casus per tot discrimina rerum,


Tendimus in Latium, sedes ubi fata quietas
Ostendunt.”

And now, since we are to have, on that so magical a stage, a


concrete picture: since we are to take away another storied memory
from beneath the copper dome, I feel that the story of Ulysses may
once more be told in English.
A fine poet, a great player, are to give us an Ulysses who must
perforce be not only full of the spirit of his own age of myth, but
instinct with the spirit of this.
That is as inevitable as it is interesting.
The “Gentle Elia” (how one wishes one could find a better name for
him—but custom makes cowards of us all) has written his own
version of the Odyssey. I cannot emulate that. But I think I can at
least be useful.
There are three stages of knowing Homer: the time when one dog’s
ears and dogrells him at school, the time when one loves him, a
literary love! at Oxford, and the time when the va et vient of life in
great capitals wakes the dormant Ulysses in the heart of every artist,
and he begins to understand.

“The long day wanes: the slow moon climbs: the deep
Moans round with many voices. Come, my friends,
’Tis not too late to seek a newer world.
Push off, and sitting well in order smite
The sounding furrows; for my purpose holds
To sail beyond the sunset——”

C. RANGER-GULL.
A BRIEF ACCOUNT
OF THE
PRINCIPAL CHARACTERS IN THE
WANDERINGS OF ULYSSES,
ACCORDING TO THE ANCIENT
WRITERS AND LEGENDS.
Ulysses. The hero of Homer’s great poem was known to the Greeks
under the name of Odysseus. He was king of the pastoral islands of
Ithaca and Dulichium. Most of the petty Greek chieftains became
suitors for the hand of the beautiful Helen, and Ulysses was among
the number, but withdrew when he realised the smallness of his
chances. He then married Penelope, the daughter of Icarius, and at
the same time joined with the other unsuccessful lovers of Helen in
a sworn league for her future protection should she ever stand in
need of it. He then returned to Ithaca with his bride. The rape of
Helen soon compelled him to leave Penelope and join the other
Grecian princes in the great war against Troy. He endeavoured to
avoid the summons by pretending madness. Yoking a horse and a
bull together, he began to plough the sands of the sea shore. The
messenger who was sent to him took Telemachus, the infant son of
Ulysses, and placed the child in the direct course of the plough, in
this way circumventing his design. Ulysses was one of the most
prominent figures during the Trojan war, his valour, and still more his
cunning, making him of supreme importance in the councils of the
princes. After the Trojan war Ulysses set sail for home, and at this
period of his career the story of the Odyssey begins. He was driven
by malevolent winds on to the shores of Africa, where he and his
mariners were captured by the one-eyed giant, Polyphemus, who
ate five of the band. Ulysses escaped by thrusting a stake into the
giant’s eye and then leaving the cave in which he was confined by
crawling under the bellies of the sheep when the Cyclops led them
to pasture. He next arrives at Æolia, and Æolus gave him,
imprisoned in bags, all the evil winds which were likely to obstruct
his safe return homewards. The sailors, curious to know what the
bags contained, opened them, and the imprisoned winds, rushing
out with fearful violence, destroyed the whole fleet save only the
vessel which bore Ulysses. The ship was thrown on the shores of the
Goddess Circe’s enchanted island, and the companions of Ulysses
were changed into swine by the enchantress. Ulysses escaped the
like fate by means of a magic herb he had received from Mercury,
and forced the goddess to bring his friends to their original shape.
He then yielded to her solicitations and made her the mother of
Telegonus. The next stage of his adventures brings him to Hades,
where he goes to consult the shade of the wise Tiresias as to the
means of reaching home in safety. He passes the terrible coasts of
the Sirens unhurt, and escaped the monsters Scylla and Charybdis
by a series of narrow chances. In Sicily his sailors, urged by extreme
hunger, killed some of Apollo’s cattle, and the Sun-God in revenge
destroyed all his companions and also his ship. Ulysses alone
escaped on a raft and swam to the shores of an island belonging to
Calypso, with whom he lived a lotos life as husband for seven years.
The gods eventually interfered, and Ulysses, once more properly
equipped, set out on his travels again. However, Neptune
(Poseidon), the lord of the sea, still remembered the injury done to
his son, the giant Polyphemus, and wrecked this ship also. Ulysses
was cast up on the island of the Phœacians, where he was
hospitably received by King Alcinous and his daughter the Princess
Nausicaa, and at last sent home in safety to his own kingdom after
an absence of more than twenty years. The Goddess Athene
befriended him, and informed him that his palace was crowded with
debauched and insolent suitors for the hand of Queen Penelope, but
that his wife was still faithful and unceasingly mourned his loss.
Adopting the advice of the goddess, he disguised himself in rags to
see for himself the state of his home. He then slew the suitors and
lived quietly at home for the remaining sixteen years of his
adventurous life. Tradition says that he at last met his death at the
hands of his illegitimate son Telegonus.

Penelope. A famous Græcian princess, wife of Ulysses. She married at


about the same time that Helen wedded King Menelaus, and
returned home to Ithaca with her husband against the wishes of her
father Icarius of Sparta. During the long absence of Ulysses she was
besieged by suitors for her hand, who established themselves in the
palace. She became practically their prisoner, and was compelled to
dissimulate and put them off by various excuses. She managed to
keep her importunate guests in some sort of good humour by giving
out that she would make a choice among them as soon as she had
completed a piece of tapestry on which she was engaged. Each
night she undid the stitches she had worked in the daytime. On the
return of Ulysses she was, of course, freed from the suitors by her
husband. According to some ancient writers, after the death of
Ulysses she married Telegonus, Ulysses’ son by the Goddess Circe.
Her name Penelope sprung from some river-birds who were called
“Penelopes.”

Telemachus. The son of Ulysses and Penelope. When his father left for
the Trojan war Telemachus was but an infant, but at the close of the
campaign he went to seek him and to obtain what information he
could about his father’s absence. When Ulysses returned home in
disguise Athene brought son and parent together, and the two
concerted means to rid the palace of the suitors. After the death of
Ulysses, Telemachus is said to have gone to the island of Circe and
married the enchantress, formerly his father’s mistress. A son called
Latinus sprung from this union.
Athene (Minerva). The Goddess of Wisdom was born from Zeus’ brain
without a mother. She sprang from his head in full armour. She was
the most powerful of the goddesses and the friend of mankind. She
was the patroness of Ulysses, and it was believed she first invented
ships. Her chastity was inviolable. Her worship was universal.

Zeus (Jupiter). Chief of all the gods. His attitude towards Ulysses was
friendly owing to the persuasion of his daughter Athene.

Poseidon (Neptune) was the Sea God and next in power to Zeus. He
was the father of the giant Polyphemus whom Ulysses blinded, and
is the consistent enemy of Ulysses throughout the whole Odyssey.
Neptune was the brother of Zeus.

Hermes (Mercury) was the messenger of the gods and a son of Zeus.
He was especially the patron of travellers and well disposed to
Ulysses.

Tiresias was in life a celebrated soothsayer and philosopher of


Thebes. His wisdom was universal. Having inadvertently seen the
Goddess Athene bathing in the fountain of Hippocrene, he was
blinded. Ulysses visited his spirit in Hades, in order to obtain his
advice as to the journey homewards to Ithaca.

Circe. An enchantress celebrated for her knowledge of the magic


properties of herbs. She was of extreme personal beauty. In girlhood
she married the prince of Colchis, whom she murdered to obtain his
kingdom. She was thereon banished to the fairy island of Ææa.
When Ulysses visited her shores she changed his companions into
swine, but Ulysses was protected by the magic virtues of a herb
called moly. Ulysses spent a year in the arms of Circe, and she gave
birth to a son called Telegonus.

Calypso. One of the daughters of Atlas, was known as the “bright-


haired Goddess of Silence,” and was queen of the lost island of
Ogygia. Ulysses spent seven years with her, and she bore him two
sons. By order of Zeus, Hermes was sent to the island ordering
Ulysses to leave his voluptuous sloth, and Calypso, who was
inconsolable at his loss, was forced to allow him to depart. The
legend runs that the goddess offered him the gift of immortality if he
would remain with her.

Scylla and Charybdis. Scylla was a terrible female monster who


devoured six of Ulysses’ crew, though the hero himself escaped her.
Below the waist she was composed of creatures like dogs who never
ceased barking. She was supported by twelve feet and had six
different heads. The monster dwelt in a cave under the sea on one
side of a narrow strait off the coast of Sicily. On the other side of the
strait was the great whirlpool Charybdis. It was invested with a
personality by Homer, and Charybdis was said to be a giantess who
sucked down ships as they passed.

The Sirens. Monsters with sweet alluring voices who inhabited a small
island near Sicily. They had bodies like great birds, according to
some writers, with the heads of beautiful women. Whosoever heard
their magic song must go to them and remain with them for ever.
Ulysses escaped the enchantment by causing himself to be bound to
the ship’s mast.

Polyphemus. The son of Poseidon. He was the giant king of the


Cyclopes who were workers in the forge of Vulcan and made armour
for the gods. Ulysses and his companions blinded him in order to
escape from the cavern where he had imprisoned them.

Antinous. A native gentleman of Ithaca, one of Penelope’s most


persistent suitors. When Ulysses came home disguised as a beggar
Antinous struck him. He was the first to fall by Ulysses’ bow.

Euryclea. The nurse of Ulysses in his infancy, and one of the first to
recognise him on his return from his wanderings. She was in her
youth the lovely daughter of Ops of Ithaca.

Eumæus. The herdsman and steward of Ulysses who knew his master
on his return after an absence of twenty years. He was the king’s
right-hand man in the plot against, and fight with, the suitors of
Penelope.

THE ADVENTURES OF ULYSSES


THE FIRST EPISODE

How They blinded the Son of Poseidon

A warm mild wind, laden with sweet scents, blew over the sailors
from the island, which now lay far astern.
In the weary west the charmed sunset still lingered over Lotus Land.
A rosy flush lay on the snow-capped mountains which were yet
spectral in the last lights of the day, but looking out over the bows
the sky was dark purple changing into black, and where it met the
sea there was a white gleam of foam.
The companions of Ulysses sat idle from the oars, for the wind filled
the belly of the sail and there was no need for rowing. A curious
silence brooded over them all. No one spoke to his fellow. The faces
of all were sad, and in the eyes of some the fire of an unutterable
regret burnt steadily.
The heads of all were turned towards the island, which was fast
disappearing from their view. Some of the men shaded their eyes
with their hands in one last long look of farewell.
As the curtain of the dark fell upon the sea, the warm offshore wind
died away. A colder breeze, full of the sea-smell itself, came down
over the port bow; it moaned through the cordage, and little waves
began to hiss under the cutwater.
Every now and again the wind freshened rapidly. The mournful
whistling became a sudden snarling of trumpets. The ship and crew
seemed to have passed over the limits of a tableau. Not only was it
a quick elemental change of scene, but the change had its influence
with the spectators.
The sad fire—if the glow of regret is indeed a fire—died out of heavy
eyes half veiled by weary lids. The sea-light dawned once more upon
the faces of the mariners, the bright warm blood moved swiftly in
their veins.
One man ran to the steering oar to give an aid to the helmsman as
the ship went about on the starboard tack, three more stood by the
sheet, a hum of talk rose from the waist of the boat. Ulysses stood
in the bows looking forward into the night. His tall, lean figure was
bent forward, and his arm was thrown round the gilded boss of the
prow. His eyes were deep set in his head, and his brow was
furrowed with the innumerable wrinkles which come to the man who
lives a life of hardship and striving.
Yet the long years of battle and wandering, a life of shocks! had only
intensified the alertness of his pose. He seemed, as he looked out
into the night, a personification of “readiness.” A crisp dark beard
grew round his throat, and the veins on his bare brown arms were
like blue enamel round a column of bronze.
When the ship went about again he came down into the body of the
ship and helped to pull upon the brace. Though he was no taller
than many of his men, and leaner than most, in physical strength as
well as in intellect he was first and chief. The mighty muscles leapt
up on his arms as he strained on the taut rope.
The ship slanted away down the wind into the night. The men
gathered round their captain. “Comrades,” he said to them in a
singularly sweet and musical voice, “once more we adventure the
deep, and no man knows what shall befall us. To our island home in
the west, to dear Ithaca! if the gods so will it. Our wives weep for us
on our deserted hearthstone. Our little ones are noble youths ere
now, and may Zeus bring us safe home at last. Yet much it
misdoubts me that there are other perils in store for us ere we hear
the long breakers beat upon the shores of Ithaca and see the
morning sun run down the wooded sides of Neriton. Be that as the
Fates will it, let us keep always courage, gaiety, and the quiet mind.”
“We are well away from there,” said one of the men, nodding
vaguely towards the stern.
“That are we,” said another; “that cursed fruit is honeysweet in my
mouth still. It stole away our brains and made us as women, we! the
men who fought in Troyland.”
“Of what profit is it to look to the past, Phocion?” said Ulysses. “We
did eat and sleep and forget, but it is over. The sea wind is salt once
more upon our faces. Let us eat the night meal, and then I will
choose a watch and the rest may sleep. Hand me the cup—To to-
morrow’s dawn!”
Then one of the sailors took dried goat’s flesh and fruit from a locker
in the stern, and by the light of a torch of sawn sandal wood they
fell to eating. Great bunches of purple grapes lay before each sailor,
but they had brought none of the magic lotus fruit with them to
steal away their vigour and thicken their blood.
Then they lay down to sleep under coverings of skins. Two men
went to the great steering oar, three men watched amidship by the
braces, and Ulysses himself wrapped a woollen cloak round him and
went once more into the bows.
Alone there with the wind his thoughts once more went back to his
far distant home. He thought with longing of his old father Laertes,
of the child Telemachus playing in the marble courtyard of the sunny
palace on the hill. A deep sigh shuddered out from his lips as his
thoughts fell upon the lonely Queen Penelope. “Wife of mine,” he
thought, “shall I ever lie beside you more? Is there silver in your
bright hair now? Are your thoughts to mewards as mine to you?
Perchance another rules in my palace and sits at my seat. Are your
lips another’s now? The great tears are blinding me. Courage!”
Bending his head upon his breast, Ulysses prayed long and earnestly
to his awful patroness, the Goddess Athene, that she would still keep
ward over his fortunes and guide him safely home.
The night wore on and became very silent. The ship seemed to be
moving swiftly and surely, though the wind had dropped and the
voice of the waves was hushed. It seemed to the watcher in the
bows that the ship was moving in the path of some strong current.
A curious white mist suddenly rolled over the still surface of the sea,
thick and ghostly. The mast and sail, which was now drooping and
lifeless, swayed through it like giant spectres. Ulysses could see
none of his companions, but when he hailed the watch the voice of
Phocion came back to him through the ghostly curtain, curiously
thick and muffled.
“The mist thickens, my captain,” said the sailor. “Can you see aught
ahead?”
“I can see nothing, Phocion,” shouted Ulysses; “the mist is like wool.
But I think it is a land mist come out to meet us. There should be
land ahead.”
“I hear no surf or the rolling of waves,” said Phocion. “May Zeus
guide the boat, for mortal men are of no avail to-night.”
The ship moved on swiftly as if guided by invisible hands towards
some goal, and still the expectant mariners heard no sound.
Quite suddenly, and without the slightest warning, a vivid copper-
coloured flash of lightning illuminated the ship. For an instant in the
hard lurid light Ulysses saw the whole of the vessel in a distinct
picture.
Every detail was manifest—the mast, the cordage, the sleeping
sailors below, the watching group by the shrouds, and, right away
astern, the startled helmsmen motionless as statues of bronze.
Then with a long grinding noise the ship seemed suddenly lifted up
in the water, jerked forward, and then dropped again. She began to
heel over a little out of the perpendicular, and then remained still,
stranded upon an unknown and mysterious shore, where the waves
were all asleep. Still the white mist circled round them.
“Comrades,” said Ulysses, “we are brought here by no chance of
wind and waves. Some god has done this thing, but whether for
weal or woe I cannot tell. Let us land upon the beach and lie down
with our weapons within sound of the sea till dawn. At sunrise we
shall know where the god has brought us.”
They landed at the order, and with the supreme indifference of the
adventurer lay upon the shore and slept out the remainder of the
night. But Ulysses had a prescience of harm, and was full of sinister
forebodings. He did not sleep, but paced through the mist all night
in a little beaten track among the boulders. He prayed long and
earnestly to Athene.
When the first faint hintings of dawn brightened through the mist a
little breeze arose, and before the sky was more than faintly flushed
with day the night fog was blown away like thistledown.
As the sun climbed up the sky the companions found that they had
been carried to a scene of singular beauty. They were on an island,
a small, rich place at the mouth of a great bay. Rich level grass
meadows, green as bright enamel and brilliant with flowers, sloped
gently down to the violet sea. Behind was a thickly-wooded hill, at
the foot of which was a sparkling spring surrounded by a tall grove
of poplar trees.
In the leafy wood the wild goats leapt under the wild vine trees like
Pan at play, as fearless of the intruders as if they had never seen
men before. All the bright morning the sailors made the wood ring
with happy laughter as they speared the goats for a feast. All trouble
passed from their minds, and as the spears flashed swiftly through
the green wood the shrill, jocund voices of the hunters made all the
island musical. Ulysses plunged into a translucent pool at the foot of
the spring, and the cool water flashed like diamonds over his strong
brown arms, and he looked indeed as if he were some river-god and
this his fairy home.
All day long they feasted and drank wine which they had brought in
skins from Lotus Land. When night was falling, very still and gentle,
they saw the blue smoke of fires over the bay, on the mainland,
about a mile away, and the bleating of many sheep and the lowing
of herds came to them over the wine-coloured sea.
Ever and again voices could be heard—strange resonant voices.
“That must be the country of some strange gods,” the sailors said to
each other. “Those are no mortal voices. We are come into some
great peril.” Before they slept they sacrificed a goat on the seashore
to Zeus, that he might guard them from any coming harm.
In the morning the king prepared for action. It was necessary to find
upon what shores they had arrived, to get direction of Ithaca, and if
treasure was to be won by force or guile, to take the opportunity
which chance or the gods had sent.
Ulysses chose twelve of his men, tried veterans with nerves of steel,
old comrades who had fought with him for Helen on the windy plains
of Troy. With these old never-strikes he embarked on the ship. He
left Phocion as leader of the remainder of the crew, and taking
Elpenor with him as second in command, they got out six sweeps,
three on each side of the ship, and rowed slowly over the glassy bay.
The mainland, on the shore where they landed, was a wild rocky
place, and there was a broad road winding away up to the higher
pasture lands. The road was made of great rocks beaten into
smoothness, and fresh spoor of cattle showed that not long since a
great herd had passed to the upland feeding grounds.
Directly in front of them as they landed was a high cave. It was
fringed with laurel bushes, which grew on ledges in the cliff side.
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!

ebookname.com

You might also like