SlideShare a Scribd company logo
Absolute Java 5th Edition Walter Savitch
Solutions Manual download
https://testbankfan.com/product/absolute-java-5th-edition-walter-
savitch-solutions-manual/
Find test banks or solution manuals at testbankfan.com today!
We have selected some products that you may be interested in
Click the link to download now or visit testbankfan.com
for more options!.
Absolute Java 5th Edition Walter Savitch Test Bank
https://testbankfan.com/product/absolute-java-5th-edition-walter-
savitch-test-bank/
Absolute Java 6th Edition Savitch Test Bank
https://testbankfan.com/product/absolute-java-6th-edition-savitch-
test-bank/
Absolute C++ 5th Edition Savitch Solutions Manual
https://testbankfan.com/product/absolute-c-5th-edition-savitch-
solutions-manual/
Emergency Care in Athletic Training 1st Edition Grose Test
Bank
https://testbankfan.com/product/emergency-care-in-athletic-
training-1st-edition-grose-test-bank/
Management 1st Edition Neck Test Bank
https://testbankfan.com/product/management-1st-edition-neck-test-bank/
Intercultural Communication A Contextual Approach 7th
Edition Neuliep Test Bank
https://testbankfan.com/product/intercultural-communication-a-
contextual-approach-7th-edition-neuliep-test-bank/
MR 2 2nd Edition Brown Test Bank
https://testbankfan.com/product/mr-2-2nd-edition-brown-test-bank/
Labor Relations and Collective Bargaining 9th Edition
Carrell Test Bank
https://testbankfan.com/product/labor-relations-and-collective-
bargaining-9th-edition-carrell-test-bank/
Systems Analysis and Design 10th Edition Kendall Solutions
Manual
https://testbankfan.com/product/systems-analysis-and-design-10th-
edition-kendall-solutions-manual/
Concepts of Genetics Books a la Carte Edition 11th Edition
Klug Test Bank
https://testbankfan.com/product/concepts-of-genetics-books-a-la-carte-
edition-11th-edition-klug-test-bank/
Savitch, Absolute Java 5/e: Chapter 10, Instructor’s Manual
Copyright © 2012 Pearson Education Addison-Wesley. All rights reserved.
Chapter 10
File I/O
Key Terms
stream
input stream
output stream
System.out
System.in
text file
ASCII file
binary file
PrintWriter
java.io
opening a file
FileOutputStream
file name
reading the file name
FileNotFoundException
println, print, and printf
buffered
buffer
appending
opening a file
BufferedReader
opening a file
readLine
read method
path names
using . . or /
redirecting output
abstract name
opening a file
writeInt
writeChar
writeUTF for Strings
closing a binary file
reading multiple types
closing a binary files
EOFException
Serializable interface
writeObject
readObject
Serializable
class instance variable
Savitch, Absolute Java 5/e: Chapter 10, Instructor’s Manual
Copyright © 2012 Pearson Education Addison-Wesley. All rights reserved.
file pointer
opening a file
Brief Outline
10.1 Introduction to File I/O
Streams
Text Files and Binary Files
10.2 Text Files
Writing to a Text File
Appending to a Text File
Reading from a Text File
Reading a Text File Using Scanner
Testing for the End of a Text File with Scanner
Reading a Text File Using BufferedReader
Testing for the End of a Text File with BufferedReader
Path Names
Nested Constructor Invocations
System.in, System.out, System.err
10.3 The File Class
Programming with the File Class
10.4 Binary Files
Writing Simple Data to a Binary File
UTF and writeUTF
Reading Simple Data from a Binary File
Checking for the End of a Binary File
Binary I/O of Objects
The Serializable Interface
Array Objects in Binary Files
10.5 Random Access to Binary Files
Reading and Writing to the Same File
Teaching Suggestions
This chapter discusses using files for reading and writing information. The first sections deal
with text files and inputting and outputting information using just text. This is accomplished in
Java using streams. Reading from a file and reading from the console are actually not that much
different because both are treated as streams.
With the introduction of the Scanner class in Java 5, there is another new way to process files
and this chapter discusses both the use of BufferedReader and Scanner.
The last two sections of the chapter are optional and discuss how to use binary files and read and
write entire objects to a file. These sections introduce the Serializable interface for allowing the
reading and writing of objects.
Savitch, Absolute Java 5/e: Chapter 10, Instructor’s Manual
Copyright © 2012 Pearson Education Addison-Wesley. All rights reserved.
Key Points
Streams. Streams are flows of date. There are input streams and output streams. Streams are
the method used for console I/O as well as file I/O.
Text Files Versus Binary Files. Text files are those which are written with an editor and use
characters that are commonly recognizable to humans. Binary files are those that are easily read
by the machine. A type of file that would be a binary file are the .class files that are generated
when we compile a .java file.
Opening a Text File for Writing Output. You create a PrintWriter to write to a file using the
methods print and println. You must tell the PrintWriter what the name of the file is that you
will be writing to. If the file can not be found, a FileNotFoundException will be thrown.
File Names. The name of a file on the system is dictated by the system, not by Java. Therefore,
the name of the file is the name of the file on the system.
A File has Two Names. In the program, you connect the stream to the file and use its name on
the system. The stream itself has a name and that is the name you use when writing to the file
within your program.
IOException. This is the base class for all exceptions dealing with input and output errors.
Closing a Text File. It is important that when you are done with a stream, that you close the
stream using the close method.
Opening a Text File for Appending. You can open file for writing and append text to the end as
opposed to overwriting the information by adding the parameter true to the creation of the
FileOutputStream that is created when creating the PrintWriter.
Opening a Text File for Reading with Scanner. If you open a file for reading with Scanner, you
can use the methods of the scanner just like when you were reading from console input, nextInt,
nextLine, etc.
FileNotFoundException. This exception is thrown when a file that the system requests is not
present on the system. It is a type of IOException and will appear when doing File I/O.
Checking for the End of a Text File with Scanner. The methods of the Scanner help to see when
the input from the file is finished.
Unchecked Exceptions. There are many unchecked exceptions that can occur while reading and
writing to a file. These include the NoSuchElementException, InputMismathException, and
IllegalStatementException.
Opening a Text File for Reading with BufferedReader. Using the BufferedReader to read from a
file, you can then use the readLine and read methods to retrieve the information.
Savitch, Absolute Java 5/e: Chapter 10, Instructor’s Manual
Copyright © 2012 Pearson Education Addison-Wesley. All rights reserved.
Checking for the End of a Text File with BufferedReader. readLine returns null when it tries to
read beyond the end of the file, and read returns -1 if it goes beyond the end of the file.
The File Class. There is a class defined in Java to represent a file. Creating an instance of this
class will help determine whether a file exists and if the program has read/write access to the file.
Opening a Binary File for Output. Writing to a binary file requires an ObjectOutputStream and
you can use any of its multiple write methods to write information to the file.
Opening a Binary File for Reading. You use a ObjectInputStream to read information from a
binary file. There are also multiple read methods to help read the information from the file.
EOFException. If you read beyond the end of the file, this exception will be thrown and can be
used in a loop to help determine when you have reached the end of the file.
Tips
toString Helps with Text File Output. The methods print and println in a PrintWriter work like
System.out.print and System.out.println. If you give an object as a parameter, they will
automatically call the toString method on that object. Another good reason to always have a
toString in the objects you create.
Reading Numbers with BufferedReader. Reading from a file gives the information as a String.
To convert a String from a file into a number, you must use the method Integer.parseInt or
similar methods to convert the string to the number.
Pitfalls
A try Block is a Block. This pitfall discusses the fact that declaring a variable inside the block
makes the variable local to the block and not accessible outside of the block. This is important
when creating streams.
Overwriting an Output File. When you create a PrintWriter for a file, you will destroy a file on
the system with the same name if one exists. All of the information in that file will be lost. If a
file by that name does not exist, it will be created.
Checking for the End of a File in the Wrong Way. If you are looking for the end of the file
marker in the wrong way, chances are your program will generate an error or go into an infinite
loop. It is important to remember that the EOFException will be generated if using a binary file
and a character like null will be read if at the end of a text file.
Mixing Class Types in the Same File. You do not want to mix class types within the same binary
file. It is best to only store items of the same class or primitive type in a file and not to mix the
two.
Savitch, Absolute Java 5/e: Chapter 10, Instructor’s Manual
Copyright © 2012 Pearson Education Addison-Wesley. All rights reserved.
A RandomAccessFile Need Not Start Empty. When a file is opened in this way, the file is not
erased, but rather the file pointer is set to the beginning of the file, not always the best place for
writing, but usually the better place for reading from the file.
Programming Projects Answers
1.
/**
* Question1Names.java
*
* This program reads through a list of names and finds
* the most popular boys and girls names.
*
* Created: Sat Mar 19 2005
*
* @author Kenrick Mock
* @version 1
*/
import java.io.FileInputStream;
import java.io.IOException;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class Question1Names
{
public static final int NUMNAMES = 1000; // Number of names in the file
/**
* isInArray
* Searches the string array for target.
* It returns the index of the matching name. If no match
* is found, then -1 is returned.
*
* This algorithm uses a simple linear search.
* A much more efficient method is binary search,
* which can be used since the array is sorted.
* Binary search is covered in chapter 11.
*
* @param names Array of names to search
* @param target String target we are searching for
* @return int Index of matching position, -1 if no match found.
*/
public static int isInArray(String[] names, String target)
Savitch, Absolute Java 5/e: Chapter 10, Instructor’s Manual
Copyright © 2012 Pearson Education Addison-Wesley. All rights reserved.
{
int i;
// Scan through all strings for a match.
// Since the arrays are not sorted, we can't use
// binary search or other search optimizations.
for (i=0; (i<NUMNAMES); i++)
{
if (names[i].equals(target)) return i;
}
return -1;
}
/**
* LoadFile reads from the specified filename into the arrays
* for the names and count of occurrences of that name.
*
* @param names String array where to store the names from the file
* @param count int array where to store the count numbers from the file
* @param filename String holding the name of the file to open
*/
public static void LoadFile(String[] names, int[] count, String filename)
{
// Read the entire file into an array so it can be searched.
Scanner inputStream = null;
int i;
try
{
inputStream = new Scanner(new FileInputStream(filename));
for (i=0; i< NUMNAMES; i++)
{
String line = inputStream.nextLine();
// Parse out first name and number
int space = line.indexOf(" ",0);
String first = line.substring(0,space);
String number = line.substring(space+1);
// Store values in arrays
// Convert name to lowercase to avoid case sensitivity
names[i] = first.toLowerCase();
count[i] = Integer.parseInt(number);
}
inputStream.close();
}
catch (FileNotFoundException e)
{
Savitch, Absolute Java 5/e: Chapter 10, Instructor’s Manual
Copyright © 2012 Pearson Education Addison-Wesley. All rights reserved.
System.out.println ("File not found!");
System.exit (0);
}
catch (IOException e)
{
System.out.println("Error reading from file.");
System.exit(0);
}
}
/**
* Main method
*/
public static void main(String[] args)
{
int i;
String name;
String[] boyNames = new String[NUMNAMES]; // Array of boy names
String[] girlNames = new String[NUMNAMES]; // Array of girl names
int[] boyCount = new int[NUMNAMES]; // Array of number of names for boys
int[] girlCount = new int[NUMNAMES]; // Array of number of names for girls
// e.g. boyCount[0] is how many
// namings of boyNames[0]
// A more OO design would be to create a class
// that encapsulates both a name and count
// than to have two separate arrays.
// Load files into arrays
LoadFile(boyNames, boyCount, "boynames.txt");
LoadFile(girlNames, girlCount, "girlnames.txt");
// Input the target name and search through the arrays for a match
System.out.println("Enter name: ");
Scanner scan = new Scanner(System.in);
name = scan.nextLine();
String lowerName = name.toLowerCase();
// First look through girls
i = isInArray(girlNames, lowerName);
if (i>=0)
{
System.out.println(name + " is ranked " + (i+1) + " in popularity " +
"among girls with " + girlCount[i] + " namings.");
}
else
Savitch, Absolute Java 5/e: Chapter 10, Instructor’s Manual
Copyright © 2012 Pearson Education Addison-Wesley. All rights reserved.
{
System.out.println(name + " is not ranked among the top 1000 girl names. ");
}
// Repeat for boys
i = isInArray(boyNames, lowerName);
if (i>=0)
{
System.out.println(name + " is ranked " + (i+1) + " in popularity " +
"among boys with " + boyCount[i] + " namings.");
}
else
{
System.out.println(name + " is not ranked among the top 1000 boy names. ");
}
}
} // Question1Names
2.
/**
* Question2Text.java
*
* Created: Fri Jan 09 20:08:09 2004
* Modified: Sun Mar 20 2005, Kenrick Mock
*
* @author Adrienne Decker
* @version
*/
import java.io.FileReader;
import java.io.IOException;
import java.io.FileInputStream;
import java.util.Scanner;
public class Question2 {
public static void main(String[] args){
int min = 0;
int max = 0;
int temp;
try {
Savitch, Absolute Java 5/e: Chapter 10, Instructor’s Manual
Copyright © 2012 Pearson Education Addison-Wesley. All rights reserved.
Scanner inputStream = new Scanner(new
FileInputStream("Question2.txt"));
// File must have at least one integer
// to operate properly
if (inputStream.hasNextInt())
{
min = inputStream.nextInt();
max = min;
}
while (inputStream.hasNextInt())
{
temp = inputStream.nextInt();
if (temp < min) {
min = temp;
} // end of if ()
if (temp > max)
{
max = temp;
} // end of if ()
}
inputStream.close();
System.out.println("Minimum value read: " + min);
System.out.println("Maximum value read: " + max);
}
catch (IOException e)
{
System.out.println("Error reading from Question1.txt");
}
}
} // Question2
3.
/**
* Question3.java
*
* Created: Fri Jan 09 20:08:16 2004
* Modified: Sun Mar 20 2005, Kenrick Mock
*
* @author Adrienne Decker
* @version
*/
import java.io.FileReader;
Savitch, Absolute Java 5/e: Chapter 10, Instructor’s Manual
Copyright © 2012 Pearson Education Addison-Wesley. All rights reserved.
import java.io.IOException;
import java.io.FileInputStream;
import java.util.Scanner;
public class Question3
{
public static void main(String[] args){
int count = 0;
double sum = 0.0;
try {
Scanner inputStream = new Scanner(new
FileInputStream("Question3.txt"));
// File must have at least one value
// to operate properly
if (inputStream.hasNextDouble())
{
count = 1;
sum = inputStream.nextDouble();
}
while (inputStream.hasNextDouble())
{
sum += inputStream.nextDouble();
count++;
}
inputStream.close();
System.out.println("Average: " + sum/count);
}
catch (IOException e)
{
System.out.println("Error reading from Question3.txt");
}
}
} // Question3
4.
/**
* Question4.java
*
* Created: Fri Jan 09 20:08:21 2004
* Modified: Sun Mar 20 2005, Kenrick Mock
*
Savitch, Absolute Java 5/e: Chapter 10, Instructor’s Manual
Copyright © 2012 Pearson Education Addison-Wesley. All rights reserved.
* @author Adrienne Decker
* @version 2
*/
import java.io.FileReader;
import java.io.IOException;
import java.io.FileInputStream;
import java.util.Scanner;
public class Question4
{
public static void main(String[] args) {
int count = 0;
double temp = 0.0;
double sum = 0.0;
double avg = 0.0;
try {
Scanner inputStream = new Scanner(new
FileInputStream("Question4.txt"));
// File must have at least one value
// to operate properly
if (inputStream.hasNextDouble())
{
count = 1;
sum = inputStream.nextDouble();
}
while (inputStream.hasNextDouble())
{
sum += inputStream.nextDouble();
count++;
}
inputStream.close();
avg = sum / count;
// Open again and calculate standard deviation
inputStream = new Scanner(new
FileInputStream("Question4.txt"));
sum = count = 0;
while (inputStream.hasNextDouble())
{
double val = inputStream.nextDouble();
sum += Math.pow(val - avg, 2.0);
count++;
Savitch, Absolute Java 5/e: Chapter 10, Instructor’s Manual
Copyright © 2012 Pearson Education Addison-Wesley. All rights reserved.
}
inputStream.close();
System.out.println("Standard Deviation: " + Math.sqrt(sum/count));
}
catch (IOException e)
{
System.out.println("Error reading from Question4.txt");
}
}
} // Question4
5.
/**
* Question5.java
*
* Created: Fri Jan 09 20:08:26 2004
* Modified: Sun Mar 20 2005, Kenrick Mock
*
* @author Adrienne Decker
* @version 2
*/
import java.io.FileInputStream;
import java.util.Scanner;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.util.NoSuchElementException;
public class Question5 {
public static void main(String[] args){
try
{
String word = "";
String tempFile = "TempX";
while (true) {
Savitch, Absolute Java 5/e: Chapter 10, Instructor’s Manual
Copyright © 2012 Pearson Education Addison-Wesley. All rights reserved.
File fileObject = new File(tempFile);
if (fileObject.exists())
{
tempFile = tempFile + "X";
} // end of if ()
else
{
break;
} // end of else
} // end of while ()
Scanner keyboard = new Scanner(System.in);
System.out.println("Enter filename of file to remove blanks:");
String fileInput = keyboard.nextLine();
Scanner inputStream = new Scanner(new
FileInputStream(fileInput));
PrintWriter outputStream = new PrintWriter(new
FileOutputStream(tempFile));
String line;
while (inputStream.hasNextLine()) {
line = inputStream.nextLine();
StringTokenizer st = new StringTokenizer(line, " ");
while (st.hasMoreTokens()) {
word = st.nextToken();
if (st.hasMoreTokens())
outputStream.print(word + " ");
else
outputStream.println(word);
} // end of while ()
}
inputStream.close();
outputStream.close();
inputStream = new Scanner(new
FileInputStream(tempFile));
outputStream = new PrintWriter(new
FileOutputStream(fileInput));
while (inputStream.hasNextLine())
{
line = inputStream.nextLine();
outputStream.println(line);
Savitch, Absolute Java 5/e: Chapter 10, Instructor’s Manual
Copyright © 2012 Pearson Education Addison-Wesley. All rights reserved.
}
inputStream.close();
outputStream.close();
File fileObject = new File(tempFile);
fileObject.delete();
}
catch (IOException e)
{
System.out.println("Error reading or writing files.");
}
}
} // Question5
Text Project 6.
/**
* Question6.java
*
* Created: Fri Jan 09 20:08:32 2004
* Modified: Sun Mar 20 2005, Kenrick Mock
*
* @author Adrienne Decker
* @version 2
*/
import java.io.FileInputStream;
import java.util.Scanner;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.PrintWriter;
public class Question6 {
public static void main(String[] args){
try {
Scanner inputStream = new Scanner(new
FileInputStream("advice.txt"));
String line;
while (inputStream.hasNextLine())
{
Savitch, Absolute Java 5/e: Chapter 10, Instructor’s Manual
Copyright © 2012 Pearson Education Addison-Wesley. All rights reserved.
line = inputStream.nextLine();
System.out.println(line);
}
inputStream.close();
Scanner keyboard = new Scanner(System.in);
System.out.println("Enter advice (hit return on empty line to quit):");
PrintWriter outputStream = new PrintWriter(new
FileOutputStream("advice.txt"));
line = keyboard.nextLine();
while (!line.equals(""))
{
outputStream.println(line);
line = keyboard.nextLine();
}
outputStream.close();
}
catch (IOException e)
{
System.out.println("Error reading or writing files.");
}
}
} // Question6
7.
No solution given
8.
No solution given (see question 9 below, substitute int for double)
9.
/**
* Question9.java
*
*
* Created: Fri Jan 09 20:08:41 2004
*
* @author Adrienne Decker
Random documents with unrelated
content Scribd suggests to you:
CHAPTER VIII.
A D A S H F O R F R E E D O M .
Considering the circumstances, Buffalo Bill’s manœuvre was
audacious in the extreme. Overawing the barons and treating them
in such a high-handed manner, right on their own ground, was a
reckless proceeding. It needed a man of resource and determination
like the scout to carry it through to a success.
Buffalo Bill, however, although he had acted on the spur of the
moment, was not blind to the dangers that surrounded him. He was
lightning quick in probing chances and forecasting probabilities.
There were two things he wanted to do. One was to snatch Perry
out of that camp of enemies; and the other was to discover what
had become of Perry’s daughter.
Moving quickly to the door, Buffalo Bill looked over the
surroundings of the cabin. The four cowboys were still smoking and
talking under the trees. In the other direction, cowboys were
catching up horses out of the corral, saddling and riding away to
their places on the range.
No one outside the cabin seemed to know or care what was
happening to the cattle barons.
Mightily relieved, the scout whirled away from the open door. As
he did so, there was a crash that shook the cabin floor. The two
barons, in their struggles to free their feet of the encircling noose,
had toppled over and fallen.
Secured to each other as they were, they were in a sorry plight.
Buffalo Bill hurried to them and adjusted their arms so that they
would be more comfortable.
“Stop your struggling,” said he, “and you’ll be a whole lot better
off.”
“What do you mean by making an attack on me, right on my own
ground?” asked Phelps.
“That’s where we begin to talk business, Phelps,” said the scout.
“The prisoner you have in this room is Dick Perry?”
“Yes, that’s my name,” spoke up the prisoner.
In some manner Perry had freed himself of his gag and was able
to talk.
Keeping a wary eye on the barons, Buffalo Bill backed over to
Perry and pulled the stick from under his knees. Perry at once arose
to his feet and slipped his hands out of the coils at his wrists.
“I owe you a debt of gratitude for this,” said he; “a debt that I
——”
“Never mind that now, Perry,” interrupted the scout. “We’re not
out of the woods yet by a long shot. Is your daughter here, at
Phelps’ ranch?”
A wild look crossed Perry’s face.
“My daughter?” he returned. “Good heavens! You don’t mean to
say that she—that these scoundrels have——”
“You’re in the dark, I see, Perry,” cut in the scout, “so the chances
are that your daughter isn’t here. She was taken away from the
ranch some time last night.”
Perry grabbed up a chair and started toward the two men on the
floor. The scout caught him by the shoulders.
“Careful!” he warned. “A move like that won’t help us any. Don’t
lose heart—we’ll find the girl.”
The scout went back to the cattle barons.
“Watch the lay of the land outside, Perry,” said the scout. “If you
see any one coming this way, let me know at once.”
Perry put down the chair and cautiously took up a position by the
open door.
“You’ve got the bulge on us, Buffalo Bill,” said Benner. “Take these
confounded manacles off our hands.”
“They belong to you,” returned the scout, “and I reckon I’ll let you
keep them. Those are the handcuffs that the clerk of the hotel said
he had put in your saddlebags. The clerk put them in the wrong
saddlebags, that’s all. Why did you want two pairs?”
“That’s our business,” snapped Phelps. “You’re playing a mighty
reckless game, Buffalo Bill, and you’ve about one chance in a
thousand to win out. You may be able to get away from this ranch,
but the Brazos country isn’t big enough to hide you from the men
Benner and I will put on your trail.”
“I’ll take care of that part of it. You fellows would have more
success in your deviltry if you’d quit passing notes back and forth
and hiding them in your watch cases.”
Both barons swore.
“Confound it, Phelps,” gurgled Benner, “that was your fault.”
“Oh, yes,” snorted Phelps, “whenever you make a misplay it’s my
fault! When I gave you that information I couldn’t talk it, so I had to
write.”
“And I wasn’t able to read it then, and so I had to put it in my
watch and read it later. But you could have waited. We’d have had
plenty of chance to talk privately before we left Hackamore. That’s
where you was lame. You didn’t wait.”
“And where was you lame?” taunted Phelps. “Making that bet to
throw watches. Why didn’t you think of what was in that watch of
yours, hey? You——”
“That’s enough,” interrupted the scout. “Save your bickering until
Perry and I get away. Benner, what have you done with Hattie
Perry?”
“I don’t know anything about Hattie Perry,” answered Benner
sulkily.
“Yes, you do. You’re talking crooked, when you say that; I can see
it in your face. Where is the girl? If you know when you’re well off,
you’ll tell me, and not make any bones about it.”
“Who’re you, anyhow?” flashed Benner. “You may amount to
something in your own neck of the woods, but you don’t cut much
of a caper here on the Brazos. This is our ground, this is! When
Perry sees his daughter next, she’ll be Mrs. Benner.”
Fortunately, Perry didn’t hear Benner’s remark.
“You’ll have another guess coming about that,” said the scout.
“You’re about as contemptible a cur, Lige Benner, as a man could
find in a month’s travel. You two men have a chance, here and now,
to do the right thing and square yourselves. Tell me where Miss
Perry is, and agree to return all the Star-A cattle you’ve rustled and
leave Perry and Dunbar alone in future, and we’ll call this account
settled. It will be mighty small payment for you scoundrels to make.
Hang out against my proposition, and I’ll camp down on the Brazos
until I’ve run you men to cover.”
“That’s big talk,” taunted Phelps.
“The way I’ve handled you this morning is a sample of the way I
and my pards do things. If you want any more samples, you’ll find
us ready to produce. What have you to say?”
“Be hanged to you,” snarled Benner. “You’re a long ways from
being out of this yet. You——”
“Buffalo Bill!” called Perry from the door.
As the scout looked, Perry motioned frantically; and the scout ran
to the door, the two cattle barons began to yell for help.
“That settles it,” muttered the scout; “it’s neck or nothing with us,
Perry. That’s my horse—the black at the end of the hitching-pole.
You annex the one hitched alongside. Sharp’s the word!”
Together they sprang through the door. Cowboys seemed to be
coming from every direction, on foot and on horseback. The four
who had been smoking under the tree were the ones who had
caused Perry’s alarm. They had started toward the house in a body.
Whether they were merely curious, or whether they had heard
something which had aroused their suspicions, the scout never
knew. Be that as it might, when the scout and Perry leaped through
the door, the four men were almost upon them.
“Stop those fellows!” yelled Benner from inside the house.
There was small need of any urging on the part of the cattle
barons. Benner’s cowboys, seeing Perry free and hurrying away with
the man who had recently arrived on the black horse, suspected at
once that a rescue had been effected.
The four cowboys hurled themselves at the scout and Perry.
Benner’s men met with a surprise that literally carried two of them
off their feet—a right-hander from the scout did the trick for one,
and a straight-out blow by Perry dropped the other.
The remaining two made an attempt to snatch their guns from
their belts. The fugitives, however, took advantage of the attempt to
use their fists again. The last pair were bowled over, and the scout
and Perry jumped for their horses.
To tear the animals free of the hitching-pole required only a
moment, but every moment was precious. The gathering minions of
the barons were almost in front of the log house as the escaping
men jumped to their saddles.
“Follow me, Perry!” shouted the scout, laying a course up the
slope in the direction of the place where he had left his friends.
Wild Bill, Nomad, and Dunbar could be seen descending the slope,
their horses at top speed, to cover their pard’s retreat with Perry.
Revolvers began to crack spitefully and leaden bees hissed
through the air. The excitement of the moment, and the receding
targets, caused every bullet to go wild.
The fusillade was returned from up the slope, and the mounted
cowboys who had taken up the pursuit, drew wary rein to make out
the number and disposition of the enemies up the “rise.” And while
they were hesitating and making their calculations, Buffalo Bill and
Perry were pounding along and making good in their dash for
freedom.
“Whoop-ya!” roared old Nomad, while the scout and Perry drew
closer up the slope, “le’s tear through ther tin-horn camp, pards, an’
raise Cain with a big ‘K!’ Le’s cut loose an’ show ’em our own
partic’ler brand o’ destruction! Le’s give ’em er taste o’——”
“Head the other way, quick!” shouted the scout, as he and Perry
came thundering up. “Heels are trumps, pards, and see how quick
you can play ’em.”
Nomad yielded. When the scout ordered a move contrary to
Nomad’s desires, he always yielded.
In a galloping crowd, Dunbar, Wild Bill, Nomad, the scout and
Perry swept over the top of the “rise” and into the scrub. Here they
were joined by Jordan and Little Cayuse, and they skimmed the
earth like a flock of low-flying birds.
There was no time for talk, no time for anything but an occasional
look behind and a frantic urging of the horses.
Eight, nine, ten—a dozen mounted men flickered over the crest of
the slope and settled themselves for what they evidently thought
was to be a long chase.
“Twelve up!” shouted the Laramie man.
“Not so many, oh, not so many!” roared the old trapper. “We’re
six! What’s two ter one? Waugh! Give ther word, Buffler, an’ we’ll
turn on ’em.”
But the scout did not give the word. There might be no more than
twelve in sight, but under the “rise” were enough cowboys to literally
overwhelm the scout’s small party.
On went the race. Perry and Dunbar led the fugitives down into
the timber, and there, where the scrub was thickest, there followed
an exciting game of hare and hounds.
Knowing the country well, Perry and Dunbar were able to take
advantage of every friendly swale and shallow seam in the river
bottom. In brushy coverts the fugitives waited for the dozen
cowboys to rush past, then they doubled back, crossed the river,
followed up the opposite bank, recrossed and paused for breath in a
coulee.
“Sufferin’ reptyles!” mourned old Nomad, slapping Hide-rack’s
sweaty neck, “thet’s new bizness fer We, Us an’ Comp’ny, dodgin’
trouble thet-a-way. I hope I’ll forgive myself some time fer doin’ et.”
“You’d have had to forgive yourself for not doing it, Nick,” returned
the scout, dismounting to loosen his saddle cinches, “if we’d taken
any other course. How many cowboys has Phelps got in his outfit,
Perry?”
“He can muster thirty men, I guess, without much trouble,”
answered Perry.
“All of that,” seconded Dunbar.
“It is well we took to our heels, friends,” spoke up the sky pilot. “If
any blood had been shed, it would have been a blot on our
consciences.”
“Ef we took on er few blots,” said Nomad, “I reckon we’d crimp
them barons an’ save future trouble fer Perry.”
Cayuse, thoughtful as ever, had left Navi in the bottom of the
coulee and crept up the bank to watch for enemies. Lying on the
slope, only his head and the upright eagle plume in his scalplock
showed over the crest.
All had dismounted and loosened cinches in order to give their
panting horses more freedom in using their lungs.
“Dick,” said the sky pilot, reaching out his hand to the harassed
rancher, “I’m sorry you are having this trouble, but I always feared it
would come to something like this.”
“There was nothing I could do to help it, parson,” answered Perry,
“short of leaving the country. I couldn’t do that, with all I’ve got in
the world tied up at the Star-A.”
“It is my hope, my prayer, that you will be tided over your
difficulties. If that can be accomplished, these good friends will see
to it, I’m sure.”
“I’m obliged to Buffalo Bill and his pards. How they came to be
mixed up in my troubles is more than I know. I want to know all
about it, but first, tell me about Hattie. How do you know she has
been taken away by Lige Benner? When did it happen?”
“Last night, Dick,” answered Dunbar heavily.
“Where were you yesterday, Nate?”
“Captured by some of Benner’s men while I was out looking for
strays, turned over to Red Steve, then found and released by Buffalo
Bill. That was in the first half of the night. The scout and I rode to
the ranch and found everything in the living room in disorder—and
Hattie gone.”
A groan was wrenched from Perry’s lips.
“Has it come to this,” he cried, “that these scoundrels must make
war on women?”
His tortured soul found vent in language that shocked the
minister’s ears.
“Peace, friend,” said Jordan. “You have much to be thankful for.
You are not yourself. Try to be composed.”
“How did you fall into the hands of Phelps?” asked the scout, more
to get the rancher’s mind to running in another channel than
anything else.
“I went looking for Nate,” was the answer, “and some of Phelps’
men roped me in the timber. The noose dropped before I could
avoid it, and I was jerked from the back of my horse. They took me
to the H-P ranch yesterday noon, and Phelps went to Hackamore to
see Benner, report, and get him to send after me. Benner rode over
this morning with an escort of cowboys. The plan was to take me to
Benner’s ranch, but Phelps and Benner got to drinking and, before
we started, Buffalo Bill came.”
Perry turned on the scout, his eyes wide with wonder.
“Buffalo Bill,” said he, “if any one had told me that it was possible
for a man to do what you did at Phelps’ this morning I would not
have believed it. In all my life I never saw such a nervy piece of
work.”
Old Nomad began to chuckle.
“It won’t be long, amigos,” he remarked, “afore these hyar cattle
barons o’ ther Brazos’ll begin ter git acquainted with Buffler Bill.
None o’ Buffler’s pards stack up ter his level, but, ef I do say et, I
reckon we reach purty middlin’ high.”
“What did you do, pard?” asked Wild Bill.
“I corrected the mistake which the clerk at the hotel made last
evening,” laughed the scout.
“Meaning which?”
“Why, I gave Benner the handcuffs.”
“With his revolver,” put in Perry, “he forced the two cattle barons
to stand back to back, and then he handcuffed their wrists together.
He finished the work by putting the noose of a riata around their
feet. And that’s the way we left them!”
“I came away,” added Buffalo Bill, “and forgot to leave the key to
the bracelets, so——”
Old Nomad was a minute or two grasping the situation the scout
had caused in Phelps’ cabin. Just at this point it broke over him, and
he leaned against Hide-rack and bellowed with mirth.
“Say,” he sputtered, “this hyar reminds me some o’ ther way
Buffler went inter the Sioux kentry an’ took ole Lightnin’-thet-strikes
right out from ther middle o’ his band. Waugh! Er-waugh! An’ our
pard left them fellers back ter back, handcuffed ter each other, an’
with their men thicker eround ’em than what fleas is in ole Siskiyou
county! I’d like ter lay off fer a hull day an’ enjoy thinkin’ erbout
thet. I would so!”
“That was just my kind of a play,” commented Wild Bill regretfully.
“Wish I could have been in on it myself.”
“Let me know, Buffalo Bill,” requested Perry, “how you knew I was
at the H-P ranch? Phelps was trying to keep that quiet.”
The scout explained in a few words.
“Certainly,” murmured Perry, “I ought to be thankful that I have
friends like you and your pards to lend me a helping hand at this
critical time. Every man on the Brazos seems to have been against
Dunbar and me!”
“Not every man, Dick,” protested Jordan. “Only Benner and Phelps
are really against you. The rest of the cattlemen are so completely
dominated by Benner and Phelps that they don’t dare take sides
with you openly.”
“We know the stake Benner is playing for,” said Wild Bill, “but what
does Phelps hope to make out of this rascally work?”
“For one thing,” replied Perry, “Phelps wants the Star-A range. He
tried to buy out the man who sold to me. Maybe it would have been
better if I had gone elsewhere for a location and let Phelps have the
Star-A range. We can never tell about these things until it’s too late.”
“Then, too,” spoke up Jordan, “Phelps is a bosom friend of
Benner’s. That’s the principal reason, I suppose, why he’s taking a
part in this rascally work. But prosperity is back of it all—too much
prosperity for men who do not understand how to make the best use
of their wealth.”
“Isn’t there something we can do for Hattie?” asked Perry
tremulously. “Must we stay cooped up in this coulee, guarding
against an attack from the H-P outfit, while my girl is in the hands of
that scoundrel, Benner?”
“We’re going to do something for Miss Perry, amigo,” returned the
scout, “and we’ll start the ball to rolling just as soon as we can
decide what’s to be done. If your daughter had been at the H-P
ranch, you’d have discovered it, I think. And I don’t believe Benner
would have her taken to his place. Is there any one else besides Red
Steve on whom Benner could depend for help in dealing with Miss
Perry?”
“There’s Fritz Dinkelmann,” suggested Dunbar. “That Dutchman
and his wife owe Benner money, and while I think Fritz is as honest
as the usual run of men, still, being in debt head over ears to Benner
he might be forced to——”
“Dinkelmann, Dinkelmann!” muttered Wild Bill. “Say, Nick, wasn’t
that the Dutchman our Dutch pard went to see? Wasn’t it
Dinkelmann who——”
A call came from Cayuse. As he shouted, he beckoned those
below to come up the slope and see with their own eyes something
he had discovered.
What the pards saw, peering over the crest of the coulee bank,
sent the hot blood pounding through their veins.
“It’s the baron—our Dutch pard!” shouted Wild Bill; “the fellow we
were just talking about, Perry!”
“There’s a woman with him,” faltered Perry; “can it be—on my
soul, I think it is——”
“Yes,” breathed Dunbar hoarsely, “it’s Hattie, Dick! I can see her
plain. An’ behind the two are a score or two of cowboys from
Benner’s ranch, and from the H-P outfit. They outnumber us, but
we’ve got to do something! We can’t stand here like this.”
Dunbar whirled around and rushed stumbling down the slope
toward the horses.
“How Benner and Phelps ever got out of those come-alongs so
quick is more than I know,” muttered the scout, “but they’re leading
those cowboys in the pursuit of the baron and the girl. Spurs and
quirts, pards! We’re company front with one of the hardest jobs we
ever tackled, but, as Dunbar says, we’ve got to make a move.”
No second urging was needed. Every one followed Dunbar down
the slope, cinches were swiftly tightened, and the whole party
mounted and rode away to the help of the baron and the girl.
CHAPTER IX.
D U TC H C O U R A G E .
It has been said early in this chronicle, that Chance made a triple
blunder. In one corner of the triangle was Buffalo Bill, dropping
through the roof of Red Steve’s dugout and effecting the release of
Nate Dunbar; in another corner was Wild Bill, watching a queer
contest of watch throwing and finding a scrap of paper which
ultimately led to the relief of Dick Perry; and in the third corner was
Villum von Schnitzenhauser, lured from the rest of his pards by the
prospect of a talkfest with Fritz Dinkelmann.
The baron had heard of Fritz Dinkelmann at the house of a small
rancher where he, and Wild Bill, and old Nomad, and Little Cayuse
had halted for an hour on their journey toward Hackamore. The
rancher had mentioned Dinkelmann in an off-hand way, and the
baron had pressed inquiries.
Dinkelmann had been on the Brazos for ten years. Everybody in
that section knew him, and knew how he had borrowed and
borrowed from Lige Benner, until Benner had secured every head of
the Dutchman’s stock and a mortgage on his land and the cabin roof
that sheltered himself and his wife. Dinkelmann had been in the
German army, and carried honorable wounds—mementos of the
Franco-Prussian War.
This mention of Dinkelmann’s army experience was what stirred
the baron most deeply; for the baron himself had served his time in
the kaiser’s ranks, and had won the Order of the Black Eagle for
bravery on the field.
Yes, certainly, the baron would have to see Dinkelmann and
engage in a talkfest. It would be some time before Buffalo Bill could
reach Hackamore from Texico, and the baron could pass the night at
Dinkelmann’s and get to Hackamore before the scout reached the
town.
It was nine o’clock in the evening when the baron, having lost and
found himself at least a dozen times, first sighted the glow of light in
Dinkelmann’s cabin, rode up to the door and leaned down from his
saddle to knock.
A buxom lady answered his summons, starting back in trepidation
when she found the baron’s mule bulked across the entrance.
“Iss Misder Dinkelmann in der house, yes?” inquired the baron.
“Yah,” replied the buxom lady, but not with much enthusiasm.
“Meppy you peen Frau Dinkelmann, yes, no?”
“Yah.”
“Vell, I peen Deutsch meinseluf, und I rite seferal miles oudt oof
my vay schust for a leedle talk mit friendts from Chermany.”
“For vy you nod shpeak der Deutsche sprache?” inquired Frau
Dinkelmann skeptically.
“Pecause I dry hardt to make some berfections in der English.”
The baron, however, in order to prove that he was not an
impostor, rattled away in his native tongue. Herr Dinkelmann was in
the cabin, but he was not feeling well. He was a good-for-nothing,
the herr, and he was not brave enough to call his soul his own
except when he was at his schnapps. Would the baron put up his
mule in the corral behind the house, and come in?
The baron would—and did.
He found the interior of the house a bare enough place. There
were two chairs and a lounge in the front room, and a table on
which stood the lamp.
Herr Dinkelmann was stretched out on the lounge. He was a
short, fat man and seemed in great distress over something.
“Ged oop, you lazy lout, und see vat iss come already!” cried Frau
Dinkelmann. “A visidor has come py us, und you peen so drunk like
nodding. Fritz! Ged oop yourseluf und sit der lounge on, den look vat
you see. A visidor yet.”
Frau Dinkelmann talked English, perhaps out of deference to the
baron, perhaps only because she wanted to show him that she also
was proficient in foreign tongues.
As she talked to Fritz, she grabbed him and heaved him bodily into
a sitting position.
“Vat a fool I don’d know!” puffed Frau Dinkelmann. “Macht schnell,
Fritz! Lieber Gott, vill you your eyes oben und see vat iss here?”
A groan escaped Fritz Dinkelmann’s lips. His eyes opened and he
saw the baron’s hand. Grabbing at the hand, he clung to it with a
fervor that almost threw him off the lounge.
“Safe me!” he blubbered; “safe me or I vill die! Vere vas it put you
der schnapps, Katrina? Liebe Frau, gif me der pottle some more yet.”
Katrina stood in front of him and stuck up an admonitory finger.
“Hear me vat I say now und reflect,” she cried. “I gif you nod der
pottle some more yet to-nighdt. Dot’s all aboudt it. You make oof
yourseluf some pigs, some mules, ven you der schnapps trink so
great. It iss nod dot he loves der trink so,” she explained to the
baron, “aber dot he vants it der Dutch courage vat you call. He iss
troubles in, ve art bot’ troubles in, lieber Gott, und he takes der
schnapps to forget him der troubles. Vat a nonsense.”
“I haf hat drouples meinseluf, yah, so helup me,” said the baron,
“aber I look dem in der eyes und face dem oudt. Vat’s der use to
trink und make some forgeddings? Der drouples vas dere alretty, ven
ter trink iss gone. Fritz, mein lieber freund, douple der fist oop und
knock der drouples oudt oof der vay.”
Fritz moaned and tried to slump back on the lounge.
“I don’d got it some nerve to knock me my drouples oudt mit der
fist. Liebe Frau——”
But Katrina had grabbed him and pushed him back to a sitting
posture.
“Iss it to dreat a visidor righdt you act like dot?” she cried. “I vill
handt you vone auf der kopf oof you don’d make some vakings oop
und act mit resbect.”
“Vat iss der name?” asked Fritz, displaying a feeble interest in the
baron.
“Villum, Baron von Schnitzenhauser,” answered the baron. “Vat iss
der madder? Some oof der shildren sick?”
“Kindern ve haf none,” answered Fritz.
“Haf you some cattles on der range?”
“Cattles ve haf nod, neider kinder. Ach, du lieber, vat a hardt time
I don’d know. I dry to do der righdt t’ing mit eferypody, und pecause
I owe Penner, he makes me do der wrong t’ing, oder he takes from
Katrina und me avay der leedle house vere ve lif.”
“Shut oop such talks!” cried Katrina. “Der Dutch courage don’d
make some helps mit you. I go by der kitchen now to ged us der
paron some subber. Shpeak mit him, Fritz, vile I peen avay.”
“Liebe Frau,” begged Fritz, stretching out his hands, “gif us first
der schnapps.”
She struck his hands aside.
“Macht ruhig aboudt der schnapps, oder I vill der pottle preak on
der shtones,” she cried angrily.
With that, she lost herself in the rear room.
The baron tried to talk with Fritz, but it was impossible to get
much out of him. Even a mention of the German army failed to
arouse any interest in the distressed Dutchman. Finally Fritz slumped
back on the lounge and began to snore.
The baron would have been disgusted but for the fact that some
great sorrow was preying upon the unfortunate Dinkelmann. He
craved his schnapps to give him strength to bear his trials. Frau
Dinkelmann, it was clear, didn’t believe in Dutch courage.
What was all the bother about? the baron asked himself. If it was
the loss of cattle or a mortgage on the home that grieved and
fretted his countryman, the baron would not have had much
sympathy for him. The baron liked to see a man act in a manly way,
face his misfortunes, and walk over them to peace, plenty, and
happiness.
But there was something besides the loss of cattle and the
mortgage on Dinkelmann’s mind.
While Dinkelmann snored, and his wife moved around in the
kitchen, the baron smoked, and tried to guess out the problem.
He was almost sorry he had not gone on to Hackamore with
Nomad, Wild Bill, and Little Cayuse. Had he known the trail better,
he would have excused himself and started out without waiting for
supper. But he had lost his way so many times coming to
Dinkelmann’s that he was afraid to attempt the unknown country by
night.
While he sat and mused, he became conscious of a slight tapping,
as of knuckles lightly drumming against a door. He started forward in
his chair, and stared around. There were only three doors to that
room—one at the front entrance, one leading into the kitchen, and
another opening off to the right. The tapping came from the other
side of the door on the right.
What did it mean? The baron sat and studied over the remarkable
phenomenon until a shuffling sound struck on his ears. When that
commenced, the knocking ceased.
Under the baron’s astounded eyes a bit of white cloth was
showing itself beneath the door which had so mysteriously claimed
his attention. Some one, it seemed, was trying to push the piece of
cloth through into the living room.
Softly the baron arose, crossed to the door, bent down, and pulled
the cloth away.
It was a small handkerchief. Turning it over in his hand, he saw
that there was writing in pencil on one side of it.
The plot was thickening! The baron, overjoyed to find a little
excitement where he had expected nothing more than a talkfest, sat
down again, spread the handkerchief out on his knee, and puzzled
his brain over the following:
“Stranger: Will you be a friend to a woman in distress? I am
being detained in this room against my will. I must escape
and go back to my home. The horse that brought me should
be in the corral. The window of the room is boarded up on
the outside, but the boards can be easily removed.”
Had the writing been in German, the baron would not have been
long in deciphering it, but it was in English and, in places, almost
illegible. However, he managed to get at the gist of the
communication. A flutter of joy ran through him.
Here was an adventure!
And the baron could not live and be happy unless adventures
were constantly piling in upon him.
From the moment the baron had deciphered the writing on the
handkerchief, and had made up his mind to act upon the request of
the imprisoned lady, he found nothing monotonous in his
surroundings.
When Frau Dinkelmann asked him to come out into the kitchen
and have some supper, he stuffed the handkerchief into his pocket,
and moved with alacrity into the rear room.
Frau Dinkelmann, sitting on the opposite side of the table while
the baron ate, talked unceasingly in the German language. The
baron, even if he had been so inclined, could hardly have got a word
in edgeways. But he wasn’t anxious to talk. He listened
mechanically, and ate mechanically. His mind was busy with the
imprisoned lady who had sent him a penciled appeal on her
handkerchief.
“I vonder iss she young?” thought the baron; “und is she goot-
looking? Und vill she be gradeful oof I safe her from der Dinkelmann
house?”
So far as the mere adventure went, the baron was not particular
whether the lady was young or good-looking. But, if she happened
to be both, the glamor of romance might be added to the
undertaking.
“You vill shday der house in till morning?” inquired Frau
Dinkelmann, dropping back into her English as the baron arose from
the table.
“Could I talk mit Fritz in der morning?” he asked. “Vill he feel
pedder mit himseluf den?”
“Yah, so. You shday und you can talk mit Fritz all vat you blease. I
make you a bed der floor on.”
“I don’d like to shleep in der house,” demurred the baron. “I like
pedder der oudttoors as a shleeping blace. I drafel mit fellers vat
shleep oudtoors all der time, und I have got used to it.”
The baron was cunning. He knew that if he was supposed to be
sleeping outdoors he would have a chance to examine the boarded-
up window without arousing Frau Dinkelmann. He could also find the
lady’s horse, and get both the horse and Toofer, the mule, ready for
the road.
“Dere iss hay py der corral,” said Frau Dinkelmann.
“Den,” said the baron, going into the front room for his hat, “I vill
shmoke, und shleep on der hay. Vat iss der preakfast time?”
“Sigs o’glock, oder venefer you retty vas for vat ve haf. Gott sei
dank, ve got somet’ing to eat.”
Bidding Frau Dinkelmann good night, the baron left the house by
the kitchen door, rounded the corner of the building, and crept
stealthily to the boarded-up window.
Lightly he tapped on the boards. A tapping on the other side of
the barrier answered him.
The baron breathed quick and hard. What would Nomad and Wild
Bill not have given to be mixed up in such an adventure?
Ach, du lieber, but he was a lucky Dutchman!
After making sure that the lady had heard, and that she
understood he would come to her rescue, the baron fell to
examining the boards that closed up the opening.
They had been stoutly spiked to the side of the house. In prying
them away, it would be necessary to use an axe, and there would be
considerable noise.
The baron would have to wait until Frau Dinkelmann was fast
asleep. Even then there was a chance that she would be aroused by
his attack on the boards, but, if she was, he would rescue the lady
anyway, and in spite of both the Dinkelmanns. The baron preferred,
however, to rescue the lady quietly, and to get away from the house
with her without making a scene with the muscular frau.
Leaving the cabin, he went to the woodpile and found an axe. This
he carried to the window, and laid on the ground beneath it, where
it would be conveniently at hand when the time came to remove the
boards.
His next move was to go to the corral and look for the horse and
the lady’s riding gear. He found both, and was not long in getting the
horse and Toofer accoutred for the flight.
Leading the animals out of the corral, he hitched them to a post
where they would be ready for use at a moment’s notice; then he
stealthily approached the cabin, and peered through the window of
the living room.
He was disappointed.
Frau Dinkelmann was wide awake. She had drawn a chair in front
of the door leading into the prison chamber, and was sitting in it.
She was knitting. Across her ample lap, the ball of yarn dancing
around it as it unrolled, lay an old-fashioned pistol with a bright
brass cap under the hammer.
The baron wondered if Frau Dinkelmann suspected that he was
planning to assist the imprisoned lady. She was there on guard, that
was evident.
Impatiently the baron went back to the corral. Sitting on a forkful
of hay and leaning against the corral fence, he smoked three pipes
very slowly, and again went to the house and stole a look through
the window.
There was the frau, vigilant as ever, her needles flying and the ball
dancing up and down the barrel and stock of the old pistol.
“Py shinks,” thought the baron, “vat oof she shdays dere all
nighdt?”
The baron wasn’t afraid of the pistol—not for himself, but the lady
would be endangered if he tried to take her away in spite of the
watchful frau.
No, it would be better to wait until Frau Dinkelmann was sound
asleep.
The baron returned to his place by the corral fence. Sitting down
as before, he leaned back, and tried to beguile the tedious wait by
wondering who the lady was, why she had been imprisoned in the
house, and whether or not it was she who weighed so heavily on
Fritz Dinkelmann’s mind.
Then, being tired, and growing confused over his knotty
reflections, quite naturally he fell asleep. When he opened his eyes
again, a dingy gray light tinged the sky in the east. For a moment he
blinked; then, with a muttered exclamation, he jumped to his feet.
“Himmelblitzen!” he gasped. “I haf shlept all der nighdt, und now
it iss gedding tay! Dit I tream dot aboudt der laty vat vants to be
resgued?”
His troubled eyes wandered toward the cabin, and then back to a
post by the corral.
No, he had not dreamed about the lady. There, plainly before his
eyes, was the boarded-up window, and here, hitched to the corral
post, stood the weary horse and the mule.
Softly the baron made his way to the living-room window, and
peered through.
The lamp, burning dimly, cast a sickly light over the room. In the
chair in front of the door still sat the frau, but her knitting lay in her
lap, and her head was bowed forward in slumber.
Hastily the baron passed to the rear of the house, picked up the
axe, and pried at the boards covering the window. The first one
came away with such a crash that he felt sure Frau Dinkelmann
must have heard the noise. But, no. There was no sound in the
living room to bolster up his fears.
He went to work at the second board, and got it off much more
quietly than he had the first. It was not necessary to remove any
more. A woman’s face appeared in the opening he had made, and a
slender form forced itself through the breach and dropped to the
ground at his side.
“Oh, thank you, thank you!” said the woman, catching one of the
baron’s hands in both her own.
The baron’s heart fluttered. She was young and beautiful—and he
had saved her from the Dinkelmanns!
“Dot’s all righdt, lady,” said the baron, throwing out his chest,
“making resgues like dose vas my long suit. I peen a bard oof
Puffalo Pill’s, und I learned how to do dot mit him. You know Puffalo
Pill, yes?”
“I have heard of him,” the girl answered.
For the first time the baron noticed that the girl’s face, though
very pretty, was haggard and worn.
“Ach,” he murmured sympathetically, “you haf hat some hardt
times, I bed you! Vat iss your name?”
“Hattie Perry.”
“Vat a pooty name! Haddie Berry! I like dot name. Vere you vant
to go, Miss Berry? Schust shpeak der vort, und it iss my law.”
“I want to go back to my father’s ranch,” said the girl, her voice
trembling.
“Dot’s vere ve vill go, you bed you. Iss it far avay?”
“About three hours’ ride, if we hurry.”
“Den ve vill hurry fasder as dot und make it in an hour and a
haluf,” laughed the baron. “Meppyso ve hat pedder ged avay mit
ourselufs. Der olt laty insite der house has a bistol, und I don’d vant
her to vake oop mit herseluf und see us pefore ve ged a gouple oof
miles from here. Aber vait.”
The baron reached into his pocket and pulled out three twenty-
dollar gold pieces. Reaching his hand inside the window, he laid the
gold pieces on the sill back of the boards.
“Why did you do that?” asked the girl curiously.
“Dot’s somet’ing for der Dinkelmanns,” replied the baron. “I bed
you dey don’t got mooch, und I don’d pelieve dey are as pad as vat
some beobles mighdt t’ink. Now, den, Miss Berry, off ve go for der
ranch vere you lif ven you are ad home.”
They hurried to the place where the animals had been hitched.
The baron untied both mounts, he and the girl got into their saddles,
and in a few minutes they were moving briskly along the timbered
bank of the Brazos.
The baron felt like bursting into song. But he wanted to make a
good impression on the girl—and he knew he couldn’t sing.
CHAPTER X.
I N T R O U B L E D WAT E R S.
The dawn gave way to morning, and the sun rose while the baron
and the girl were pushing on toward the Star-A ranch. The girl
piloted their course, and lost a good deal of time giving a ranch,
whose buildings stood on a tongue of land half encircled by the river,
a wide berth.
“For vy you do dot?” asked the baron.
He had not, up to that moment, asked the girl any questions
about herself. Fully two hours had passed since they had left the
Dinkelmann cabin, and not half a dozen words had been exchanged
between him and the girl.
“A man lives there who is an enemy of my father’s,” the girl
answered. “He is a cattle baron, and his name is Phelps.”
“I peen some parons meinseluf,” said the Dutchman, “aber I don’d
got some cattle. Iss he a pad feller, dis cattle paron?”
“Yes; fully as unscrupulous as that other cattle baron whose name
is Benner.”
“Vat a lod oof cattle parons, und all pad eggs. Vell, vell, nefer
mindt. Vere vas you ven der Dinkelmanns gaptured you, Miss
Berry?”
“It wasn’t the Dinkelmanns who captured me, but some of
Benner’s cowboys.”
“Ach, aber I vish I hat peen aroundt dot time! Vere dit it habben?”
“At the ranch. Nate had gone away early to look for some stray
cattle. He didn’t come back when he said he would, and father went
to hunt him up. Father didn’t come back either, and I was in the
house reading when—when—when Benner’s cowboys came. I fought
to get away from them, but there were two of them, and what could
I do? They took me to Fritz Dinkelmann’s, and I was told that
Benner was coming to see me this morning. Oh, but I am glad you
came to my aid, Mr. von Schnitzenhauser!”
“So am I glad,” said the baron, “more glad as I can tell. Vy ditn’t
you dry und knock der poards off from der insite, huh?”
“I did try—but I had only my hands.”
She lifted her hands to show him how they had been bruised and
scratched.
“Ach, sure,” said the baron, “you couldn’t haf got oudt oof dot
blace mitoudt an axe, same as vat I hat.”
“When I heard you come to the house last night,” the girl went on,
“I made up my mind to see if you would befriend me. I was lucky in
happening to have that bit of lead pencil in my pocket, and the
handkerchief served very well for something to write on. I waited
until I knew Mrs. Dinkelmann was in the kitchen, and then I tapped
on the door to attract your attention, and began pushing the
handkerchief through. I can’t begin to tell you how glad I was when
I heard you rap on the boards at the window, but you were a long
time getting me out.”
“Id vasn’t safe to dry it sooner,” explained the baron, keeping quiet
about the way he went to sleep; “der olt laty vas on guard mit der
bistol. Ach, vat a big bistol id vas! Und I bed you id shoots like
anyding.”
“Well,” sighed the girl, “I am safely away from the house, and I
shall soon be at home now.”
“You bed someding for nodding aboudt dot. Aber tell me vonce:
Iss dot Dinkelmann a pad feller?”
“No, I don’t think he is, baron. He owes Benner money, though,
and Benner forces Dinkelmann to do things that are not right.
Dinkelmann is more to be pitied than condemned. He——”
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.
More than just a book-buying platform, we strive to be a bridge
connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.
Join us on a journey of knowledge exploration, passion nurturing, and
personal growth every day!
testbankfan.com

More Related Content

PPT
ch09.ppt
PPT
Comp102 lec 11
PPTX
Files that are designed to be read by human beings
PPT
File Input and Output in Java Programing language
DOCX
PAGE 1Input output for a file tutorialStreams and File IOI.docx
PPTX
Java Tutorial Lab 6
PDF
File Handling in Java.pdf
PDF
CSE3146-ADV JAVA M2.pdf
ch09.ppt
Comp102 lec 11
Files that are designed to be read by human beings
File Input and Output in Java Programing language
PAGE 1Input output for a file tutorialStreams and File IOI.docx
Java Tutorial Lab 6
File Handling in Java.pdf
CSE3146-ADV JAVA M2.pdf

Similar to Absolute Java 5th Edition Walter Savitch Solutions Manual (20)

PDF
Basic i/o & file handling in java
PPTX
IOStream.pptx
PPT
asdabuydvduyawdyuadauysdasuydyudayudayudaw
PPTX
File Handling.pptx
PPT
Basic input-output-v.1.1
PPTX
chapter 2(IO and stream)/chapter 2, IO and stream
PPTX
File Input and output.pptx
PPT
14 file handling
 
PPTX
Java I/O
PPTX
File Handling in Java Oop presentation
DOCX
FileHandling.docx
PDF
OOPs with Java_unit2.pdf. sarthak bookkk
PPTX
Java file
PPS
Files & IO in Java
PDF
Java IO Stream, the introduction to Streams
PPTX
Various types of File Operations in Java
PPT
JavaYDL19
PDF
IOstreams hgjhsgfdjyggckhgckhjxfhbuvobunciu
PPTX
Files io
Basic i/o & file handling in java
IOStream.pptx
asdabuydvduyawdyuadauysdasuydyudayudayudaw
File Handling.pptx
Basic input-output-v.1.1
chapter 2(IO and stream)/chapter 2, IO and stream
File Input and output.pptx
14 file handling
 
Java I/O
File Handling in Java Oop presentation
FileHandling.docx
OOPs with Java_unit2.pdf. sarthak bookkk
Java file
Files & IO in Java
Java IO Stream, the introduction to Streams
Various types of File Operations in Java
JavaYDL19
IOstreams hgjhsgfdjyggckhgckhjxfhbuvobunciu
Files io
Ad

Recently uploaded (20)

PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
master seminar digital applications in india
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PPTX
GDM (1) (1).pptx small presentation for students
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PPTX
Lesson notes of climatology university.
PDF
A systematic review of self-coping strategies used by university students to ...
PDF
RMMM.pdf make it easy to upload and study
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PDF
01-Introduction-to-Information-Management.pdf
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Supply Chain Operations Speaking Notes -ICLT Program
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
master seminar digital applications in india
Abdominal Access Techniques with Prof. Dr. R K Mishra
202450812 BayCHI UCSC-SV 20250812 v17.pptx
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
STATICS OF THE RIGID BODIES Hibbelers.pdf
O5-L3 Freight Transport Ops (International) V1.pdf
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
GDM (1) (1).pptx small presentation for students
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
102 student loan defaulters named and shamed – Is someone you know on the list?
human mycosis Human fungal infections are called human mycosis..pptx
Lesson notes of climatology university.
A systematic review of self-coping strategies used by university students to ...
RMMM.pdf make it easy to upload and study
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
01-Introduction-to-Information-Management.pdf
Final Presentation General Medicine 03-08-2024.pptx
Supply Chain Operations Speaking Notes -ICLT Program
Ad

Absolute Java 5th Edition Walter Savitch Solutions Manual

  • 1. Absolute Java 5th Edition Walter Savitch Solutions Manual download https://testbankfan.com/product/absolute-java-5th-edition-walter- savitch-solutions-manual/ Find test banks or solution manuals at testbankfan.com today!
  • 2. We have selected some products that you may be interested in Click the link to download now or visit testbankfan.com for more options!. Absolute Java 5th Edition Walter Savitch Test Bank https://testbankfan.com/product/absolute-java-5th-edition-walter- savitch-test-bank/ Absolute Java 6th Edition Savitch Test Bank https://testbankfan.com/product/absolute-java-6th-edition-savitch- test-bank/ Absolute C++ 5th Edition Savitch Solutions Manual https://testbankfan.com/product/absolute-c-5th-edition-savitch- solutions-manual/ Emergency Care in Athletic Training 1st Edition Grose Test Bank https://testbankfan.com/product/emergency-care-in-athletic- training-1st-edition-grose-test-bank/
  • 3. Management 1st Edition Neck Test Bank https://testbankfan.com/product/management-1st-edition-neck-test-bank/ Intercultural Communication A Contextual Approach 7th Edition Neuliep Test Bank https://testbankfan.com/product/intercultural-communication-a- contextual-approach-7th-edition-neuliep-test-bank/ MR 2 2nd Edition Brown Test Bank https://testbankfan.com/product/mr-2-2nd-edition-brown-test-bank/ Labor Relations and Collective Bargaining 9th Edition Carrell Test Bank https://testbankfan.com/product/labor-relations-and-collective- bargaining-9th-edition-carrell-test-bank/ Systems Analysis and Design 10th Edition Kendall Solutions Manual https://testbankfan.com/product/systems-analysis-and-design-10th- edition-kendall-solutions-manual/
  • 4. Concepts of Genetics Books a la Carte Edition 11th Edition Klug Test Bank https://testbankfan.com/product/concepts-of-genetics-books-a-la-carte- edition-11th-edition-klug-test-bank/
  • 5. Savitch, Absolute Java 5/e: Chapter 10, Instructor’s Manual Copyright © 2012 Pearson Education Addison-Wesley. All rights reserved. Chapter 10 File I/O Key Terms stream input stream output stream System.out System.in text file ASCII file binary file PrintWriter java.io opening a file FileOutputStream file name reading the file name FileNotFoundException println, print, and printf buffered buffer appending opening a file BufferedReader opening a file readLine read method path names using . . or / redirecting output abstract name opening a file writeInt writeChar writeUTF for Strings closing a binary file reading multiple types closing a binary files EOFException Serializable interface writeObject readObject Serializable class instance variable
  • 6. Savitch, Absolute Java 5/e: Chapter 10, Instructor’s Manual Copyright © 2012 Pearson Education Addison-Wesley. All rights reserved. file pointer opening a file Brief Outline 10.1 Introduction to File I/O Streams Text Files and Binary Files 10.2 Text Files Writing to a Text File Appending to a Text File Reading from a Text File Reading a Text File Using Scanner Testing for the End of a Text File with Scanner Reading a Text File Using BufferedReader Testing for the End of a Text File with BufferedReader Path Names Nested Constructor Invocations System.in, System.out, System.err 10.3 The File Class Programming with the File Class 10.4 Binary Files Writing Simple Data to a Binary File UTF and writeUTF Reading Simple Data from a Binary File Checking for the End of a Binary File Binary I/O of Objects The Serializable Interface Array Objects in Binary Files 10.5 Random Access to Binary Files Reading and Writing to the Same File Teaching Suggestions This chapter discusses using files for reading and writing information. The first sections deal with text files and inputting and outputting information using just text. This is accomplished in Java using streams. Reading from a file and reading from the console are actually not that much different because both are treated as streams. With the introduction of the Scanner class in Java 5, there is another new way to process files and this chapter discusses both the use of BufferedReader and Scanner. The last two sections of the chapter are optional and discuss how to use binary files and read and write entire objects to a file. These sections introduce the Serializable interface for allowing the reading and writing of objects.
  • 7. Savitch, Absolute Java 5/e: Chapter 10, Instructor’s Manual Copyright © 2012 Pearson Education Addison-Wesley. All rights reserved. Key Points Streams. Streams are flows of date. There are input streams and output streams. Streams are the method used for console I/O as well as file I/O. Text Files Versus Binary Files. Text files are those which are written with an editor and use characters that are commonly recognizable to humans. Binary files are those that are easily read by the machine. A type of file that would be a binary file are the .class files that are generated when we compile a .java file. Opening a Text File for Writing Output. You create a PrintWriter to write to a file using the methods print and println. You must tell the PrintWriter what the name of the file is that you will be writing to. If the file can not be found, a FileNotFoundException will be thrown. File Names. The name of a file on the system is dictated by the system, not by Java. Therefore, the name of the file is the name of the file on the system. A File has Two Names. In the program, you connect the stream to the file and use its name on the system. The stream itself has a name and that is the name you use when writing to the file within your program. IOException. This is the base class for all exceptions dealing with input and output errors. Closing a Text File. It is important that when you are done with a stream, that you close the stream using the close method. Opening a Text File for Appending. You can open file for writing and append text to the end as opposed to overwriting the information by adding the parameter true to the creation of the FileOutputStream that is created when creating the PrintWriter. Opening a Text File for Reading with Scanner. If you open a file for reading with Scanner, you can use the methods of the scanner just like when you were reading from console input, nextInt, nextLine, etc. FileNotFoundException. This exception is thrown when a file that the system requests is not present on the system. It is a type of IOException and will appear when doing File I/O. Checking for the End of a Text File with Scanner. The methods of the Scanner help to see when the input from the file is finished. Unchecked Exceptions. There are many unchecked exceptions that can occur while reading and writing to a file. These include the NoSuchElementException, InputMismathException, and IllegalStatementException. Opening a Text File for Reading with BufferedReader. Using the BufferedReader to read from a file, you can then use the readLine and read methods to retrieve the information.
  • 8. Savitch, Absolute Java 5/e: Chapter 10, Instructor’s Manual Copyright © 2012 Pearson Education Addison-Wesley. All rights reserved. Checking for the End of a Text File with BufferedReader. readLine returns null when it tries to read beyond the end of the file, and read returns -1 if it goes beyond the end of the file. The File Class. There is a class defined in Java to represent a file. Creating an instance of this class will help determine whether a file exists and if the program has read/write access to the file. Opening a Binary File for Output. Writing to a binary file requires an ObjectOutputStream and you can use any of its multiple write methods to write information to the file. Opening a Binary File for Reading. You use a ObjectInputStream to read information from a binary file. There are also multiple read methods to help read the information from the file. EOFException. If you read beyond the end of the file, this exception will be thrown and can be used in a loop to help determine when you have reached the end of the file. Tips toString Helps with Text File Output. The methods print and println in a PrintWriter work like System.out.print and System.out.println. If you give an object as a parameter, they will automatically call the toString method on that object. Another good reason to always have a toString in the objects you create. Reading Numbers with BufferedReader. Reading from a file gives the information as a String. To convert a String from a file into a number, you must use the method Integer.parseInt or similar methods to convert the string to the number. Pitfalls A try Block is a Block. This pitfall discusses the fact that declaring a variable inside the block makes the variable local to the block and not accessible outside of the block. This is important when creating streams. Overwriting an Output File. When you create a PrintWriter for a file, you will destroy a file on the system with the same name if one exists. All of the information in that file will be lost. If a file by that name does not exist, it will be created. Checking for the End of a File in the Wrong Way. If you are looking for the end of the file marker in the wrong way, chances are your program will generate an error or go into an infinite loop. It is important to remember that the EOFException will be generated if using a binary file and a character like null will be read if at the end of a text file. Mixing Class Types in the Same File. You do not want to mix class types within the same binary file. It is best to only store items of the same class or primitive type in a file and not to mix the two.
  • 9. Savitch, Absolute Java 5/e: Chapter 10, Instructor’s Manual Copyright © 2012 Pearson Education Addison-Wesley. All rights reserved. A RandomAccessFile Need Not Start Empty. When a file is opened in this way, the file is not erased, but rather the file pointer is set to the beginning of the file, not always the best place for writing, but usually the better place for reading from the file. Programming Projects Answers 1. /** * Question1Names.java * * This program reads through a list of names and finds * the most popular boys and girls names. * * Created: Sat Mar 19 2005 * * @author Kenrick Mock * @version 1 */ import java.io.FileInputStream; import java.io.IOException; import java.io.FileNotFoundException; import java.util.Scanner; public class Question1Names { public static final int NUMNAMES = 1000; // Number of names in the file /** * isInArray * Searches the string array for target. * It returns the index of the matching name. If no match * is found, then -1 is returned. * * This algorithm uses a simple linear search. * A much more efficient method is binary search, * which can be used since the array is sorted. * Binary search is covered in chapter 11. * * @param names Array of names to search * @param target String target we are searching for * @return int Index of matching position, -1 if no match found. */ public static int isInArray(String[] names, String target)
  • 10. Savitch, Absolute Java 5/e: Chapter 10, Instructor’s Manual Copyright © 2012 Pearson Education Addison-Wesley. All rights reserved. { int i; // Scan through all strings for a match. // Since the arrays are not sorted, we can't use // binary search or other search optimizations. for (i=0; (i<NUMNAMES); i++) { if (names[i].equals(target)) return i; } return -1; } /** * LoadFile reads from the specified filename into the arrays * for the names and count of occurrences of that name. * * @param names String array where to store the names from the file * @param count int array where to store the count numbers from the file * @param filename String holding the name of the file to open */ public static void LoadFile(String[] names, int[] count, String filename) { // Read the entire file into an array so it can be searched. Scanner inputStream = null; int i; try { inputStream = new Scanner(new FileInputStream(filename)); for (i=0; i< NUMNAMES; i++) { String line = inputStream.nextLine(); // Parse out first name and number int space = line.indexOf(" ",0); String first = line.substring(0,space); String number = line.substring(space+1); // Store values in arrays // Convert name to lowercase to avoid case sensitivity names[i] = first.toLowerCase(); count[i] = Integer.parseInt(number); } inputStream.close(); } catch (FileNotFoundException e) {
  • 11. Savitch, Absolute Java 5/e: Chapter 10, Instructor’s Manual Copyright © 2012 Pearson Education Addison-Wesley. All rights reserved. System.out.println ("File not found!"); System.exit (0); } catch (IOException e) { System.out.println("Error reading from file."); System.exit(0); } } /** * Main method */ public static void main(String[] args) { int i; String name; String[] boyNames = new String[NUMNAMES]; // Array of boy names String[] girlNames = new String[NUMNAMES]; // Array of girl names int[] boyCount = new int[NUMNAMES]; // Array of number of names for boys int[] girlCount = new int[NUMNAMES]; // Array of number of names for girls // e.g. boyCount[0] is how many // namings of boyNames[0] // A more OO design would be to create a class // that encapsulates both a name and count // than to have two separate arrays. // Load files into arrays LoadFile(boyNames, boyCount, "boynames.txt"); LoadFile(girlNames, girlCount, "girlnames.txt"); // Input the target name and search through the arrays for a match System.out.println("Enter name: "); Scanner scan = new Scanner(System.in); name = scan.nextLine(); String lowerName = name.toLowerCase(); // First look through girls i = isInArray(girlNames, lowerName); if (i>=0) { System.out.println(name + " is ranked " + (i+1) + " in popularity " + "among girls with " + girlCount[i] + " namings."); } else
  • 12. Savitch, Absolute Java 5/e: Chapter 10, Instructor’s Manual Copyright © 2012 Pearson Education Addison-Wesley. All rights reserved. { System.out.println(name + " is not ranked among the top 1000 girl names. "); } // Repeat for boys i = isInArray(boyNames, lowerName); if (i>=0) { System.out.println(name + " is ranked " + (i+1) + " in popularity " + "among boys with " + boyCount[i] + " namings."); } else { System.out.println(name + " is not ranked among the top 1000 boy names. "); } } } // Question1Names 2. /** * Question2Text.java * * Created: Fri Jan 09 20:08:09 2004 * Modified: Sun Mar 20 2005, Kenrick Mock * * @author Adrienne Decker * @version */ import java.io.FileReader; import java.io.IOException; import java.io.FileInputStream; import java.util.Scanner; public class Question2 { public static void main(String[] args){ int min = 0; int max = 0; int temp; try {
  • 13. Savitch, Absolute Java 5/e: Chapter 10, Instructor’s Manual Copyright © 2012 Pearson Education Addison-Wesley. All rights reserved. Scanner inputStream = new Scanner(new FileInputStream("Question2.txt")); // File must have at least one integer // to operate properly if (inputStream.hasNextInt()) { min = inputStream.nextInt(); max = min; } while (inputStream.hasNextInt()) { temp = inputStream.nextInt(); if (temp < min) { min = temp; } // end of if () if (temp > max) { max = temp; } // end of if () } inputStream.close(); System.out.println("Minimum value read: " + min); System.out.println("Maximum value read: " + max); } catch (IOException e) { System.out.println("Error reading from Question1.txt"); } } } // Question2 3. /** * Question3.java * * Created: Fri Jan 09 20:08:16 2004 * Modified: Sun Mar 20 2005, Kenrick Mock * * @author Adrienne Decker * @version */ import java.io.FileReader;
  • 14. Savitch, Absolute Java 5/e: Chapter 10, Instructor’s Manual Copyright © 2012 Pearson Education Addison-Wesley. All rights reserved. import java.io.IOException; import java.io.FileInputStream; import java.util.Scanner; public class Question3 { public static void main(String[] args){ int count = 0; double sum = 0.0; try { Scanner inputStream = new Scanner(new FileInputStream("Question3.txt")); // File must have at least one value // to operate properly if (inputStream.hasNextDouble()) { count = 1; sum = inputStream.nextDouble(); } while (inputStream.hasNextDouble()) { sum += inputStream.nextDouble(); count++; } inputStream.close(); System.out.println("Average: " + sum/count); } catch (IOException e) { System.out.println("Error reading from Question3.txt"); } } } // Question3 4. /** * Question4.java * * Created: Fri Jan 09 20:08:21 2004 * Modified: Sun Mar 20 2005, Kenrick Mock *
  • 15. Savitch, Absolute Java 5/e: Chapter 10, Instructor’s Manual Copyright © 2012 Pearson Education Addison-Wesley. All rights reserved. * @author Adrienne Decker * @version 2 */ import java.io.FileReader; import java.io.IOException; import java.io.FileInputStream; import java.util.Scanner; public class Question4 { public static void main(String[] args) { int count = 0; double temp = 0.0; double sum = 0.0; double avg = 0.0; try { Scanner inputStream = new Scanner(new FileInputStream("Question4.txt")); // File must have at least one value // to operate properly if (inputStream.hasNextDouble()) { count = 1; sum = inputStream.nextDouble(); } while (inputStream.hasNextDouble()) { sum += inputStream.nextDouble(); count++; } inputStream.close(); avg = sum / count; // Open again and calculate standard deviation inputStream = new Scanner(new FileInputStream("Question4.txt")); sum = count = 0; while (inputStream.hasNextDouble()) { double val = inputStream.nextDouble(); sum += Math.pow(val - avg, 2.0); count++;
  • 16. Savitch, Absolute Java 5/e: Chapter 10, Instructor’s Manual Copyright © 2012 Pearson Education Addison-Wesley. All rights reserved. } inputStream.close(); System.out.println("Standard Deviation: " + Math.sqrt(sum/count)); } catch (IOException e) { System.out.println("Error reading from Question4.txt"); } } } // Question4 5. /** * Question5.java * * Created: Fri Jan 09 20:08:26 2004 * Modified: Sun Mar 20 2005, Kenrick Mock * * @author Adrienne Decker * @version 2 */ import java.io.FileInputStream; import java.util.Scanner; import java.io.File; import java.io.FileOutputStream; import java.io.FileReader; import java.io.InputStreamReader; import java.io.IOException; import java.io.PrintWriter; import java.util.StringTokenizer; import java.util.NoSuchElementException; public class Question5 { public static void main(String[] args){ try { String word = ""; String tempFile = "TempX"; while (true) {
  • 17. Savitch, Absolute Java 5/e: Chapter 10, Instructor’s Manual Copyright © 2012 Pearson Education Addison-Wesley. All rights reserved. File fileObject = new File(tempFile); if (fileObject.exists()) { tempFile = tempFile + "X"; } // end of if () else { break; } // end of else } // end of while () Scanner keyboard = new Scanner(System.in); System.out.println("Enter filename of file to remove blanks:"); String fileInput = keyboard.nextLine(); Scanner inputStream = new Scanner(new FileInputStream(fileInput)); PrintWriter outputStream = new PrintWriter(new FileOutputStream(tempFile)); String line; while (inputStream.hasNextLine()) { line = inputStream.nextLine(); StringTokenizer st = new StringTokenizer(line, " "); while (st.hasMoreTokens()) { word = st.nextToken(); if (st.hasMoreTokens()) outputStream.print(word + " "); else outputStream.println(word); } // end of while () } inputStream.close(); outputStream.close(); inputStream = new Scanner(new FileInputStream(tempFile)); outputStream = new PrintWriter(new FileOutputStream(fileInput)); while (inputStream.hasNextLine()) { line = inputStream.nextLine(); outputStream.println(line);
  • 18. Savitch, Absolute Java 5/e: Chapter 10, Instructor’s Manual Copyright © 2012 Pearson Education Addison-Wesley. All rights reserved. } inputStream.close(); outputStream.close(); File fileObject = new File(tempFile); fileObject.delete(); } catch (IOException e) { System.out.println("Error reading or writing files."); } } } // Question5 Text Project 6. /** * Question6.java * * Created: Fri Jan 09 20:08:32 2004 * Modified: Sun Mar 20 2005, Kenrick Mock * * @author Adrienne Decker * @version 2 */ import java.io.FileInputStream; import java.util.Scanner; import java.io.FileOutputStream; import java.io.FileReader; import java.io.InputStreamReader; import java.io.IOException; import java.io.PrintWriter; public class Question6 { public static void main(String[] args){ try { Scanner inputStream = new Scanner(new FileInputStream("advice.txt")); String line; while (inputStream.hasNextLine()) {
  • 19. Savitch, Absolute Java 5/e: Chapter 10, Instructor’s Manual Copyright © 2012 Pearson Education Addison-Wesley. All rights reserved. line = inputStream.nextLine(); System.out.println(line); } inputStream.close(); Scanner keyboard = new Scanner(System.in); System.out.println("Enter advice (hit return on empty line to quit):"); PrintWriter outputStream = new PrintWriter(new FileOutputStream("advice.txt")); line = keyboard.nextLine(); while (!line.equals("")) { outputStream.println(line); line = keyboard.nextLine(); } outputStream.close(); } catch (IOException e) { System.out.println("Error reading or writing files."); } } } // Question6 7. No solution given 8. No solution given (see question 9 below, substitute int for double) 9. /** * Question9.java * * * Created: Fri Jan 09 20:08:41 2004 * * @author Adrienne Decker
  • 20. Random documents with unrelated content Scribd suggests to you:
  • 21. CHAPTER VIII. A D A S H F O R F R E E D O M . Considering the circumstances, Buffalo Bill’s manœuvre was audacious in the extreme. Overawing the barons and treating them in such a high-handed manner, right on their own ground, was a reckless proceeding. It needed a man of resource and determination like the scout to carry it through to a success. Buffalo Bill, however, although he had acted on the spur of the moment, was not blind to the dangers that surrounded him. He was lightning quick in probing chances and forecasting probabilities. There were two things he wanted to do. One was to snatch Perry out of that camp of enemies; and the other was to discover what had become of Perry’s daughter. Moving quickly to the door, Buffalo Bill looked over the surroundings of the cabin. The four cowboys were still smoking and talking under the trees. In the other direction, cowboys were catching up horses out of the corral, saddling and riding away to their places on the range. No one outside the cabin seemed to know or care what was happening to the cattle barons. Mightily relieved, the scout whirled away from the open door. As he did so, there was a crash that shook the cabin floor. The two barons, in their struggles to free their feet of the encircling noose, had toppled over and fallen. Secured to each other as they were, they were in a sorry plight. Buffalo Bill hurried to them and adjusted their arms so that they would be more comfortable.
  • 22. “Stop your struggling,” said he, “and you’ll be a whole lot better off.” “What do you mean by making an attack on me, right on my own ground?” asked Phelps. “That’s where we begin to talk business, Phelps,” said the scout. “The prisoner you have in this room is Dick Perry?” “Yes, that’s my name,” spoke up the prisoner. In some manner Perry had freed himself of his gag and was able to talk. Keeping a wary eye on the barons, Buffalo Bill backed over to Perry and pulled the stick from under his knees. Perry at once arose to his feet and slipped his hands out of the coils at his wrists. “I owe you a debt of gratitude for this,” said he; “a debt that I ——” “Never mind that now, Perry,” interrupted the scout. “We’re not out of the woods yet by a long shot. Is your daughter here, at Phelps’ ranch?” A wild look crossed Perry’s face. “My daughter?” he returned. “Good heavens! You don’t mean to say that she—that these scoundrels have——” “You’re in the dark, I see, Perry,” cut in the scout, “so the chances are that your daughter isn’t here. She was taken away from the ranch some time last night.” Perry grabbed up a chair and started toward the two men on the floor. The scout caught him by the shoulders. “Careful!” he warned. “A move like that won’t help us any. Don’t lose heart—we’ll find the girl.” The scout went back to the cattle barons. “Watch the lay of the land outside, Perry,” said the scout. “If you see any one coming this way, let me know at once.”
  • 23. Perry put down the chair and cautiously took up a position by the open door. “You’ve got the bulge on us, Buffalo Bill,” said Benner. “Take these confounded manacles off our hands.” “They belong to you,” returned the scout, “and I reckon I’ll let you keep them. Those are the handcuffs that the clerk of the hotel said he had put in your saddlebags. The clerk put them in the wrong saddlebags, that’s all. Why did you want two pairs?” “That’s our business,” snapped Phelps. “You’re playing a mighty reckless game, Buffalo Bill, and you’ve about one chance in a thousand to win out. You may be able to get away from this ranch, but the Brazos country isn’t big enough to hide you from the men Benner and I will put on your trail.” “I’ll take care of that part of it. You fellows would have more success in your deviltry if you’d quit passing notes back and forth and hiding them in your watch cases.” Both barons swore. “Confound it, Phelps,” gurgled Benner, “that was your fault.” “Oh, yes,” snorted Phelps, “whenever you make a misplay it’s my fault! When I gave you that information I couldn’t talk it, so I had to write.” “And I wasn’t able to read it then, and so I had to put it in my watch and read it later. But you could have waited. We’d have had plenty of chance to talk privately before we left Hackamore. That’s where you was lame. You didn’t wait.” “And where was you lame?” taunted Phelps. “Making that bet to throw watches. Why didn’t you think of what was in that watch of yours, hey? You——” “That’s enough,” interrupted the scout. “Save your bickering until Perry and I get away. Benner, what have you done with Hattie Perry?”
  • 24. “I don’t know anything about Hattie Perry,” answered Benner sulkily. “Yes, you do. You’re talking crooked, when you say that; I can see it in your face. Where is the girl? If you know when you’re well off, you’ll tell me, and not make any bones about it.” “Who’re you, anyhow?” flashed Benner. “You may amount to something in your own neck of the woods, but you don’t cut much of a caper here on the Brazos. This is our ground, this is! When Perry sees his daughter next, she’ll be Mrs. Benner.” Fortunately, Perry didn’t hear Benner’s remark. “You’ll have another guess coming about that,” said the scout. “You’re about as contemptible a cur, Lige Benner, as a man could find in a month’s travel. You two men have a chance, here and now, to do the right thing and square yourselves. Tell me where Miss Perry is, and agree to return all the Star-A cattle you’ve rustled and leave Perry and Dunbar alone in future, and we’ll call this account settled. It will be mighty small payment for you scoundrels to make. Hang out against my proposition, and I’ll camp down on the Brazos until I’ve run you men to cover.” “That’s big talk,” taunted Phelps. “The way I’ve handled you this morning is a sample of the way I and my pards do things. If you want any more samples, you’ll find us ready to produce. What have you to say?” “Be hanged to you,” snarled Benner. “You’re a long ways from being out of this yet. You——” “Buffalo Bill!” called Perry from the door. As the scout looked, Perry motioned frantically; and the scout ran to the door, the two cattle barons began to yell for help. “That settles it,” muttered the scout; “it’s neck or nothing with us, Perry. That’s my horse—the black at the end of the hitching-pole. You annex the one hitched alongside. Sharp’s the word!”
  • 25. Together they sprang through the door. Cowboys seemed to be coming from every direction, on foot and on horseback. The four who had been smoking under the tree were the ones who had caused Perry’s alarm. They had started toward the house in a body. Whether they were merely curious, or whether they had heard something which had aroused their suspicions, the scout never knew. Be that as it might, when the scout and Perry leaped through the door, the four men were almost upon them. “Stop those fellows!” yelled Benner from inside the house. There was small need of any urging on the part of the cattle barons. Benner’s cowboys, seeing Perry free and hurrying away with the man who had recently arrived on the black horse, suspected at once that a rescue had been effected. The four cowboys hurled themselves at the scout and Perry. Benner’s men met with a surprise that literally carried two of them off their feet—a right-hander from the scout did the trick for one, and a straight-out blow by Perry dropped the other. The remaining two made an attempt to snatch their guns from their belts. The fugitives, however, took advantage of the attempt to use their fists again. The last pair were bowled over, and the scout and Perry jumped for their horses. To tear the animals free of the hitching-pole required only a moment, but every moment was precious. The gathering minions of the barons were almost in front of the log house as the escaping men jumped to their saddles. “Follow me, Perry!” shouted the scout, laying a course up the slope in the direction of the place where he had left his friends. Wild Bill, Nomad, and Dunbar could be seen descending the slope, their horses at top speed, to cover their pard’s retreat with Perry. Revolvers began to crack spitefully and leaden bees hissed through the air. The excitement of the moment, and the receding targets, caused every bullet to go wild.
  • 26. The fusillade was returned from up the slope, and the mounted cowboys who had taken up the pursuit, drew wary rein to make out the number and disposition of the enemies up the “rise.” And while they were hesitating and making their calculations, Buffalo Bill and Perry were pounding along and making good in their dash for freedom. “Whoop-ya!” roared old Nomad, while the scout and Perry drew closer up the slope, “le’s tear through ther tin-horn camp, pards, an’ raise Cain with a big ‘K!’ Le’s cut loose an’ show ’em our own partic’ler brand o’ destruction! Le’s give ’em er taste o’——” “Head the other way, quick!” shouted the scout, as he and Perry came thundering up. “Heels are trumps, pards, and see how quick you can play ’em.” Nomad yielded. When the scout ordered a move contrary to Nomad’s desires, he always yielded. In a galloping crowd, Dunbar, Wild Bill, Nomad, the scout and Perry swept over the top of the “rise” and into the scrub. Here they were joined by Jordan and Little Cayuse, and they skimmed the earth like a flock of low-flying birds. There was no time for talk, no time for anything but an occasional look behind and a frantic urging of the horses. Eight, nine, ten—a dozen mounted men flickered over the crest of the slope and settled themselves for what they evidently thought was to be a long chase. “Twelve up!” shouted the Laramie man. “Not so many, oh, not so many!” roared the old trapper. “We’re six! What’s two ter one? Waugh! Give ther word, Buffler, an’ we’ll turn on ’em.” But the scout did not give the word. There might be no more than twelve in sight, but under the “rise” were enough cowboys to literally overwhelm the scout’s small party.
  • 27. On went the race. Perry and Dunbar led the fugitives down into the timber, and there, where the scrub was thickest, there followed an exciting game of hare and hounds. Knowing the country well, Perry and Dunbar were able to take advantage of every friendly swale and shallow seam in the river bottom. In brushy coverts the fugitives waited for the dozen cowboys to rush past, then they doubled back, crossed the river, followed up the opposite bank, recrossed and paused for breath in a coulee. “Sufferin’ reptyles!” mourned old Nomad, slapping Hide-rack’s sweaty neck, “thet’s new bizness fer We, Us an’ Comp’ny, dodgin’ trouble thet-a-way. I hope I’ll forgive myself some time fer doin’ et.” “You’d have had to forgive yourself for not doing it, Nick,” returned the scout, dismounting to loosen his saddle cinches, “if we’d taken any other course. How many cowboys has Phelps got in his outfit, Perry?” “He can muster thirty men, I guess, without much trouble,” answered Perry. “All of that,” seconded Dunbar. “It is well we took to our heels, friends,” spoke up the sky pilot. “If any blood had been shed, it would have been a blot on our consciences.” “Ef we took on er few blots,” said Nomad, “I reckon we’d crimp them barons an’ save future trouble fer Perry.” Cayuse, thoughtful as ever, had left Navi in the bottom of the coulee and crept up the bank to watch for enemies. Lying on the slope, only his head and the upright eagle plume in his scalplock showed over the crest. All had dismounted and loosened cinches in order to give their panting horses more freedom in using their lungs.
  • 28. “Dick,” said the sky pilot, reaching out his hand to the harassed rancher, “I’m sorry you are having this trouble, but I always feared it would come to something like this.” “There was nothing I could do to help it, parson,” answered Perry, “short of leaving the country. I couldn’t do that, with all I’ve got in the world tied up at the Star-A.” “It is my hope, my prayer, that you will be tided over your difficulties. If that can be accomplished, these good friends will see to it, I’m sure.” “I’m obliged to Buffalo Bill and his pards. How they came to be mixed up in my troubles is more than I know. I want to know all about it, but first, tell me about Hattie. How do you know she has been taken away by Lige Benner? When did it happen?” “Last night, Dick,” answered Dunbar heavily. “Where were you yesterday, Nate?” “Captured by some of Benner’s men while I was out looking for strays, turned over to Red Steve, then found and released by Buffalo Bill. That was in the first half of the night. The scout and I rode to the ranch and found everything in the living room in disorder—and Hattie gone.” A groan was wrenched from Perry’s lips. “Has it come to this,” he cried, “that these scoundrels must make war on women?” His tortured soul found vent in language that shocked the minister’s ears. “Peace, friend,” said Jordan. “You have much to be thankful for. You are not yourself. Try to be composed.” “How did you fall into the hands of Phelps?” asked the scout, more to get the rancher’s mind to running in another channel than anything else.
  • 29. “I went looking for Nate,” was the answer, “and some of Phelps’ men roped me in the timber. The noose dropped before I could avoid it, and I was jerked from the back of my horse. They took me to the H-P ranch yesterday noon, and Phelps went to Hackamore to see Benner, report, and get him to send after me. Benner rode over this morning with an escort of cowboys. The plan was to take me to Benner’s ranch, but Phelps and Benner got to drinking and, before we started, Buffalo Bill came.” Perry turned on the scout, his eyes wide with wonder. “Buffalo Bill,” said he, “if any one had told me that it was possible for a man to do what you did at Phelps’ this morning I would not have believed it. In all my life I never saw such a nervy piece of work.” Old Nomad began to chuckle. “It won’t be long, amigos,” he remarked, “afore these hyar cattle barons o’ ther Brazos’ll begin ter git acquainted with Buffler Bill. None o’ Buffler’s pards stack up ter his level, but, ef I do say et, I reckon we reach purty middlin’ high.” “What did you do, pard?” asked Wild Bill. “I corrected the mistake which the clerk at the hotel made last evening,” laughed the scout. “Meaning which?” “Why, I gave Benner the handcuffs.” “With his revolver,” put in Perry, “he forced the two cattle barons to stand back to back, and then he handcuffed their wrists together. He finished the work by putting the noose of a riata around their feet. And that’s the way we left them!” “I came away,” added Buffalo Bill, “and forgot to leave the key to the bracelets, so——” Old Nomad was a minute or two grasping the situation the scout had caused in Phelps’ cabin. Just at this point it broke over him, and
  • 30. he leaned against Hide-rack and bellowed with mirth. “Say,” he sputtered, “this hyar reminds me some o’ ther way Buffler went inter the Sioux kentry an’ took ole Lightnin’-thet-strikes right out from ther middle o’ his band. Waugh! Er-waugh! An’ our pard left them fellers back ter back, handcuffed ter each other, an’ with their men thicker eround ’em than what fleas is in ole Siskiyou county! I’d like ter lay off fer a hull day an’ enjoy thinkin’ erbout thet. I would so!” “That was just my kind of a play,” commented Wild Bill regretfully. “Wish I could have been in on it myself.” “Let me know, Buffalo Bill,” requested Perry, “how you knew I was at the H-P ranch? Phelps was trying to keep that quiet.” The scout explained in a few words. “Certainly,” murmured Perry, “I ought to be thankful that I have friends like you and your pards to lend me a helping hand at this critical time. Every man on the Brazos seems to have been against Dunbar and me!” “Not every man, Dick,” protested Jordan. “Only Benner and Phelps are really against you. The rest of the cattlemen are so completely dominated by Benner and Phelps that they don’t dare take sides with you openly.” “We know the stake Benner is playing for,” said Wild Bill, “but what does Phelps hope to make out of this rascally work?” “For one thing,” replied Perry, “Phelps wants the Star-A range. He tried to buy out the man who sold to me. Maybe it would have been better if I had gone elsewhere for a location and let Phelps have the Star-A range. We can never tell about these things until it’s too late.” “Then, too,” spoke up Jordan, “Phelps is a bosom friend of Benner’s. That’s the principal reason, I suppose, why he’s taking a part in this rascally work. But prosperity is back of it all—too much prosperity for men who do not understand how to make the best use of their wealth.”
  • 31. “Isn’t there something we can do for Hattie?” asked Perry tremulously. “Must we stay cooped up in this coulee, guarding against an attack from the H-P outfit, while my girl is in the hands of that scoundrel, Benner?” “We’re going to do something for Miss Perry, amigo,” returned the scout, “and we’ll start the ball to rolling just as soon as we can decide what’s to be done. If your daughter had been at the H-P ranch, you’d have discovered it, I think. And I don’t believe Benner would have her taken to his place. Is there any one else besides Red Steve on whom Benner could depend for help in dealing with Miss Perry?” “There’s Fritz Dinkelmann,” suggested Dunbar. “That Dutchman and his wife owe Benner money, and while I think Fritz is as honest as the usual run of men, still, being in debt head over ears to Benner he might be forced to——” “Dinkelmann, Dinkelmann!” muttered Wild Bill. “Say, Nick, wasn’t that the Dutchman our Dutch pard went to see? Wasn’t it Dinkelmann who——” A call came from Cayuse. As he shouted, he beckoned those below to come up the slope and see with their own eyes something he had discovered. What the pards saw, peering over the crest of the coulee bank, sent the hot blood pounding through their veins. “It’s the baron—our Dutch pard!” shouted Wild Bill; “the fellow we were just talking about, Perry!” “There’s a woman with him,” faltered Perry; “can it be—on my soul, I think it is——” “Yes,” breathed Dunbar hoarsely, “it’s Hattie, Dick! I can see her plain. An’ behind the two are a score or two of cowboys from Benner’s ranch, and from the H-P outfit. They outnumber us, but we’ve got to do something! We can’t stand here like this.”
  • 32. Dunbar whirled around and rushed stumbling down the slope toward the horses. “How Benner and Phelps ever got out of those come-alongs so quick is more than I know,” muttered the scout, “but they’re leading those cowboys in the pursuit of the baron and the girl. Spurs and quirts, pards! We’re company front with one of the hardest jobs we ever tackled, but, as Dunbar says, we’ve got to make a move.” No second urging was needed. Every one followed Dunbar down the slope, cinches were swiftly tightened, and the whole party mounted and rode away to the help of the baron and the girl.
  • 33. CHAPTER IX. D U TC H C O U R A G E . It has been said early in this chronicle, that Chance made a triple blunder. In one corner of the triangle was Buffalo Bill, dropping through the roof of Red Steve’s dugout and effecting the release of Nate Dunbar; in another corner was Wild Bill, watching a queer contest of watch throwing and finding a scrap of paper which ultimately led to the relief of Dick Perry; and in the third corner was Villum von Schnitzenhauser, lured from the rest of his pards by the prospect of a talkfest with Fritz Dinkelmann. The baron had heard of Fritz Dinkelmann at the house of a small rancher where he, and Wild Bill, and old Nomad, and Little Cayuse had halted for an hour on their journey toward Hackamore. The rancher had mentioned Dinkelmann in an off-hand way, and the baron had pressed inquiries. Dinkelmann had been on the Brazos for ten years. Everybody in that section knew him, and knew how he had borrowed and borrowed from Lige Benner, until Benner had secured every head of the Dutchman’s stock and a mortgage on his land and the cabin roof that sheltered himself and his wife. Dinkelmann had been in the German army, and carried honorable wounds—mementos of the Franco-Prussian War. This mention of Dinkelmann’s army experience was what stirred the baron most deeply; for the baron himself had served his time in the kaiser’s ranks, and had won the Order of the Black Eagle for bravery on the field. Yes, certainly, the baron would have to see Dinkelmann and engage in a talkfest. It would be some time before Buffalo Bill could reach Hackamore from Texico, and the baron could pass the night at
  • 34. Dinkelmann’s and get to Hackamore before the scout reached the town. It was nine o’clock in the evening when the baron, having lost and found himself at least a dozen times, first sighted the glow of light in Dinkelmann’s cabin, rode up to the door and leaned down from his saddle to knock. A buxom lady answered his summons, starting back in trepidation when she found the baron’s mule bulked across the entrance. “Iss Misder Dinkelmann in der house, yes?” inquired the baron. “Yah,” replied the buxom lady, but not with much enthusiasm. “Meppy you peen Frau Dinkelmann, yes, no?” “Yah.” “Vell, I peen Deutsch meinseluf, und I rite seferal miles oudt oof my vay schust for a leedle talk mit friendts from Chermany.” “For vy you nod shpeak der Deutsche sprache?” inquired Frau Dinkelmann skeptically. “Pecause I dry hardt to make some berfections in der English.” The baron, however, in order to prove that he was not an impostor, rattled away in his native tongue. Herr Dinkelmann was in the cabin, but he was not feeling well. He was a good-for-nothing, the herr, and he was not brave enough to call his soul his own except when he was at his schnapps. Would the baron put up his mule in the corral behind the house, and come in? The baron would—and did. He found the interior of the house a bare enough place. There were two chairs and a lounge in the front room, and a table on which stood the lamp. Herr Dinkelmann was stretched out on the lounge. He was a short, fat man and seemed in great distress over something.
  • 35. “Ged oop, you lazy lout, und see vat iss come already!” cried Frau Dinkelmann. “A visidor has come py us, und you peen so drunk like nodding. Fritz! Ged oop yourseluf und sit der lounge on, den look vat you see. A visidor yet.” Frau Dinkelmann talked English, perhaps out of deference to the baron, perhaps only because she wanted to show him that she also was proficient in foreign tongues. As she talked to Fritz, she grabbed him and heaved him bodily into a sitting position. “Vat a fool I don’d know!” puffed Frau Dinkelmann. “Macht schnell, Fritz! Lieber Gott, vill you your eyes oben und see vat iss here?” A groan escaped Fritz Dinkelmann’s lips. His eyes opened and he saw the baron’s hand. Grabbing at the hand, he clung to it with a fervor that almost threw him off the lounge. “Safe me!” he blubbered; “safe me or I vill die! Vere vas it put you der schnapps, Katrina? Liebe Frau, gif me der pottle some more yet.” Katrina stood in front of him and stuck up an admonitory finger. “Hear me vat I say now und reflect,” she cried. “I gif you nod der pottle some more yet to-nighdt. Dot’s all aboudt it. You make oof yourseluf some pigs, some mules, ven you der schnapps trink so great. It iss nod dot he loves der trink so,” she explained to the baron, “aber dot he vants it der Dutch courage vat you call. He iss troubles in, ve art bot’ troubles in, lieber Gott, und he takes der schnapps to forget him der troubles. Vat a nonsense.” “I haf hat drouples meinseluf, yah, so helup me,” said the baron, “aber I look dem in der eyes und face dem oudt. Vat’s der use to trink und make some forgeddings? Der drouples vas dere alretty, ven ter trink iss gone. Fritz, mein lieber freund, douple der fist oop und knock der drouples oudt oof der vay.” Fritz moaned and tried to slump back on the lounge.
  • 36. “I don’d got it some nerve to knock me my drouples oudt mit der fist. Liebe Frau——” But Katrina had grabbed him and pushed him back to a sitting posture. “Iss it to dreat a visidor righdt you act like dot?” she cried. “I vill handt you vone auf der kopf oof you don’d make some vakings oop und act mit resbect.” “Vat iss der name?” asked Fritz, displaying a feeble interest in the baron. “Villum, Baron von Schnitzenhauser,” answered the baron. “Vat iss der madder? Some oof der shildren sick?” “Kindern ve haf none,” answered Fritz. “Haf you some cattles on der range?” “Cattles ve haf nod, neider kinder. Ach, du lieber, vat a hardt time I don’d know. I dry to do der righdt t’ing mit eferypody, und pecause I owe Penner, he makes me do der wrong t’ing, oder he takes from Katrina und me avay der leedle house vere ve lif.” “Shut oop such talks!” cried Katrina. “Der Dutch courage don’d make some helps mit you. I go by der kitchen now to ged us der paron some subber. Shpeak mit him, Fritz, vile I peen avay.” “Liebe Frau,” begged Fritz, stretching out his hands, “gif us first der schnapps.” She struck his hands aside. “Macht ruhig aboudt der schnapps, oder I vill der pottle preak on der shtones,” she cried angrily. With that, she lost herself in the rear room. The baron tried to talk with Fritz, but it was impossible to get much out of him. Even a mention of the German army failed to arouse any interest in the distressed Dutchman. Finally Fritz slumped back on the lounge and began to snore.
  • 37. The baron would have been disgusted but for the fact that some great sorrow was preying upon the unfortunate Dinkelmann. He craved his schnapps to give him strength to bear his trials. Frau Dinkelmann, it was clear, didn’t believe in Dutch courage. What was all the bother about? the baron asked himself. If it was the loss of cattle or a mortgage on the home that grieved and fretted his countryman, the baron would not have had much sympathy for him. The baron liked to see a man act in a manly way, face his misfortunes, and walk over them to peace, plenty, and happiness. But there was something besides the loss of cattle and the mortgage on Dinkelmann’s mind. While Dinkelmann snored, and his wife moved around in the kitchen, the baron smoked, and tried to guess out the problem. He was almost sorry he had not gone on to Hackamore with Nomad, Wild Bill, and Little Cayuse. Had he known the trail better, he would have excused himself and started out without waiting for supper. But he had lost his way so many times coming to Dinkelmann’s that he was afraid to attempt the unknown country by night. While he sat and mused, he became conscious of a slight tapping, as of knuckles lightly drumming against a door. He started forward in his chair, and stared around. There were only three doors to that room—one at the front entrance, one leading into the kitchen, and another opening off to the right. The tapping came from the other side of the door on the right. What did it mean? The baron sat and studied over the remarkable phenomenon until a shuffling sound struck on his ears. When that commenced, the knocking ceased. Under the baron’s astounded eyes a bit of white cloth was showing itself beneath the door which had so mysteriously claimed his attention. Some one, it seemed, was trying to push the piece of cloth through into the living room.
  • 38. Softly the baron arose, crossed to the door, bent down, and pulled the cloth away. It was a small handkerchief. Turning it over in his hand, he saw that there was writing in pencil on one side of it. The plot was thickening! The baron, overjoyed to find a little excitement where he had expected nothing more than a talkfest, sat down again, spread the handkerchief out on his knee, and puzzled his brain over the following: “Stranger: Will you be a friend to a woman in distress? I am being detained in this room against my will. I must escape and go back to my home. The horse that brought me should be in the corral. The window of the room is boarded up on the outside, but the boards can be easily removed.” Had the writing been in German, the baron would not have been long in deciphering it, but it was in English and, in places, almost illegible. However, he managed to get at the gist of the communication. A flutter of joy ran through him. Here was an adventure! And the baron could not live and be happy unless adventures were constantly piling in upon him. From the moment the baron had deciphered the writing on the handkerchief, and had made up his mind to act upon the request of the imprisoned lady, he found nothing monotonous in his surroundings. When Frau Dinkelmann asked him to come out into the kitchen and have some supper, he stuffed the handkerchief into his pocket, and moved with alacrity into the rear room. Frau Dinkelmann, sitting on the opposite side of the table while the baron ate, talked unceasingly in the German language. The baron, even if he had been so inclined, could hardly have got a word
  • 39. in edgeways. But he wasn’t anxious to talk. He listened mechanically, and ate mechanically. His mind was busy with the imprisoned lady who had sent him a penciled appeal on her handkerchief. “I vonder iss she young?” thought the baron; “und is she goot- looking? Und vill she be gradeful oof I safe her from der Dinkelmann house?” So far as the mere adventure went, the baron was not particular whether the lady was young or good-looking. But, if she happened to be both, the glamor of romance might be added to the undertaking. “You vill shday der house in till morning?” inquired Frau Dinkelmann, dropping back into her English as the baron arose from the table. “Could I talk mit Fritz in der morning?” he asked. “Vill he feel pedder mit himseluf den?” “Yah, so. You shday und you can talk mit Fritz all vat you blease. I make you a bed der floor on.” “I don’d like to shleep in der house,” demurred the baron. “I like pedder der oudttoors as a shleeping blace. I drafel mit fellers vat shleep oudtoors all der time, und I have got used to it.” The baron was cunning. He knew that if he was supposed to be sleeping outdoors he would have a chance to examine the boarded- up window without arousing Frau Dinkelmann. He could also find the lady’s horse, and get both the horse and Toofer, the mule, ready for the road. “Dere iss hay py der corral,” said Frau Dinkelmann. “Den,” said the baron, going into the front room for his hat, “I vill shmoke, und shleep on der hay. Vat iss der preakfast time?” “Sigs o’glock, oder venefer you retty vas for vat ve haf. Gott sei dank, ve got somet’ing to eat.”
  • 40. Bidding Frau Dinkelmann good night, the baron left the house by the kitchen door, rounded the corner of the building, and crept stealthily to the boarded-up window. Lightly he tapped on the boards. A tapping on the other side of the barrier answered him. The baron breathed quick and hard. What would Nomad and Wild Bill not have given to be mixed up in such an adventure? Ach, du lieber, but he was a lucky Dutchman! After making sure that the lady had heard, and that she understood he would come to her rescue, the baron fell to examining the boards that closed up the opening. They had been stoutly spiked to the side of the house. In prying them away, it would be necessary to use an axe, and there would be considerable noise. The baron would have to wait until Frau Dinkelmann was fast asleep. Even then there was a chance that she would be aroused by his attack on the boards, but, if she was, he would rescue the lady anyway, and in spite of both the Dinkelmanns. The baron preferred, however, to rescue the lady quietly, and to get away from the house with her without making a scene with the muscular frau. Leaving the cabin, he went to the woodpile and found an axe. This he carried to the window, and laid on the ground beneath it, where it would be conveniently at hand when the time came to remove the boards. His next move was to go to the corral and look for the horse and the lady’s riding gear. He found both, and was not long in getting the horse and Toofer accoutred for the flight. Leading the animals out of the corral, he hitched them to a post where they would be ready for use at a moment’s notice; then he stealthily approached the cabin, and peered through the window of the living room.
  • 41. He was disappointed. Frau Dinkelmann was wide awake. She had drawn a chair in front of the door leading into the prison chamber, and was sitting in it. She was knitting. Across her ample lap, the ball of yarn dancing around it as it unrolled, lay an old-fashioned pistol with a bright brass cap under the hammer. The baron wondered if Frau Dinkelmann suspected that he was planning to assist the imprisoned lady. She was there on guard, that was evident. Impatiently the baron went back to the corral. Sitting on a forkful of hay and leaning against the corral fence, he smoked three pipes very slowly, and again went to the house and stole a look through the window. There was the frau, vigilant as ever, her needles flying and the ball dancing up and down the barrel and stock of the old pistol. “Py shinks,” thought the baron, “vat oof she shdays dere all nighdt?” The baron wasn’t afraid of the pistol—not for himself, but the lady would be endangered if he tried to take her away in spite of the watchful frau. No, it would be better to wait until Frau Dinkelmann was sound asleep. The baron returned to his place by the corral fence. Sitting down as before, he leaned back, and tried to beguile the tedious wait by wondering who the lady was, why she had been imprisoned in the house, and whether or not it was she who weighed so heavily on Fritz Dinkelmann’s mind. Then, being tired, and growing confused over his knotty reflections, quite naturally he fell asleep. When he opened his eyes again, a dingy gray light tinged the sky in the east. For a moment he blinked; then, with a muttered exclamation, he jumped to his feet.
  • 42. “Himmelblitzen!” he gasped. “I haf shlept all der nighdt, und now it iss gedding tay! Dit I tream dot aboudt der laty vat vants to be resgued?” His troubled eyes wandered toward the cabin, and then back to a post by the corral. No, he had not dreamed about the lady. There, plainly before his eyes, was the boarded-up window, and here, hitched to the corral post, stood the weary horse and the mule. Softly the baron made his way to the living-room window, and peered through. The lamp, burning dimly, cast a sickly light over the room. In the chair in front of the door still sat the frau, but her knitting lay in her lap, and her head was bowed forward in slumber. Hastily the baron passed to the rear of the house, picked up the axe, and pried at the boards covering the window. The first one came away with such a crash that he felt sure Frau Dinkelmann must have heard the noise. But, no. There was no sound in the living room to bolster up his fears. He went to work at the second board, and got it off much more quietly than he had the first. It was not necessary to remove any more. A woman’s face appeared in the opening he had made, and a slender form forced itself through the breach and dropped to the ground at his side. “Oh, thank you, thank you!” said the woman, catching one of the baron’s hands in both her own. The baron’s heart fluttered. She was young and beautiful—and he had saved her from the Dinkelmanns! “Dot’s all righdt, lady,” said the baron, throwing out his chest, “making resgues like dose vas my long suit. I peen a bard oof Puffalo Pill’s, und I learned how to do dot mit him. You know Puffalo Pill, yes?”
  • 43. “I have heard of him,” the girl answered. For the first time the baron noticed that the girl’s face, though very pretty, was haggard and worn. “Ach,” he murmured sympathetically, “you haf hat some hardt times, I bed you! Vat iss your name?” “Hattie Perry.” “Vat a pooty name! Haddie Berry! I like dot name. Vere you vant to go, Miss Berry? Schust shpeak der vort, und it iss my law.” “I want to go back to my father’s ranch,” said the girl, her voice trembling. “Dot’s vere ve vill go, you bed you. Iss it far avay?” “About three hours’ ride, if we hurry.” “Den ve vill hurry fasder as dot und make it in an hour and a haluf,” laughed the baron. “Meppyso ve hat pedder ged avay mit ourselufs. Der olt laty insite der house has a bistol, und I don’d vant her to vake oop mit herseluf und see us pefore ve ged a gouple oof miles from here. Aber vait.” The baron reached into his pocket and pulled out three twenty- dollar gold pieces. Reaching his hand inside the window, he laid the gold pieces on the sill back of the boards. “Why did you do that?” asked the girl curiously. “Dot’s somet’ing for der Dinkelmanns,” replied the baron. “I bed you dey don’t got mooch, und I don’d pelieve dey are as pad as vat some beobles mighdt t’ink. Now, den, Miss Berry, off ve go for der ranch vere you lif ven you are ad home.” They hurried to the place where the animals had been hitched. The baron untied both mounts, he and the girl got into their saddles, and in a few minutes they were moving briskly along the timbered bank of the Brazos.
  • 44. The baron felt like bursting into song. But he wanted to make a good impression on the girl—and he knew he couldn’t sing.
  • 45. CHAPTER X. I N T R O U B L E D WAT E R S. The dawn gave way to morning, and the sun rose while the baron and the girl were pushing on toward the Star-A ranch. The girl piloted their course, and lost a good deal of time giving a ranch, whose buildings stood on a tongue of land half encircled by the river, a wide berth. “For vy you do dot?” asked the baron. He had not, up to that moment, asked the girl any questions about herself. Fully two hours had passed since they had left the Dinkelmann cabin, and not half a dozen words had been exchanged between him and the girl. “A man lives there who is an enemy of my father’s,” the girl answered. “He is a cattle baron, and his name is Phelps.” “I peen some parons meinseluf,” said the Dutchman, “aber I don’d got some cattle. Iss he a pad feller, dis cattle paron?” “Yes; fully as unscrupulous as that other cattle baron whose name is Benner.” “Vat a lod oof cattle parons, und all pad eggs. Vell, vell, nefer mindt. Vere vas you ven der Dinkelmanns gaptured you, Miss Berry?” “It wasn’t the Dinkelmanns who captured me, but some of Benner’s cowboys.” “Ach, aber I vish I hat peen aroundt dot time! Vere dit it habben?” “At the ranch. Nate had gone away early to look for some stray cattle. He didn’t come back when he said he would, and father went to hunt him up. Father didn’t come back either, and I was in the
  • 46. house reading when—when—when Benner’s cowboys came. I fought to get away from them, but there were two of them, and what could I do? They took me to Fritz Dinkelmann’s, and I was told that Benner was coming to see me this morning. Oh, but I am glad you came to my aid, Mr. von Schnitzenhauser!” “So am I glad,” said the baron, “more glad as I can tell. Vy ditn’t you dry und knock der poards off from der insite, huh?” “I did try—but I had only my hands.” She lifted her hands to show him how they had been bruised and scratched. “Ach, sure,” said the baron, “you couldn’t haf got oudt oof dot blace mitoudt an axe, same as vat I hat.” “When I heard you come to the house last night,” the girl went on, “I made up my mind to see if you would befriend me. I was lucky in happening to have that bit of lead pencil in my pocket, and the handkerchief served very well for something to write on. I waited until I knew Mrs. Dinkelmann was in the kitchen, and then I tapped on the door to attract your attention, and began pushing the handkerchief through. I can’t begin to tell you how glad I was when I heard you rap on the boards at the window, but you were a long time getting me out.” “Id vasn’t safe to dry it sooner,” explained the baron, keeping quiet about the way he went to sleep; “der olt laty vas on guard mit der bistol. Ach, vat a big bistol id vas! Und I bed you id shoots like anyding.” “Well,” sighed the girl, “I am safely away from the house, and I shall soon be at home now.” “You bed someding for nodding aboudt dot. Aber tell me vonce: Iss dot Dinkelmann a pad feller?” “No, I don’t think he is, baron. He owes Benner money, though, and Benner forces Dinkelmann to do things that are not right. Dinkelmann is more to be pitied than condemned. He——”
  • 47. Welcome to our website – the perfect destination for book lovers and knowledge seekers. We believe that every book holds a new world, offering opportunities for learning, discovery, and personal growth. That’s why we are dedicated to bringing you a diverse collection of books, ranging from classic literature and specialized publications to self-development guides and children's books. More than just a book-buying platform, we strive to be a bridge connecting you with timeless cultural and intellectual values. With an elegant, user-friendly interface and a smart search system, you can quickly find the books that best suit your interests. Additionally, our special promotions and home delivery services help you save time and fully enjoy the joy of reading. Join us on a journey of knowledge exploration, passion nurturing, and personal growth every day! testbankfan.com