(eBook PDF) Fundamentals of C# Programming for Information Systems 2nd Editioninstant download
(eBook PDF) Fundamentals of C# Programming for Information Systems 2nd Editioninstant download
https://ebooksecure.com/product/ebook-pdf-fundamentals-of-c-
programming-for-information-systems-2nd-edition-2/
http://ebooksecure.com/product/ebook-pdf-fundamentals-of-c-
programming-for-information-systems-2nd-edition-2/
http://ebooksecure.com/product/ebook-pdf-fundamentals-of-
information-systems-9th-edition/
http://ebooksecure.com/product/ebook-pdf-fundamentals-of-
information-systems-8th-edition/
https://ebooksecure.com/download/fundamentals-of-information-
systems-ebook-pdf/
Essentials of MIS (Management Information Systems),
15th Global Edition Kenneth C. Laudon - eBook PDF
https://ebooksecure.com/download/essentials-of-mis-management-
information-systems-15th-global-edition-ebook-pdf/
https://ebooksecure.com/download/essentials-of-mis-management-
information-systems-15th-global-edition-ebook-pdf-2/
http://ebooksecure.com/product/ebook-pdf-management-information-
systems-for-the-information-9th/
https://ebooksecure.com/download/fundamentals-of-ecosystem-
science-ebook-pdf/
http://ebooksecure.com/product/ebook-pdf-fundamentals-of-
communication-systems-global-edition-2nd-edition/
6.5 Getting User Input from Controls ................................................................................................... 183
6.6 Working with ComboBoxes............................................................................................................ 186
6.7 Working with ListBoxes ................................................................................................................. 196
6.8 Windows Presentation Foundation (WPF) ..................................................................................... 201
Exercises ............................................................................................................................................... 203
Chapter 7: Arrays ................................................................................................205
7.1 Introduction to One-Dimensional Arrays ....................................................................................... 205
Tutorial 1: Working with 1-D Arrays: Test Scores Application ........................................................... 208
7.2 Assigning a Value to an Element of an Array................................................................................. 211
7.3 Accessing Elements of an Array Using the Index .......................................................................... 212
7.4 Accessing Elements of an Array Using the foreach Loop .............................................................. 215
7.5 Copying an Array............................................................................................................................ 217
7.6 Looking Up Values in an Array ...................................................................................................... 221
Tutorial 2: Lookup Units Sold Using 1-D Arrays................................................................................. 222
Exercises ............................................................................................................................................... 224
Chapter 8: Sequential Files and Arrays.............................................................226
8.1 Introduction to Text Files................................................................................................................ 226
Tutorial 1: Reading Text Files .............................................................................................................. 229
8.2 Splitting a Row: Split Method ........................................................................................................ 231
8.3 Reading Data from Files into Arrays .............................................................................................. 234
8.4 Additional Methods of Arrays ........................................................................................................ 241
Tutorial 2: Looking Up Phone Numbers Using Arrays ........................................................................ 242
Tutorial 3: Using a ComboBox to Select the Search Name .................................................................. 246
8.5 Writing to Text Files ....................................................................................................................... 248
Tutorial 4: Writing Scores to Text File ................................................................................................. 248
8.6 SaveFileDialog Control .................................................................................................................. 255
8.7 Passing Arrays to Methods ............................................................................................................. 259
Tutorial 5: Passing Arrays to Compute Average .................................................................................. 259
8.8 Two-Dimensional (2-D) Arrays ...................................................................................................... 263
Tutorial 6: 2-D Array to Find the Sales for a Product........................................................................... 267
Exercises ............................................................................................................................................... 271
Rentals Assignment 2 ........................................................................................................................... 272
Help Desk Assignment 2 ...................................................................................................................... 274
Chapter 9: Collections .........................................................................................276
9.1 Introduction to Collections.............................................................................................................. 276
9.2 List<T> Collection .......................................................................................................................... 278
Tutorial 1: Looking Up Sales Data Using a List ................................................................................... 279
9.3 Dictionary<TKey, TValue> Collection .......................................................................................... 285
Tutorial 2: Dictionary with Product# as Key and Price as Value ......................................................... 287
Tutorial 3: Dictionary with Product# as Key and Sales Array as Value ............................................... 293
Exercises ............................................................................................................................................... 297
Chapter 10: Graphical User Interface: Additional Controls...........................298
10.1 ListView: Features ........................................................................................................................ 298
10.2 Adding Items to ListView ............................................................................................................. 299
Tutorial 1: Selecting a Show from a ListView ..................................................................................... 302
10.3 Accessing Data from a ListView .................................................................................................. 302
10.4 Forms with Tab Pages ................................................................................................................... 308
Tutorial 2: Multipage Form with TabControl ....................................................................................... 308
Exercises ............................................................................................................................................... 310
Chapter 11: Multi-form Applications and Menus ............................................312
11.1 Introduction ................................................................................................................................... 312
11.2 Accessing an Existing Form from Another................................................................................... 313
Tutorial 1: Multi-form Financial Planning Application ........................................................................ 315
11.3 Sharing a Method between Multiple Forms .................................................................................. 318
Tutorial 2: Sharing the LoadDictionary Method between Forms ......................................................... 319
11.4 Closing a Parent Form .................................................................................................................. 325
11.5 Menus............................................................................................................................................ 328
11.6 ToolStrips...................................................................................................................................... 332
Exercises ............................................................................................................................................... 334
Chapter 12: Databases .........................................................................................335
12.1 Introduction ................................................................................................................................... 336
12.2 Creating Database Objects ............................................................................................................ 336
Tutorial 1: Display Employee Records Using the Wizard .................................................................... 337
12.3 Displaying Data in a DataGridView ............................................................................................. 340
12.4 Accessing Data Items from a DataGridView ................................................................................ 346
12.5 Displaying Data in Details View .................................................................................................. 349
12.6 Finding the Record for a Selected Key ......................................................................................... 351
Tutorial 2: Find Employee Records Using the Wizard ......................................................................... 352
12.7 Selecting a Group of Records Using the Binding Source ............................................................. 356
12.8 Selecting Records Using the Table Adapter ................................................................................. 362
Tutorial 3: Parameter Query to Select Records..................................................................................... 363
12.9 Untyped Datasets: Displaying Records......................................................................................... 365
Tutorial 4: Display Records Using Untyped Datasets .......................................................................... 366
12.10 Untyped Datasets: Selecting Records ......................................................................................... 375
Tutorial 5: Select Records Using Untyped Datasets ............................................................................. 377
12.11 Untyped Datasets: Add/Edit/Delete Records .............................................................................. 384
Tutorial 6: Add/Edit/Delete Using Untyped Datasets........................................................................... 385
12.12 Command Object and DataReader .............................................................................................. 394
Tutorial 7: SqlCommand and SqlDataReader to Work with Tables ..................................................... 396
Exercises ............................................................................................................................................... 405
Rentals Assignment 3 ........................................................................................................................... 407
Help Desk Assignment 3 ...................................................................................................................... 407
Chapter 13: Object-Oriented Programming .....................................................414
13.1 Introduction to Objects and Classes .............................................................................................. 415
13.2 Classes versus Objects .................................................................................................................. 415
13.3 Information Hiding (Encapsulation) ............................................................................................. 417
Tutorial 1: Create an Employee Class................................................................................................... 419
13.4 Properties ...................................................................................................................................... 423
Tutorial 2: User Interface and Properties .............................................................................................. 426
13.5 Calling Methods (Sending Messages to Objects) ......................................................................... 434
Tutorial 3: Calling Methods and Passing Data between Forms ............................................................ 435
Exercises ............................................................................................................................................... 448
Chapter 14: Inheritance ......................................................................................450
14.1 Introduction to Inheritance ............................................................................................................ 451
14.2 Implementing Inheritance ............................................................................................................. 452
Tutorial 1: Creating Subclasses ............................................................................................................ 454
14.3 Using Subclasses and Super Classes............................................................................................. 458
14.4 Overriding Methods ...................................................................................................................... 459
Tutorial 2: Implementing the GrossPay Method................................................................................... 462
14.5 Polymorphism ............................................................................................................................... 467
Tutorial 3: Dynamic Dispatch and the ToString Method...................................................................... 468
14.6 Abstract Classes and Interfaces..................................................................................................... 472
Tutorial 4: Interfaces ............................................................................................................................. 473
14.7 Using Interfaces to Sort Collections ............................................................................................. 480
Tutorial 5: Sorting Employees .............................................................................................................. 483
14.8 Access Modifiers in C# ................................................................................................................. 486
Exercises ............................................................................................................................................... 488
Chapter 15: Introduction to Web Applications Development .........................491
15.1 Introduction to Web Applications ................................................................................................. 491
15.2 Creating a Single-Page ASP.NET Website................................................................................... 496
Tutorial 1: Developing a Simple Web Page: Ice Cream Cost ............................................................... 496
15.3 Introduction to HTML .................................................................................................................. 502
15.4 Working with Web Server Controls.............................................................................................. 506
15.5 Validating Data Using Validation Controls .................................................................................. 517
Exercises ............................................................................................................................................... 522
Chapter 16: Web Development: Multipage and Database Applications.......523
16.1 Accessing Databases from Web Forms ........................................................................................ 523
Tutorial 1: Accessing a Database: Theater Tickets Application ........................................................... 524
16.2 Preserving Data during Postbacks Using View State ................................................................... 538
16.3: Multipage Websites and Session State ........................................................................................ 543
16.4 Setting a Page to Its Previous State ............................................................................................... 551
Exercises ............................................................................................................................................... 557
Appendix A: Binary Files ....................................................................................559
A.1 Writing to Binary Files .................................................................................................................. 559
Tutorial: Working with Binary Files ..................................................................................................... 559
A.2 Reading Binary Files ...................................................................................................................... 560
Appendix B: Creating a Database ......................................................................562
Tutorial: Creating HR Database............................................................................................................ 562
Appendix C: Answers to Review Questions ......................................................564
Appendix D: HTML Elements ............................................................................584
Index ......................................................................................................................586
Preface
Mission of the Text
Welcome to Fundamentals of C# Programming for Information Systems. This book teaches the
fundamentals of programming in C# to provide a solid foundation to build business and other real-world
applications. Programming concepts are discussed in the context of familiar practical applications that use
graphical interfaces.
Target Audience
This book is designed for introductory programming courses in IS/MIS, CIS and IT. This book also
would fit into a computer science curriculum with an introductory course that uses a GUI-based
application-oriented approach to teach programming concepts. The breadth and depth of coverage makes
this book suitable for a two-course sequence, particularly when students come to the first course with no
programming background and a slower pace is desired. An approach in a two-course sequence would be
to do in-depth coverage of topics like collections, databases, object-oriented programming, web
development, and others presented in later chapters only in the second course.
Key Features
A key feature of the book is that programming concepts are introduced in small chunks through examples
and illustrations accompanied by hands-on tutorials. The tutorials, which are interspersed with the
concepts, help students apply and explore what they learn immediately. Additionally, review questions
and exercises within the chapters enhance student interest and learning.
Although the book is written for beginners, it is thorough and concise. Graphical illustrations and
screenshots are used throughout the book to enhance learning for both beginners and experienced
students.
Windows forms are used from the beginning to provide GUI-based as opposed to console-based interface.
This book builds graphical user interfaces and code in the .Net environment using Visual Studio. You are
encouraged to use the current free version, Visual Studio Community 2017. Earlier versions, including
Visual Studio 2015, Visual Studio Express and Visual Studio 2013, generally work well, except that you
won’t be able to run a few programs that use certain features available only in C# version 7.1 or greater.
ii
Supplements
For Students: Tutorial_Starts.zip file that contains
o Partially completed projects for tutorials
o Data files/databases used in projects
To install Visual Studio, open the downloaded .exe file and run it.
between collections and arrays, collections are presented in this book immediately following Chapter 8 on
arrays.
Chapter 10 discusses the application of ListView and TabControl. The dependency of this chapter on
Chapter 9 (“Collections”) is very low. The prerequisite for this chapter includes Chapters 6 and 8.
Chapter 11 presents multiform applications, Menus and ToolStrips. This chapter has some dependency on
previous chapters, except Chapter 10.
Chapter 12 provides in-depth coverage of accessing databases from C# programs. Chapter 6 is a
prerequisite for this chapter. In addition, the ListView control presented in Chapter 10 is used in an
example in the last part of this chapter, and it is required in the third comprehensive assignment
(Assignment 3) at the end of this chapter. Assignment 3 also requires the use of MainMenu control
discussed in Chapter 11. Other than that, the dependence of Chapter 12 on Chapters 7–11 is relatively
low.
Chapter 13 provides an introduction to object-oriented programming (OOP) principles and techniques.
The initial part of this chapter may be used for an introduction to OOP early in the semester.
Chapter 14 describes the concept of inheritance, implementation of inheritance, subclasses and super
classes, overriding methods and polymorphism. Chapter 13 is a prerequisite for this chapter, and it also
relies on collections from Chapter 9.
Chapter 15 presents the concepts of web applications development, and develops simple web applications
using the ASP.Net platform in the Visual Studio environment. Only the basic programming knowledge
presented in Chapters 1–3 is required for this chapter.
Chaper 16 describes how to access SQL Server databases and develop multipage web projects. Basic
programming concepts presented in Chapters 1–6, the concept of collections from Chapter 9, and basic
database concepts including binding controls to a database and filtering records (Chapter 12) are used in
building the application.
iv
Acknowledgments
I am thankful for the valuable assistance provided by many people in the preparation of this book. I wish
to thank Dr. Jakob Iversen, The University of Wisconsin–Oshkosh, for authoring Chapters 13 and 14 on
Object-Oriented Programming.
I was fortunate to work with Beth Lang Golub, editor and president of Prospect Press, who was flexible
and supportive of my goal to offer a good quality programming textbook at a reasonable price. Special
thanks go to Susan Hegedus, Kathy Bond Borie and Rachel Paul for their painstaking attention to detail in
editing this book, and to Annie Clark for the cover design.
I wish to acknowledge the contributions of the following reviewers for their valuable guidance in
improving the presentation and contents of this book:
Janet Bailey, University of Arkansas at Little Rock
Wei Kian Chen, Champlain College
Clinton Daniel, University of South Florida
Silvana Faja, University of Central Missouri
Joni L. Jones, University of South Florida
David Pumphrey, Colorado Mesa University
Manonita M. Ratwatte, University of Oklahoma (Retired)
Theadora Ross, University of Arkansas at Little Rock
David M. Weber, Northern Arizona University
Thanks are also due to the instructors who provided valuable feedback on the first edition of this book
through user surveys:
Janet Bailey, University of Arkansas, Little Rock
Jeff Dickson, Oregon Institute of Technology
Ruth Lamprecht, Virginia Union University
Panos Linos, Butler University
Ziping Liu, Southeast Missouri State University
Robert Pilgrim, Murray State University
Kris Rosenberg, Oregon Institute of Technology
Doug Titus, University of North Florida
Welcome to programming in C# language. In this chapter, you will learn to develop simple programs in
the Visual Studio development environment, and to work with different types of data.
Learning Objectives
After studying this chapter, you should be able to:
Identify the inputs, processes and outputs of a software system.
Describe the steps involved in developing a computer program.
Describe the terms: syntax, logic and runtime errors, machine language, low-level language, high-
level language, compiler and interpreter.
Develop a simple form in Visual Studio to accept user input, do calculations and display
formatted output.
Work with Label, TextBox, Button, ListBox and MessageBox.
Develop simple programs that use constants, variables and expressions.
Use try-catch method to catch errors.
Topics
Typically, a program uses one or more data items to produce some results. For example, a program that
processes an order might use the item number and order quantity to compute the subtotal, sales tax and
total cost, as represented in Figure 1-1.
Subtotal
Item# Process
Sales tax
Quantity Order
Total cost
The program, represented by the block “Process Order,” may include multiple subtasks like look up the
unit price, check inventory and compute results.
The data that are used by a program are called the input to the program, and the results produced are
called the output of the program. In addition to processing input data to produce the output, a program
might write data to and read data from storage devices like a flash drive or a hard drive, as represented in
Figure 1-2.
Here is an example of a simplified statement of the purpose of the order processing program:
Purpose: Compute and display the subtotal, sales tax and total cost for an order
The output of the program often follows from the purpose. For this example, the output would be
Output: subtotal, sales tax, total cost
The process specifies not only what the program should do (e.g., compute total cost) but also how it
should be done (e.g., how to compute total cost), as follows:
Process: (What?) Look up unit price, look up sales tax rate,
compute subtotal, sales tax and total cost
(How?) subtotal: unit price * order quantity
sales tax: subtotal * sales tax rate
total cost: subtotal + sales tax
Specifying the process also would include identifying the sources of data, like the product file to get the
unit price and sales tax file to get the sales tax rate.
The input specifies the data items that are needed to carry out the process to produce the output. The
input for this order-processing system would be
Input: item number, order quantity
Note that unit price and sales tax rate are not included in the input because the program looks them up. A
real-world system would be a lot more complex. Typically, the process would include additional subtasks
like handling orders when inventory is insufficient, and output may include various reports. In such
systems, graphical methods like Data Flow Diagrams and UML diagrams are used to represent the
processes and the data accessed by them.
Again, a real-world program may have to do additional subtasks, like checking the inventory to make sure
there is sufficient quantity on stock.
For relatively simpler programs, after identifying the subtasks, you may go directly to writing the
program for each subtask. However, for tasks involving more complex logic, it might help to develop an
outline of the logic of performing the subtasks. The representation of the logic of a program in plain
English is called pseudo code. You also may represent the logic graphically using a flowchart, as
discussed in Chapter 3.
source code, to another language before running a program, as described in the next section. So, your
first task is to make sure that there are no syntax errors. The good news is that Visual Studio provides a
lot of help in identifying syntax errors.
After the syntax errors are eliminated, the program may run. But, it’s still too early to celebrate because
the results could be incorrect due to errors in the program logic, just like you can write a grammatically
correct sentence that doesn’t convey the intended message. Errors that cause a program to produce
incorrect or unintended results are called logic errors. A tax-filing software using the wrong tax rate and
a billing software overcharging a customer are examples of logic errors.
There are errors other than logic errors that can occur at runtime. These are called runtime errors.
Runtime errors cause the program to crash (unless the program catches and handles such errors) because
the program asks the computer to do something it is unable to do, like accessing a file with an invalid path
or dividing a number by zero.
The process of identifying errors (bugs) is called debugging. Testing programs to identify and eliminate
errors is an extremely important part of developing software.
Review Questions
1.1 Consider Google as a software system. What would be the input, process and output for Google?
1.2 Consider a software system that enrolls students into classes. Identify some key inputs that the
system needs every time a student enrolls in a class, and the subtasks (process) that need to be
performed. What are some outputs the system should produce for students and instructors?
1.3 List the major steps in developing a program.
1.4 Incorrect punctuation in a program is an example of what type of error?
1.5 A payroll program uses the wrong formula to compute overtime pay. What type of error is it?
1.6 True or false: A program that doesn’t have any syntax errors should produce the correct results.
The products that support developing and running programs within the Visual Studio family include the
following:
1. An Integrated Development Environment (IDE)
An IDE provides an environment to develop programs, which includes code editors for Visual
C#, Visual Basic, Visual J#, Visual C++, HTML and XML, and designers for Windows forms
and web forms.
In Visual Studio, a software application typically is organized into Projects that may contain one
or more forms.
Forms provide the user interface that allows users to input data for the program, to interact with
the program and to display results.
2. A compiler that translates the source code into Microsoft Intermediate Language (MSIL)
Running a program, as described earlier, consists of (1) the compiler translating the source code (the
project) into Microsoft Intermediate Language Assembly and (2) the Common Language Runtime
translating the assemblies from Intermediate Language to Machine Language and executing the program
to produce the output. Next, we will look at how to work with Visual Studio to develop C# programs.
Review Questions
1.7 What is the only programming language that the CPU can understand?
1.8 What is a compiler?
1.9 What is an interpreter?
1.10 What is Microsoft Intermediate Language Assembly?
1.11 What is the function of Common Language Runtime in Visual Studio?
Figure 1-4 presents the design of the form that shows the user interface to let the user enter the number of
scoops and unit price to display the cost. You will create the form in Tutorial 1.
You may change the color theme by selecting Environment, General from the Options window.
Similarly, you may reset your settings by selecting Tools, Import and Export Settings, Reset all
Settings.
Close Options window.
Select Visual C# from Templates, Other Languages. For the type of application, select Windows
Forms Application, as shown in Figure 1-6.
For Name, enter Ch1_IntroProgramming.
Select the Location, if different from the default folder.
Leave the CheckBox for Create directory for solution unchecked so that both the Project and the
Solution will be created in the same folder. (If there are multiple Projects within a Solution, it
would be better to have separate directories for the Solution and Projects.) Note that the default
name for the Solution is the same as that of the Project.) Click OK.
The Visual Studio development environment appears, as shown in Figure 1-7.
IN SOUTHERN COLORADO
There is only one road in the States as bad as that from Walsenburg
to Trinidad. I refer to the road from Trinidad to Walsenburg.
In spite of that it was a good road; I got through. It took endless
patience, perseverance and a morning of time to do those fifty
weary miles. The scenery was strange, almost to the point of
weirdness. From the surrounding flatness would rise sudden
plateaus, with dead vertical sides and perfectly flat tops. Even the
hills and mountains where they occurred (save in the distant
Rockies) were modelled on the same plan, rising abruptly from the
plain and ascending in two, three or more sudden steps. The effect
was just as though the land architecture had been entrusted to
some aspiring cubist or futurist instead of to the well-disciplined laws
of Nature.
I do not profess to have attained much learning in the science of
geology, and speak, therefore, as one without authority. But it
seemed to me on many occasions that to study the geology of the
Far West, the English scientist would have to forget all he had ever
learnt about physical geography and start all over again in Southern
Colorado.
At first I was puzzled in the extreme to see how the mountains rose
suddenly out of the great plains, without any warning almost, and
without the customary foot-hills and valleys that one would expect to
see clustering around a mountain range of several thousands of feet
in height. Afterwards I became accustomed to this unusual
formation, when I found that mountains always grow that way in the
Far West, and particularly farther on in New Mexico and Arizona. All
their ranges seemed like elongated "Wrekins" set in a plain of
gigantic dimensions.
At Aguilar, half-way on the road to Trinidad, I met the first really
Mexican town. It will be remembered that all the south-western
States once belonged to Mexico and one by one they have been
ceded or bought or otherwise appropriated until Mexico now is only
a shadow of its former self. Nevertheless a large proportion of the
population is still Mexican, in spite of the continued influx of
American settlers, and consequently Mexican is spoken almost
universally in addition to English as the national tongue.
Trinidad styles itself "The industrial and commercial centre of S. E.
Colorado." With a population of something in the region of 14,000, it
stands at the base of Fisher's Peak (10,000 feet), and it is an
admirable example of the inextricable mixtures of Old Mexico and
New America in the cities of the West. I took its picture and left its
shining well-paved streets to track down my old friend, the Santa Fé
Trail.
I got one mile away from the town and then struck. The trail climbed
rapidly, skirting the Peak all the time in preparation for the Raton
Pass soon to follow, which cuts right over the Rocky Mountains into
New Mexico. That in itself was nothing. I am always game for a
good hill-climb. But I had thought better of the Santa Fé Trail. After
climbing 1,000 feet in just over a mile, it changed into the most
absurd hotch-potch of ruts and mud-heaps that ever eye witnessed,
and this for as far as one could see. The condition of the road
strained my credulity to breaking point. Getting through the far-off
mud-hole at Hume in Indiana was a child's tea-party compared with
this. In half an hour I did just 100 yards and then, after resolutely
determining to return to Trinidad and take the train, I found that to
go back was as much out of the question as to go forward. It simply
couldn't be done single-handed. To turn Lizzie round would require
nothing less than a sky-hook and pulley-blocks.
I left her standing in a huge rut in the middle of the road and
reconnoitred to see how far this appalling state of affairs continued.
Fortunately a Flivver appeared round a bend in the road ahead,
coming in the opposite direction. It heaved and swayed and bumped
and side-slipped and hiccoughed its way along. I watched it until it
finally reached the spot where Lizzie blocked the way. Then
something had to be done. The car had two occupants, both hefty-
looking men, whom I enlisted to my aid. Together we lifted and
pulled and heaved and pushed until the worst was past, and then I
struggled on alone.
Farther into the mountains we travelled; higher and higher we
climbed. In places the trail was hewn out of the rugged mountain
sides, and except in a few places there was hardly room for more
than one vehicle to pass. Occasionally a "washout" would be
encountered where a mountain stream had encroached on the road
and washed it away altogether. Then would come a short detour
over a gap in the bank, with the grassy slope strewn with branches
and small tree-trunks to prevent the unfortunate vehicle sinking in
and thus permanently blocking all progress that way.
The ascent of the Raton Mountains by the Raton Pass is made
amongst some of the most beautiful scenery imaginable. The trail is
only visible a few yards ahead and is lost in sudden twists and turns
as gradually the mountain slopes are devoured. On the right, almost
behind, are still to be seen the famous Spanish Peaks towering like
twins in solitude above the rest of the Sangre de Cristo range, some
forty miles away. Soon we shall be leaving Colorado State behind us
—Colorado the Glorious, the Beautiful, the Great.
It is said that "amongst all the mountain kingdoms, Colorado seems
to stand easily first in physical adornment: not even Switzerland and
her Alps offering more than a fair comparison." Mont Blanc, the
highest peak in the Alps, is 15,784 feet high, while Colorado has
many peaks lacking little of this height. The lowest depths of some
of Colorado's famous parks are higher than the average height of
the Alpine Chain.
Upward we climb, amid thickly-wooded mountain tops, round
thrilling bends and tortuous precipices and over the rockiest of
roads. The end is in sight. A depression in the sky-line ahead shows
where the Raton Pass (7,620 feet to be exact) reaches its highest
point and gazes forwards into the heart of New Mexico and behind
into the vastnesses of Colorado.
A gradual bend, a sudden swerve, and then—the summit is reached.
Colorado is passed. Before us lies a great and thickly-wooded valley,
broad and deep and beautiful. Beyond lie the great plains of New
Mexico, plains so vast that in their utter defiance of limit and
dimension they beggar description. The eye could not follow the
great expanse. So immense were the distances that the earth
merged indefinitely into the sky at the horizon. Dotted and strewn
here and there were hills and mountain ranges that seemed to have
sprung up so suddenly out of the plateau to have really no
connection with them.
Here I stood at the gate of another world. Before me lay a land of
mystery and romance, a land of health for body and soul; a land of
desert and sage-bush, of cactus and strange vegetation; a land of
antiquity unparalleled by any other in the world. Here at my feet lay
New Mexico and beyond, Arizona, the two States that at the same
time are the oldest and the youngest in America. Although only
admitted to the Union in 1912, their history dates from remote ages
when they were peopled by a race unknown to-day but nevertheless
well advanced on the road to civilization, a race that built cities while
Babylon was as yet unknown, and laid down irrigation systems that
puzzle the engineers of the present day.
Arizona and New Mexico, you are the pearls of great price that no
human being has ever yet valued at your true worth. When the day
shall come that man can say of you, "I have seen you in all your
moods and have discovered all your secrets," then this old earth will
be a lifeless, soulless, aimless globe, its purpose fulfilled, its course
completed.
A five mile descent through the scented pine-trees brought me to
Raton, another half-Mexican, half-American town, small but modern
and well-arranged. "No more 'rooming-houses' for me," I resolved
and turned my gaze to the far-distant plains where the darkness was
slowly gathering.
Even in New Mexico, one need never go without a meal. The way to
an Englishman's heart is through his stomach (this applies also to
Americans and most human beings in general!). My heart was
greatly touched by Raton in this manner, and shortly before dusk I
was speeding on my way southwards towards Santa Fé.
Ten miles out the trail crossed a river. It must have been the
Canadian River, a tributary of the Arkansas, which it joins several
hundred miles to the east. The surrounding country was desolation
and solitude itself. Half prairie, half waste, almost desert, it was a
country of new sensations. Just to the west, from horizon to horizon,
stretched the gaunt and rugged Sangre de Cristo range, dark and
threatening always in their aspect. Not a living thing was in sight,
not even a suggestion of life. I ran Lizzie off the road to the brink of
the river and laid down my bed in the silver rays of the rising moon.
At 6.30 in the morning the sky was ruddy and the air pure with the
fresh breezes of the dawn. From minute to minute the myriad
colours of the mountains changed their tints as the sun rose higher
in the Mexican sky. I continued on my way.
The road was broad and good, but a surprise was in store. After a
few miles there appeared a dilapidated signpost where a bedraggled
pathway joined the broad highway through a gap in the fence which
now ran alongside. It bore the legend "To Santa Fé" and pointed
through the fence to the left. My first impression was that some
small boy had been playing pranks. It was inconceivable that these
two ruts but a few inches wide in the coarse green grass should lead
to Santa Fé while there, straight on, was a good broad highroad that
led nowhere. It ran clear ahead and was lost over the brow of a hill.
I never found where that road went. I have never seen it on any
map and have made many inquiries since. Some travellers, like
myself, had seen that road and wavered, but not one had gone that
way and could enlighten me.
New Mexico is not a nice country in which to lose oneself. Towns are
very few, and often one can go a hundred miles without seeing a
village or meeting a soul. So in spite of the temptation I swerved to
the left and entered the field that was without corn or pasture,
following those two ruts that cut deep into the prairie soil and were
not visible more than 50 or 100 yards ahead at the most. In places
the two ruts had become too deep for further use and another pair
had been started at the side, running parallel with the original ones.
When these had worn too far another pair had sprung up, and in
many places I counted eight distinct pairs of ruts running side by
side across the prairie, each representing a distinct phase in the
evolution of the Santa Fé Trail. At any point, if one looks far and long
enough, one can find the original tracks that centuries ago were
formed by the old prairie-schooners as they journeyed westward
across the plains to Santa Fé.
The next town lay far across the plains beyond the horizon. I should
have to hurry if I were to get any breakfast, but the riding was
rough. Tufts of coarse grass and sharp stones covered the prairie
and held back the speed; here and there were the holes of prairie-
dogs, who respect no one in their choice of a site. If it pleases them
to build their front-door entrance where your favourite inter-rut strip
happens to be, well, they build it there. Their holes are generally
about six inches in diameter, the mouth being funnel-shaped.
Passing vehicles smash them in until the opening is sometimes two
or three feet across. Our friend the prairie-dog doesn't mind in the
least. He continues to live there in spite of the traffic and never a
curse escapes his lips. He is a dear little animal. One cannot help
loving him. In stature these animals have the characteristic of both a
squirrel and a rabbit, and are about a foot in length. They sit on
their fat little haunches like a squirrel, but have only a little bobbed
tail like a rabbit. I believe they are the most friendly rodents in
existence, and have the reputation of dwelling in friendship even
with rattlesnakes, who never harm them! If you surprise one when
he is away from home, he watches you, motionless, to see if he has
been seen, if only a few feet from the intruder. And when he sees
that you have seen, away he runs with his head well down and his
little tail well up until he reaches his burrow in the flat prairie. This
done, he considers himself safe, turns round, sits on his haunches
and stares inquiringly at you. But if you dare come too close he
disappears in a second and is seen no more.
One cannot help laughing at the antics of these amusing little
animals as they scamper off like month-old puppy dogs. Ofttimes I
have chased one to his hole in the road and watched the anxious
look on his face as for a brief moment he turns his head before
flashing into the ground below your front wheel. No true traveller
could harm one of these innocent little beasts; they are often his
only companions for hundreds of miles.
Ten, twenty, thirty miles I travelled over the almost trackless prairie.
Occasional mud-pools barred the way, but when the trail was
unfenced, these were easily avoided. Later on fences appeared,
limiting the road from some neighbouring ranch. I judged I was
getting near to Springer.
An old shack of a two-seater car hove in sight, coming in the
opposite direction; I had an opportunity of studying it in detail as it
came close up. Naturally we both stopped. All travellers are friends
in the Far West, where distances are great and people are few.
"Guess you'd better follow us if you want to get to Springer this
week," essayed the driver.
"Why, is there any mud about?"
"Mud? There's a hole down there outside the town that we've been
trying to get either in or out of these two-and-a-half hours. Had to
get some hosses to pull us backwards out of it in the end. Gosh, I've
never seen a mud-hole like it in all my days. We kin get around
another way though, I'm told. Where you headin' for, stranger?"
"Santa Fé."
"Oh, we was expectin' to get to Santa Fé this mornin'. We're bound
for El Paso, and must get there by to-morrow."
I reflected that El Paso was in Texas on the Mexican border, some
500 miles to the south! "Well, if you don't mind, I'll come along to
Santa Fé with you, so then we can each help dig each other out of
any holes that happen along."
"Righto, glad to have your company, but we're not speed merchants
like I guess you are with that 'oss there."
"Don't make any mistake, brother. I passed the speed craze a
thousand miles back. It doesn't pay."
So we retraced our tracks, the car leading. It was shorn entirely of
mudwings and footboards to save the wheels becoming clogged or
the running boards fouling the road. On the back was strapped a
large trunk. This I found is the usual way of travel by "auto" in the
West. Seldom does one see wings on a car that is driven for any
distance from home. Running boards, if present, are generally of an
improvised variety made by planks suspended and fastened in place
by ropes around the body work. Thus the road clearance is
increased and the necessity for constant cleaning removed. By far
the most popular "machine" is the Ford. You can buy one cheap and
sell it as scrap when the journey, if a long one, is finished. Owners of
large expensive touring cars very often have a Ford as well for
emergencies and for long distance travelling. In New Mexico and
Arizona I have seen scores of huge touring cars stuck helplessly in
the road and often abandoned altogether until the seasons permit of
their removal.
I followed my friends from Texas along little pathways and rough
tracks strewn with boulders, through gaps in fences, across fields
and back gardens, all, to my mind, at an alarming pace. It was only
with difficulty that I kept up with them at all, owing to the many ruts
and rocks and other obstructions that are far more hindering to two
wheels than four.
Arrived eventually in Springer, I resolved to postpone the promised
meal until later in the day.
We passed many ranches and crossed many mud-holes, some of
alarming width across. In most I managed to fall off at least once
and wallowed in the mud. Sometimes the car got so far ahead as to
be lost altogether, but after each encounter with a mud-lake I
managed to make up the lost time.
Thus passed nearly thirty miles in which I realized the utter
absurdity of two wheels compared with four. At one place I lost so
much time that I began to give up as hopeless the attempt to keep
up with the car ahead. After all, what was the use? Once out of the
mire, however, the trail became better and turned into loose sand for
many miles.
Over this sand I made good progress. It was now nearly midday,
and I had visions of a meal in Wagonmound, a small village some
twenty miles away. The appetite was there all right, and as I
trimmed off mile after mile at good speed I forgot all about mud-
holes and the like.
All at once the engine burst into a wild roar and Lizzie began to slow
down. What new trouble was this? A broken chain, or something
worse? I stopped as quickly as I could and proceeded to an
examination of the transmission. The chain was all right, but the
engine sprocket had almost come right off the driving shaft. The key
and nut, where were they?
For an hour I searched up and down in the sand and in the grass at
the roadside for the missing parts, but without success. The sun was
almost vertically above and its rays poured down unmercifully from a
cloudless sky. There was not a sign of water or of any living thing in
any direction.
I returned to another examination to discover whether I could
remove a nut from any other part of the machine to replace the
defaulter. Not a nut was there anywhere that at all approached
either the size or the thread required. I searched once more,
wondering in how many days' time another vehicle would pass that
way, and half resolved to walk the next twenty miles.
What! Leave Lizzie and walk! Never!
Another hour elapsed. I had explored all the ruts and searched every
inch of the road for half a mile back. I stopped, and wondered
where I could find water to drink. Water would be even more
acceptable than the nut and key now. I scanned the sun-baked
prairie in all directions. From horizon to horizon there was nothing
but the solitary distant mountains, and here and there a lonely
parched-up hill. Truly a nice outlook! Henceforth I would carry a
water-bag with me.
I decided to return to Lizzie, push her off the road and try walking.
But just to think of coming 3,000 miles in her constant company, and
then having to forsake her! "Poor old Lizzie, she's a dear old crock,"
I murmured to myself.
What was that? I stooped down to see, and there hidden in a crack
in the hard mud was the missing key. That put a different aspect on
matters altogether. The nut would in all probability not be far away. I
set out to explore every stone and every rut and every crack. Sure
enough I found it not very far away.
In a few minutes the midsummer air was whistling past my ears
once again.
In ten minutes I found myself surveying the biggest thing in mud-
lakes that it has ever been my misfortune to negotiate. The road
was fenced in, naturally. There was a ranch on either side of it. The
lake of mud extended sideways to the very borders of the road,
ninety feet wide. The distance across was about fifty yards. I
estimated that the mud and water were waist-deep in the middle.
Ridges and furrows of harder mud, where passing cars had churned
it up, in a desperate attempt to get through, led into the sickly mass
and then were lost.
"This requires a scientist, not a motor-cyclist, to cross," I averred,
and, propping Lizzie upon her stand, went to reconnoitre.
I then created a precedent in the art of crossing mud-holes by which
I benefited on all future occasions. I was wearing water-tight field
boots which came up to my knees. The modus operandi was this: I
would select a likely-looking rut and walk along it as far as I could
without the water coming over the top of my boots. If it came over I
went back and tried another one. This process was repeated until I
had a good idea how the land lay. If I could possibly get through
without the mud reaching my knees, I knew I could get Lizzie
through all right. This manner of prospecting in advance I found
indispensable and at the same time perfectly successful.
I got through somehow, but prayed that I should never meet
another like that.
I rolled into Wagonmound about three in the afternoon a very weary
and mud-stained traveller. When I got there, it started to rain; it
naturally would.
There is but one restaurant in Wagonmound, which enjoys a
population of 200 or so Mexican-Americans. Here I learnt that there
had been a "cloud-burst" near Santa Fé but a few days back; also
that the oldest inhabitants of New Mexico had never known so much
rain to fall as this summer; also that the roads ahead were almost
impassable; also that at one place on the other side of Santa Fé and
at a distance of fifty miles between two towns there were one
hundred cars stranded in the mud and abandoned! I was proof
against it all, however. I considered that by now I could get through
anywhere. I was not to be daunted by fancy yarns and sceptical
reports. Time was when I cursed the Americans for being optimistic
about their roads. That stage had long since been passed. Now I
was proof against even their pessimisms and discouragements.
The rain stopped and I proceeded once more, determined to make a
big effort to reach Santa Fé that night, though still ninety miles
away.
At Wagonmound there was a station of the Santa Fé Railway, which
for a good distance ran close to the trail. I inquired at the "Depot"
what were the chances of travelling on the track. I did not want to
try conclusions with any trans-continental trains if avoidable.
"What! Ride in the track!" ejaculated the line-master. "You can't do
that!"
"Oh, I guess I can if I'm careful," was my response.
"Waal, I jest guess you can't, my friend," was his rejoinder. "I'll have
you arrested if you try to work that stunt."
Argument was useless. "D'ye think I want to damage your bloomin'
old track?" I asked him heatedly after much discussion. We settled
the matter finally by my tendering the information that I would ride
up and down his track all day long if I wanted to (not much fear of
such a desire developing!) and if he liked he could "write to John
Bull about it"!
The humour of the situation was lost upon him.
"You'll get shot," was his reply, whereat we parted.
CHAPTER XIV
NEW MEXICO
I set out from Wagonmound with a light heart and a heavy stomach.
The road ran parallel with the rail for a mile, then crossed over by a
level crossing and continued parallel on the other side. I did not get
far. No doubt there had been unusual rain; great fields were now
lakes with the grass bottom not always visible; little streams,
normally no more than the size of a small spring, were now swollen
rivers. These crossed the road in places. The road was fenced in.
And thereby hangs a tale.
After precisely half an hour I found myself just three miles
advanced, and in the midst of a hopeless chaos of sun-dried
emaciated mud. I had "explored every avenue" of the road, but
found none possible of negotiation. Bit by bit I dragged Lizzie back
and returned to the level-crossing. Come what may I would try the
track. Even if the sleepers shook my very bones to powder it would
be better than eternally forging through the mud of New Mexico.
On each side of the road where it crossed the rails the track was
guarded by a satanic device in the form of spikes and knife-edges
skilfully arranged and extending to a distance of several yards. The
function of these was evidently to prevent cattle and other animals
straying on the line. Traversing these was no easy task. If one did
not ride on top of the spikes, one's tyres wedged in between the
knives. Once past, the rest seemed easy. But things are not what
they seem, especially on railroad tracks. The sleepers were not
ballasted and were anything but level. There was no room outside
the track, for it was steeply banked, and the sleepers projected
beyond the rails into space. At every few hundred yards the track
ran over a brick bridge spanning a bog or a stream. The bridge was
just the width of the rails apart. But when it came to riding—ugh! As
every sleeper was passed, the wheels fell momentarily into the
intervening space between it and the next, and a series of sudden,
sharp shocks was hammered through Lizzie's poor frame as each
sleeper in turn was struck by the front wheel. The faster I went the
quicker and smaller were the shocks, and above a certain speed it
was quite tolerable running.
I was just getting up a comfortable speed when I imagined I heard
the whistle of a locomotive behind. This was discouraging and
certainly unexpected. I stopped quickly and looked back. Sure
enough there was a train coming, but it was easily half a mile away.
To go forward in the hope of out-pacing it would be useless. There
was not even room to get off the track, for once I got down the
steep bank, I knew it would be next to impossible to get back again,
or to get anywhere, for that matter.
Neither was there room to turn round and go back.
More than ever before did it appear to me that discretion was better
than valour.
So I commenced to push Lizzie backwards to the level crossing,
prepared to roll sideways over the bank if I found the train got there
first.
I was just beginning to feel sure about winning the race, and judged
that I should get there with a good hundred yards to spare. I
reached the crossing, but as naturally as one would expect, the back
wheel wedged tight between the knives of the cow-guard.
Would she budge? No.
As I struggled and heaved (I could not look on and see Lizzie go
west in such an absurd fashion), the "California Limited" bore down
upon me. Fortunately American trains do not always go so fast as
they might; at any rate, not so fast as one thinks they should when
one is travelling in them.
With a final desperate lunge, Lizzie yielded to my efforts and came
unstuck. No time was lost in getting out of the way. Fifteen seconds
afterwards the train rolled by at a modest thirty. She had evidently
not got properly under way since her stop at Wagonmound.
I returned to the mud-hole like a smacked puppy with its tail
between its legs, and reflected on what might have been.
But it was no use. I stuck again.
This time I was well armed with refreshments. I had bought six
bottles of a ginger-pop concoction from the last village. I carried one
in each pocket and the other two as reserves, only to be used in
case of great emergency, enveloped in the blanket strapped on the
carrier.
I drank one bottle at the close of every engagement with the road.
But after an hour I was still no farther ahead. I reclined on the bank
and waited for something to turn up.
Fact revealed itself stranger than fiction once more. Something
turned up very speedily. It came in the form of a "Marmon" touring
car, bearing a Californian number-plate. I had taken the precaution,
of course, to leave Lizzie in the right spot, so that no disinclined
passer-by could get through if he wanted to. After all, one musn't
rely on everyone playing the Good Samaritan.
The two occupants of the car were courtesy itself. They not only
assisted me in lifting Lizzie over the pièce de résistance, but also
showed considerable interest in me. Out here, where friendship
between motorists is much more marked (almost as a matter of
necessity), there is seldom any need for anxiety, and it is remarkable
how potent a thing is this roadside courtesy. Practically every town I
stopped at afterwards had heard of the strange traveller who was
Welcome to Our Bookstore - The Ultimate Destination for Book Lovers
Are you passionate about testbank and eager to explore new worlds of
knowledge? At our website, we offer a vast collection of books that
cater to every interest and age group. From classic literature to
specialized publications, self-help books, and children’s stories, we
have it all! Each book is a gateway to new adventures, helping you
expand your knowledge and nourish your soul
Experience Convenient and Enjoyable Book Shopping Our website is more
than just an online bookstore—it’s a bridge connecting readers to the
timeless values of culture and wisdom. With a sleek and user-friendly
interface and a smart search system, you can find your favorite books
quickly and easily. Enjoy special promotions, fast home delivery, and
a seamless shopping experience that saves you time and enhances your
love for reading.
Let us accompany you on the journey of exploring knowledge and
personal growth!
ebooksecure.com