100% found this document useful (4 votes)
15 views

(eBook PDF) Introduction to Java Programming and Data Structures, Comprehensive Version, 11th Global Edition pdf download

Ebook access

Uploaded by

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

(eBook PDF) Introduction to Java Programming and Data Structures, Comprehensive Version, 11th Global Edition pdf download

Ebook access

Uploaded by

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

(eBook PDF) Introduction to Java Programming and

Data Structures, Comprehensive Version, 11th


Global Edition download

https://ebookluna.com/product/ebook-pdf-introduction-to-java-
programming-and-data-structures-comprehensive-version-11th-
global-edition/

Download full version ebook from https://ebookluna.com


We believe these products will be a great fit for you. Click
the link to download now, or visit ebookluna.com
to discover even more!

(eBook PDF) Introduction to JAVA Programming and Data Structures


Comprehensive Version 11

https://ebookluna.com/product/ebook-pdf-introduction-to-java-programming-
and-data-structures-comprehensive-version-11/

(eBook PDF) Introduction to Java Programming, Brief Version, Global Edition


11th Edition

https://ebookluna.com/product/ebook-pdf-introduction-to-java-programming-
brief-version-global-edition-11th-edition/

Introduction to Java Programming, Comprehensive Version 10th edition- eBook


PDF

https://ebookluna.com/download/introduction-to-java-programming-
comprehensive-version-ebook-pdf/

(eBook PDF) Java Foundations: Introduction to Program Design and Data


Structures 5th Edition

https://ebookluna.com/product/ebook-pdf-java-foundations-introduction-to-
program-design-and-data-structures-5th-edition/
(eBook PDF) Data Structures and Abstractions with Java 4th Global Edition

https://ebookluna.com/product/ebook-pdf-data-structures-and-abstractions-
with-java-4th-global-edition/

(eBook PDF) Data Structures and Abstractions with Java 4th Edition

https://ebookluna.com/product/ebook-pdf-data-structures-and-abstractions-
with-java-4th-edition/

Data Structures and Abstractions with Java 5th Edition (eBook PDF)

https://ebookluna.com/product/data-structures-and-abstractions-with-
java-5th-edition-ebook-pdf/

(eBook PDF) Data Structures and Other Objects Using Java 4th Edition

https://ebookluna.com/product/ebook-pdf-data-structures-and-other-objects-
using-java-4th-edition/

(eBook PDF) Data Structures and Problem Solving Using Java 4th Edition

https://ebookluna.com/product/ebook-pdf-data-structures-and-problem-
solving-using-java-4th-edition/
6 Preface

Part I: Fundamentals of Part II: Object-Oriented Part III: GUI Programming Part IV: Data Structures and Part V: Advanced Java
Programming Programming Algorithms Ch 16 Programming
Chapter 1 Introduction to Chapter 9 Objects and Classes Chapter 14 JavaFX Basics Ch 7 Chapter 18 Recursion Chapter 32 Multithreading and
Computers, Programs, and Parallel Programming
Java
Chapter 10 Thinking in Objects Chapter 15 Event-Driven Ch 13 Chapter 19 Generics
Programming and Chapter 33 Networking
Chapter 2 Elementary Animations
Chapter 11 Inheritance and Chapter 20 Lists, Stacks, Queues,
Programming
Polymorphism and Priority Queues Chapter 34 Java Database
Chapter 16 JavaFX Controls Programming
Chapter 3 Selections and Multimedia
Chapter 12 Exception Chapter 21 Sets and Maps
Handling and Text I/O Chapter 35 Advanced Database
Chapter 4 Mathematical Chapter 31 Advanced JavaFX Programming
Chapter 22 Developping
Functions, Characters, Chapter 13 Abstract Classes and FXML Efficient Algorithms
and Strings and Interfaces Chapter 36 Internationalization
Chapter 23 Sorting
Chapter 5 Loops Chapter 17 Binary I/O Chapter 37 Servlets
Chapter 24 Implementing Lists,
Chapter 6 Methods Stacks, Queues, and Priority Chapter 38 JavaServer Pages
Queues

Chapter 7 Single-Dimensional Chapter 39 JavaServer Faces


Arrays Chapter 25 Binary Search Trees
Chapter 40 RMI
Note: Chapters 1–18 are in the
Chapter 8 Multidimensional Chapter 26 AVL Trees
brief version of this book.
Arrays Chapter 41 Web Services
Note: Chapters 1–30 are in the Chapter 27 Hashing
comprehensive version.

Note: Chapters 31–44 are bonus Chapter 28 Graphs and


chapters available from the Applications
Companion Website.

Chapter 29 Weighted Graphs


and Applications

Chapter 30 Aggregate Operations


and Collection Streams

Chapter 42 2-4 Trees and B-


Trees

Chapter 43 Red-Black Trees Ch 9 Chapter 44 Testing Using JUnit


Preface  7

Organization of the Book


The chapters can be grouped into five parts that, taken together, form a comprehensive introduc-
tion to Java programming, data structures and algorithms, and database and Web programming.
Because knowledge is cumulative, the early chapters provide the conceptual basis for under-
standing programming and guide students through simple examples and exercises; subsequent
chapters progressively present Java programming in detail, culminating with the development
of comprehensive Java applications. The appendixes contain a mixed bag of topics, including an
introduction to number systems, bitwise operations, regular expressions, and enumerated types.

Part I: Fundamentals of Programming (Chapters 1–8)


The first part of the book is a stepping stone, preparing you to embark on the journey of learning
Java. You will begin to learn about Java (Chapter 1) and fundamental programming t­echniques
with primitive data types, variables, constants, assignments, expressions, and operators (­Chapter 2),
selection statements (Chapter 3), mathematical functions, characters, and strings (Chapter 4), loops
(Chapter 5), methods (Chapter 6), and arrays (Chapters 7–8). After ­Chapter 7, you can jump to
Chapter 18 to learn how to write recursive methods for solving inherently recursive problems.

Part II: Object-Oriented Programming (Chapters 9–13, and 17)


This part introduces object-oriented programming. Java is an object-oriented programming
language that uses abstraction, encapsulation, inheritance, and polymorphism to provide
great flexibility, modularity, and reusability in developing software. You will learn program-
ming with objects and classes (Chapters 9–10), class inheritance (Chapter 11), polymorphism
(­Chapter 11), exception handling (Chapter 12), abstract classes (Chapter 13), and interfaces
(Chapter 13). Text I/O is introduced in Chapter 12 and binary I/O is discussed in Chapter 17.

Part III: GUI Programming (Chapters 14–16 and Bonus Chapter 31)
JavaFX is a new framework for developing Java GUI programs. It is not only useful for
developing GUI programs, but also an excellent pedagogical tool for learning object-oriented
programming. This part introduces Java GUI programming using JavaFX in Chapters 14–16.
Major topics include GUI basics (Chapter 14), container panes (Chapter 14), drawing shapes
(Chapter 14), event-driven programming (Chapter 15), animations (Chapter 15), and GUI
­controls (Chapter 16), and playing audio and video (Chapter 16). You will learn the a­ rchitecture
of JavaFX GUI programming and use the controls, shapes, panes, image, and video to develop
useful applications. Chapter 31 covers advanced features in JavaFX.

Part IV: Data Structures and Algorithms (Chapters 18–30 and Bonus Chapters 42–43)
This part covers the main subjects in a typical data structures and algorithms course. Chapter 18
introduces recursion to write methods for solving inherently recursive problems. Chapter 19 presents
how generics can improve software reliability. Chapters 20 and 21 introduce the Java Collection
Framework, which defines a set of useful API for data structures. Chapter 22 discusses measur-
ing algorithm efficiency in order to choose an appropriate algorithm for applications. Chapter 23
describes classic sorting algorithms. You will learn how to implement several classic data struc-
tures lists, queues, and priority queues in Chapter 24. Chapters 25 and 26 introduce binary search
trees and AVL trees. Chapter 27 presents hashing and implementing maps and sets using hashing.
Chapters 28 and 29 introduce graph applications. Chapter 30 introduces aggregate operations for
collection streams. The 2-4 trees, B-trees, and red-black trees are covered in Bonus Chapters 42–43.

Part V: Advanced Java Programming (Chapters 32-41, 44)


This part of the book is devoted to advanced Java programming. Chapter 32 treats the use of
multithreading to make programs more responsive and interactive and introduces parallel pro-
gramming. Chapter 33 discusses how to write programs that talk with each other from different
8 Preface
hosts over the Internet. Chapter 34 introduces the use of Java to develop database projects.
Chapter 35 delves into advanced Java database programming. Chapter 36 covers the use of
internationalization support to develop projects for international audiences. Chapters 37 and
38 introduce how to use Java servlets and JavaServer Pages to generate dynamic content from
Web servers. Chapter 39 introduces modern Web application development using JavaServer
Faces. Chapter 40 introduces remote method invocation and Chapter 41 discusses Web ser-
vices. Chapter 44 introduces testing Java programs using JUnit.

Appendixes
This part of the book covers a mixed bag of topics. Appendix A lists Java keywords. ­Appendix B
gives tables of ASCII characters and their associated codes in decimal and in hex. Appen-
dix C shows the operator precedence. Appendix D summarizes Java modifiers and their usage.
Appendix E discusses special floating-point values. Appendix F introduces number systems and
conversions among binary, decimal, and hex numbers. Finally, Appendix G introduces bitwise
operations. Appendix H introduces regular expressions. Appendix I covers enumerated types.

Java Development Tools


You can use a text editor, such as the Windows Notepad or WordPad, to create Java programs
and to compile and run the programs from the command window. You can also use a Java
development tool, such as NetBeans or Eclipse. These tools support an integrated develop-
ment environment (IDE) for developing Java programs quickly. Editing, compiling, building,
executing, and debugging programs are integrated in one graphical user interface. Using these
tools effectively can greatly increase your programming productivity. NetBeans and Eclipse
IDE tutorials are easy to use if you follow the tutorials. Tutorials on NetBeans and Eclipse can be found in
the supplements on the Companion Website www.pearsonglobaleditions.com/Liang.

Student Resources
The Companion Website (www.pearsonglobaleditions.com/Liang) contains the following
resources:
■■ Answers to CheckPoint questions
■■ Solutions to majority of even-numbered programming exercises
■■ Source code for the examples in the book
■■ Interactive quiz (organized by sections for each chapter)
■■ Supplements
■■ Debugging tips
■■ Video notes
■■ Algorithm animations

Supplements
The text covers the essential subjects. The supplements extend the text to introduce additional
topics that might be of interest to readers. The supplements are available from the Companion
Website.
Preface  9

Instructor Resources
The Companion Website, accessible from www.pearsonglobaleditions.com/Liang, contains the
following resources:
■■ Microsoft PowerPoint slides with interactive buttons to view full-color, syntax-highlighted
source code and to run programs without leaving the slides.
■■ Solutions to a majority of odd-numbered programming exercises.
■■ More than 200 additional programming exercises and 300 quizzes organized by ­chapters.
These exercises and quizzes are available only to the instructors. Solutions to these
­exercises and quizzes are provided.
■■ Web-based quiz generator. (Instructors can choose chapters to generate quizzes from a
large database of more than two thousand questions.)
■■ Sample exams. Most exams have four parts:
■■ Multiple-choice questions or short-answer questions
■■ Correct programming errors
■■ Trace programs
■■ Write programs
■■ Sample exams with ABET course assessment.
■■ Projects. In general, each project gives a description and asks students to analyze, design,
and implement the project.
Some readers have requested the materials from the Instructor Resource Center. Please
understand that these are for instructors only. Such requests will not be answered.

Online Practice and Assessment


with MyProgrammingLab
MyProgrammingLab helps students fully grasp the logic, semantics, and syntax of program-
ming. Through practice exercises and immediate, personalized feedback, MyProgrammingLab
improves the programming competence of beginning students who often struggle with the
basic concepts and paradigms of popular high-level programming languages.
A self-study and homework tool, a MyProgrammingLab course consists of hundreds of small
practice problems organized around the structure of this textbook. For students, the system auto-
matically detects errors in the logic and syntax of their code submissions and offers targeted hints
that enable students to figure out what went wrong—and why. For instructors, a comprehensive
gradebook tracks correct and incorrect answers and stores the code inputted by students for review.
MyProgrammingLab is offered to users of this book in partnership with Turing’s Craft, the
makers of the CodeLab interactive programming exercise system. For a full demonstration,
to see feedback from instructors and students, or to get started using MyProgrammingLab in
your course, visit www.myprogramminglab.com.

Video Notes
We are excited about the new Video Notes feature that is found in this new edition. These VideoNote

videos provide additional help by presenting examples of key topics and showing how
to solve problems completely from design through coding. Video Notes are available from
www.pearsonglobaleditions.com/Liang.
10 Preface

Algorithm Animations
Animation We have provided numerous animations for algorithms. These are valuable pedagogical tools
to demonstrate how algorithms work. Algorithm animations can be accessed from the Com-
panion Website.

Acknowledgments
I would like to thank Armstrong State University for enabling me to teach what I write and for
supporting me in writing what I teach. Teaching is the source of inspiration for continuing to
improve the book. I am grateful to the instructors and students who have offered comments,
suggestions, corrections, and praise. My special thanks go to Stefan Andrei of Lamar Univer-
sity and William Bahn of University of Colorado Colorado Springs for their help to improve
the data structures part of this book.
This book has been greatly enhanced thanks to outstanding reviews for this and previous edi-
tions. The reviewers are: Elizabeth Adams (James Madison University), Syed Ahmed (North
­Georgia College and State University), Omar Aldawud (Illinois Institute of Technology), Ste-
fan Andrei (Lamar University), Yang Ang (University of Wollongong, Australia), Kevin Bierre
(Rochester Institute of Technology), Aaron Braskin (Mira Costa High School), David Champion
(DeVry Institute), James Chegwidden (Tarrant County College), Anup Dargar (University of North
Dakota), Daryl Detrick (Warren Hills Regional High School), Charles Dierbach (Towson Univer-
sity), Frank Ducrest (University of Louisiana at Lafayette), Erica Eddy (University of Wisconsin at
Parkside), Summer Ehresman (Center Grove High School), Deena Engel (New York University),
Henry A. Etlinger (Rochester Institute of Technology), James Ten Eyck (Marist College), Myers
Foreman (Lamar University), Olac Fuentes (University of Texas at El Paso), Edward F. Gehringer
(North Carolina State University), Harold Grossman (Clemson University), Barbara Guillot (Loui-
siana State University), Stuart Hansen (University of Wisconsin, Parkside), Dan Harvey (Southern
Oregon University), Ron Hofman (Red River College, Canada), Stephen Hughes (Roanoke Col-
lege), Vladan Jovanovic (Georgia Southern University), Deborah Kabura Kariuki (Stony Point
High School), Edwin Kay (Lehigh University), Larry King (University of Texas at Dallas), Nana
Kofi (Langara College, Canada), George Koutsogiannakis (Illinois Institute of Technology), Roger
Kraft (Purdue University at Calumet), Norman Krumpe (Miami University), Hong Lin (DeVry
Institute), Dan Lipsa (Armstrong State University), James Madison (Rensselaer Polytechnic Insti-
tute), Frank Malinowski (Darton College), Tim Margush (University of Akron), Debbie Masada
(Sun Microsystems), Blayne Mayfield (Oklahoma State University), John McGrath (J.P. McGrath
Consulting), Hugh McGuire (Grand Valley State), Shyamal Mitra (University of Texas at Austin),
Michel Mitri (James Madison University), Kenrick Mock (University of Alaska Anchorage), Frank
Murgolo (California State University, Long Beach), Jun Ni (University of Iowa), Benjamin N ­ ystuen
(University of Colorado at Colorado Springs), Maureen Opkins (CA State University, Long Beach),
Gavin Osborne (University of Saskatchewan), Kevin Parker (Idaho State University), Dale Par-
son (Kutztown University), Mark Pendergast (Florida Gulf Coast University), Richard Povinelli
(Marquette University), Roger Priebe (University of Texas at Austin), Mary Ann Pumphrey (De
Anza Junior College), Pat Roth (Southern Polytechnic State University), Amr Sabry (Indiana Uni-
versity), Ben Setzer (Kennesaw State University), Carolyn Schauble (Colorado State University),
David Scuse (University of Manitoba), Ashraf Shirani (San Jose State University), Daniel Spiegel
(Kutztown University), Joslyn A. Smith (Florida Atlantic University), Lixin Tao (Pace University),
Ronald F. Taylor (Wright State University), Russ Tront (Simon Fraser University), Deborah ­Trytten
(University of Oklahoma), Michael Verdicchio (Citadel), Kent Vidrine (George Washington Uni-
versity), and Bahram Zartoshty (California State University at Northridge).
It is a great pleasure, honor, and privilege to work with Pearson. I would like to thank Tracy
Johnson and her colleagues Marcia Horton, Demetrius Hall, Yvonne Vannatta, Kristy Alaura,
Carole Snyder, Scott Disanno, Bob Engelhardt, Shylaja Gattupalli, and their colleagues for
organizing, producing, and promoting this project.
As always, I am indebted to my wife, Samantha, for her love, support, and encouragement.
Preface  11

Acknowledgments for the Global Edition


Pearson would like to thank and acknowledge Yvan Maillot (Univresite Haute-Alsace) and
Steven Yuwono (National ­University of Singapore) for contributing to this Global Edition,
and Arif Ahmed (National Institute of Technology, ­Silchar), Annette Bieniusa (University of
Kaiserslautern), Shaligram Prajapat (Devi Ahilya Vishwavidyalaya, Indore), and Ram Gopal
Raj (University of Malaya) for reviewing this Global Edition.
CONTENTS
Chapter 1 I ntroduction to Computers,
­Programs, and Java™ 23
1.1 Introduction 24
1.2 What Is a Computer? 24
1.3 Programming Languages 29
1.4 Operating Systems 31
1.5 Java, the World Wide Web, and Beyond 32
1.6 The Java Language Specification, API, JDK,
JRE, and IDE 33
1.7 A Simple Java Program 34
1.8 Creating, Compiling, and Executing a Java Program 37
1.9 Programming Style and Documentation 40
1.10 Programming Errors 42
1.11 Developing Java Programs Using NetBeans 45
1.12 Developing Java Programs Using Eclipse 47

Chapter 2 Elementary Programming 55


2.1 Introduction 56
2.2 Writing a Simple Program 56
2.3 Reading Input from the Console 59
2.4 Identifiers 62
2.5 Variables 62
2.6 Assignment Statements and Assignment Expressions 64
2.7 Named Constants 65
2.8 Naming Conventions 66
2.9 Numeric Data Types and Operations 67
2.10 Numeric Literals 70
2.11 Evaluating Expressions and Operator Precedence 72
2.12 Case Study: Displaying the Current Time 74
2.13 Augmented Assignment Operators 76
2.14 Increment and Decrement Operators 77
2.15 Numeric Type Conversions 79
2.16 Software Development Process 81
2.17 Case Study: Counting Monetary Units 85
2.18 Common Errors and Pitfalls 87

Chapter 3 Selections 97
3.1 Introduction 98
3.2 boolean Data Type 98
3.3 if Statements 100
3.4 Two-Way if-else Statements 102
3.5 Nested if and Multi-Way if-else Statements 103
3.6 Common Errors and Pitfalls 105
3.7 Generating Random Numbers 109
3.8 Case Study: Computing Body Mass Index 111
3.9 Case Study: Computing Taxes 112
3.10 Logical Operators 115
3.11 Case Study: Determining Leap Year 119
3.12 Case Study: Lottery 120
3.13 switch Statements 122
12
Contents  13
3.14 Conditional Operators 125
3.15 Operator Precedence and Associativity 126
3.16 Debugging 128

Chapter 4 Mathematical Functions,


Characters, and Strings 141
4.1 Introduction 142
4.2 Common Mathematical Functions 142
4.3 Character Data Type and Operations 147
4.4 The String Type 152
4.5 Case Studies 161
4.6 Formatting Console Output 167

Chapter 5 Loops 181


5.1 Introduction 182
5.2 The while Loop 182
5.3 Case Study: Guessing Numbers 185
5.4 Loop Design Strategies 188
5.5 Controlling a Loop with User Confirmation or a Sentinel Value 190
5.6 The do-while Loop 192
5.7 The for Loop 195
5.8 Which Loop to Use? 198
5.9 Nested Loops 200
5.10 Minimizing Numeric Errors 202
5.11 Case Studies 204
5.12 Keywords break and continue 208
5.13 Case Study: Checking Palindromes 211
5.14 Case Study: Displaying Prime Numbers 213

Chapter 6 Methods 227


6.1 Introduction 228
6.2 Defining a Method 228
6.3 Calling a Method 230
6.4 void vs. Value-Returning Methods 233
6.5 Passing Parameters by Values 236
6.6 Modularizing Code 239
6.7 Case Study: Converting Hexadecimals to Decimals 241
6.8 Overloading Methods 243
6.9 The Scope of Variables 246
6.10 Case Study: Generating Random Characters 247
6.11 Method Abstraction and Stepwise Refinement 249

Chapter 7 Single-Dimensional Arrays 269


7.1 Introduction 270
7.2 Array Basics 270
7.3 Case Study: Analyzing Numbers 277
7.4 Case Study: Deck of Cards 278
7.5 Copying Arrays 280
7.6 Passing Arrays to Methods 281
7.7 Returning an Array from a Method 284
7.8 Case Study: Counting the Occurrences of Each Letter 285
7.9 Variable-Length Argument Lists 288
7.10 Searching Arrays 289
7.11 Sorting Arrays 293
14 Contents
7.12 The Arrays Class 294
7.13 Command-Line Arguments 296

Chapter 8 Multidimensional Arrays 311


8.1 Introduction 312
8.2 Two-Dimensional Array Basics 312
8.3 Processing Two-Dimensional Arrays 315
8.4 Passing Two-Dimensional Arrays to Methods 317
8.5 Case Study: Grading a Multiple-Choice Test 318
8.6 Case Study: Finding the Closest Pair 320
8.7 Case Study: Sudoku 322
8.8 Multidimensional Arrays 325

Chapter 9 Objects and Classes 345


9.1 Introduction 346
9.2 Defining Classes for Objects 346
9.3 Example: Defining Classes and Creating Objects 348
9.4 Constructing Objects Using Constructors 353
9.5 Accessing Objects via Reference Variables 354
9.6 Using Classes from the Java Library 358
9.7 Static Variables, Constants, and Methods 361
9.8 Visibility Modifiers 366
9.9 Data Field Encapsulation 368
9.10 Passing Objects to Methods 371
9.11 Array of Objects 375
9.12 Immutable Objects and Classes 377
9.13 The Scope of Variables 379
9.14 The this Reference 380

Chapter 10 Object-Oriented Thinking 389


10.1 Introduction 390
10.2 Class Abstraction and Encapsulation 390
10.3 Thinking in Objects 394
10.4 Class Relationships 397
10.5 Case Study: Designing the Course Class 400
10.6 Case Study: Designing a Class for Stacks 402
10.7 Processing Primitive Data Type Values as Objects 404
10.8 Automatic Conversion between Primitive Types
and Wrapper Class Types 407
10.9 The BigInteger and BigDecimal Classes 408
10.10 The String Class 410
10.11 The StringBuilder and StringBuffer Classes 416

Chapter 11 Inheritance and


Polymorphism 433
11.1 Introduction 434
11.2 Superclasses and Subclasses 434
11.3 Using the super Keyword 440
11.4 Overriding Methods 443
11.5 Overriding vs. Overloading 444
11.6 The Object Class and Its toString() Method 446
11.7 Polymorphism 447
11.8 Dynamic Binding 447
11.9 Casting Objects and the instanceof Operator 451
11.10 The Object’s equals Method 455
Contents  15
11.11 The ArrayList Class 456
11.12 Useful Methods for Lists 462
11.13 Case Study: A Custom Stack Class 463
11.14 The protected Data and Methods 464
11.15 Preventing Extending and Overriding 467

Chapter 12 Exception Handling


and Text I/O 475
12.1 Introduction 476
12.2 Exception-Handling Overview 476
12.3 Exception Types 481
12.4 More on Exception Handling 484
12.5 The finally Clause 492
12.6 When to Use Exceptions 493
12.7 Rethrowing Exceptions 494
12.8 Chained Exceptions 495
12.9 Defining Custom Exception Classes 496
12.10 The File Class 499
12.11 File Input and Output 502
12.12 Reading Data from the Web 508
12.13 Case Study: Web Crawler 510

Chapter 13 Abstract Classes and Interfaces 521


13.1 Introduction 522
13.2 Abstract Classes 522
13.3 Case Study: the Abstract Number Class 527
13.4 Case Study: Calendar and GregorianCalendar 529
13.5 Interfaces 532
13.6 The Comparable Interface 535
13.7 The Cloneable Interface 540
13.8 Interfaces vs. Abstract Classes 545
13.9 Case Study: The Rational Class 548
13.10 Class-Design Guidelines 553

Chapter 14 JavaFX Basics 563


14.1 Introduction 564
14.2 JavaFX vs Swing and AWT 564
14.3 The Basic Structure of a JavaFX Program 564
14.4 Panes, Groups, UI Controls, and Shapes 567
14.5 Property Binding 570
14.6 Common Properties and Methods for Nodes 573
14.7 The Color Class 575
14.8 The Font Class 576
14.9 The Image and ImageView Classes 578
14.10 Layout Panes and Groups 580
14.11 Shapes 589
14.12 Case Study: The ClockPane Class 602

Chapter 15 Event-Driven Programming


and Animations 615
15.1 Introduction 616
15.2 Events and Event Sources 618
15.3 Registering Handlers and Handling Events 619
15.4 Inner Classes 623
15.5 Anonymous Inner Class Handlers 624
16 Contents
15.6 Simplifying Event Handling Using Lambda Expressions 627
15.7 Case Study: Loan Calculator 631
15.8 Mouse Events 633
15.9 Key Events 635
15.10 Listeners for Observable Objects 638
15.11 Animation 640
15.12 Case Study: Bouncing Ball 648
15.13 Case Study: US Map 652

Chapter 16 JavaFX UI Controls


and Multimedia 665
16.1 Introduction 666
16.2 Labeled and Label 666
16.3 Button 668
16.4 CheckBox 670
16.5 RadioButton 673
16.6 TextField 676
16.7 TextArea 677
16.8 ComboBox 681
16.9 ListView 684
16.10 ScrollBar 687
16.11 Slider 690
16.12 Case Study: Developing a Tic-Tac-Toe Game 693
16.13 Video and Audio 698
16.14 Case Study: National Flags and Anthems 701

Chapter 17 Binary I/O 713


17.1 Introduction 714
17.2 How Is Text I/O Handled in Java? 714
17.3 Text I/O vs. Binary I/O 715
17.4 Binary I/O Classes 716
17.5 Case Study: Copying Files 726
17.6 Object I/O 728
17.7 Random-Access Files 733

Chapter 18 Recursion 741


18.1 Introduction 742
18.2 Case Study: Computing Factorials 742
18.3 Case Study: Computing Fibonacci
Numbers 745
18.4 Problem Solving Using Recursion 748
18.5 Recursive Helper Methods 750
18.6 Case Study: Finding the Directory Size 753
18.7 Case Study: Tower of Hanoi 755
18.8 Case Study: Fractals 758
18.9 Recursion vs. Iteration 762
18.10 Tail Recursion 762

Chapter 19 Generics 773


19.1 Introduction 774
19.2 Motivations and Benefits 774
19.3 Defining Generic Classes and Interfaces 776
19.4 Generic Methods 778
19.5 Case Study: Sorting an Array of Objects 780
Contents  17
19.6 Raw Types and Backward Compatibility 782
19.7 Wildcard Generic Types 783
19.8 Erasure and Restrictions on Generics 786
19.9 Case Study: Generic Matrix Class 788

Chapter 20 L
 ists, Stacks, Queues, and
Priority Queues 797
20.1 Introduction 798
20.2 Collections 798
20.3 Iterators 802
20.4 Using the forEach Method 803
20.5 Lists 804
20.6 The Comparator Interface 809
20.7 Static Methods for Lists and Collections 813
20.8 Case Study: Bouncing Balls 816
20.9 Vector and Stack Classes 820
20.10 Queues and Priority Queues 821
20.11 Case Study: Evaluating Expressions 825

Chapter 21 Sets and Maps 837


21.1 Introduction 838
21.2 Sets 838
21.3 Comparing the Performance of Sets and Lists 846
21.4 Case Study: Counting Keywords 849
21.5 Maps 850
21.6 Case Study: Occurrences of Words 855
21.7 Singleton and Unmodifiable Collections and Maps 857

Chapter 22 Developing Efficient


Algorithms 861
22.1 Introduction 862
22.2 Measuring Algorithm Efficiency Using Big O Notation 862
22.3 Examples: Determining Big O 864
22.4 Analyzing Algorithm Time Complexity 868
22.5 Finding Fibonacci Numbers Using Dynamic
Programming 871
22.6 Finding Greatest Common Divisors Using Euclid’s
Algorithm 873
22.7 Efficient Algorithms for Finding Prime Numbers 877
22.8 Finding the Closest Pair of Points Using
Divide-and-Conquer 883
22.9 Solving the Eight Queens Problem Using Backtracking 886
22.10 Computational Geometry: Finding a Convex Hull 889

Chapter 23 Sorting 903


23.1 Introduction 904
23.2 Insertion Sort 904
23.3 Bubble Sort 906
23.4 Merge Sort 909
23.5 Quick Sort 912
23.6 Heap Sort 916
23.7 Bucket and Radix Sorts 923
23.8 External Sort 925
18 Contents

Chapter 24 I mplementing Lists, Stacks,


Queues, and Priority Queues 939
24.1 Introduction 940
24.2 Common Operations for Lists 940
24.3 Array Lists 944
24.4 Linked Lists 951
24.5 Stacks and Queues 965
24.6 Priority Queues 969

Chapter 25 Binary Search Trees 975


25.1 Introduction 976
25.2 Binary Search Trees 976
25.3 Deleting Elements from a BST 989
25.4 Tree Visualization and MVC 995
25.5 Iterators 998
25.6 Case Study: Data Compression 1000

Chapter 26 AVL Trees 1011


26.1 Introduction 1012
26.2 Rebalancing Trees 1012
26.3 Designing Classes for AVL Trees 1015
26.4 Overriding the insert Method 1016
26.5 Implementing Rotations 1017
26.6 Implementing the delete Method 1018
26.7 The AVLTree Class 1018
26.8 Testing the AVLTree Class 1024
26.9 AVL Tree Time Complexity Analysis 1027

Chapter 27 Hashing 1031


27.1 Introduction 1032
27.2 What Is Hashing? 1032
27.3 Hash Functions and Hash Codes 1033
27.4 Handling Collisions Using Open Addressing 1035
27.5 Handling Collisions Using Separate Chaining 1039
27.6 Load Factor and Rehashing 1039
27.7 Implementing a Map Using Hashing 1041
27.8 Implementing Set Using Hashing 1050

Chapter 28 Graphs and Applications 1061


28.1 Introduction 1062
28.2 Basic Graph Terminologies 1063
28.3 Representing Graphs 1064
28.4 Modeling Graphs 1070
28.5 Graph Visualization 1080
28.6 Graph Traversals 1083
28.7 Depth-First Search (DFS) 1084
28.8 Case Study: The Connected Circles Problem 1088
28.9 Breadth-First Search (BFS) 1090
28.10 Case Study: The Nine Tails Problem 1093
Contents  19

Chapter 29 W
 eighted Graphs and
Applications 1107
29.1 Introduction 1108
29.2 Representing Weighted Graphs 1109
29.3 The WeightedGraph Class 1111
29.4 Minimum Spanning Trees 1119
29.5 Finding Shortest Paths 1125
29.6 Case Study: The Weighted Nine Tails Problem 1134

Chapter 30 
Aggregate Operations
for Collection Streams 1145
30.1 Introduction 1146
30.2 Stream Pipelines 1146
30.3 IntStream, LongStream, and DoubleStream 1152
30.4 Parallel Streams 1155
30.5 Stream Reduction Using the reduce Method 1157
30.6 Stream Reduction Using the collect Method 1160
30.7 Grouping Elements Using the groupingby Collector 1163
30.8 Case Studies 1166

Chapter 31–44 are available from the Companion Website at


www.pearsonglobaleditions.com/Liang

Chapter 31 Advanced JavaFX and FXML


Chapter 32 Multithreading and Parallel
Programming
Chapter 33 Networking
Chapter 34 Java Database Programming
Chapter 35 Advanced Java Database Programming
Chapter 36 Internationalization
Chapter 37 Servlets
Chapter 38 JavaServer Pages
Chapter 39 JavaServer Faces
Chapter 40 Remote Method Invocation
Chapter 41 Web Services
Chapter 42 2-4 Trees and B-Trees
Chapter 43 Red-Black Trees
Chapter 44 Testing Using JUnit
20 Contents

Appendixes 1177
Appendix A Java Keywords 1179
Appendix B The ASCII Character Set 1180
Appendix C Operator Precedence Chart 1182
Appendix D Java Modifiers 1184
Appendix E Special Floating-Point Values 1186
Appendix F Number Systems 1187
Appendix G Bitwise Operations 1191
Appendix H Regular Expressions 1192
Appendix I Enumerated Types 1197

Quick Reference 1203


Index 1205
VideoNotes
Locations of VideoNotes
VideoNote
www.pearsonglobaleditions.com/Liang

Chapter 1 Introduction to Computers, Programs, Coupon collector’s problem 304


and Java™ 23 Consecutive four 306
Your first Java program 34
Compile and run a Java program 39 Chapter 8 Multidimensional Arrays 311
NetBeans brief tutorial 45 Find the row with the largest sum 316
Eclipse brief tutorial 47 Grade multiple-choice test 318
Sudoku 322
Chapter 2 Elementary Programming 55 Multiply two matrices 331
Obtain input 59 Even number of 1s 338
Use operators / and % 74
Software development Chapter 9 Objects and Classes 345
process 81 Define classes and objects 346
Compute loan payments 82 Use classes 358
Compute BMI 94 Static vs. instance 361
Data field encapsulation 368
Chapter 3 Selections 97 The this keyword 380
Program addition quiz 99 The Fan class 386
Program subtraction quiz 109
Use multi-way if-else Chapter 10 Object-Oriented Thinking 389
statements 112 The Loan class 391
Sort three integers 132 The BMI class 394
Check point location 134 The StackOfIntegers class 402
Process large numbers 408
Chapter 4 Mathematical Functions, Characters, The String class 410
and Strings 141 The MyPoint class 424
Introduce Math functions 142
Introduce strings and objects 152 Chapter 11 Inheritance and Polymorphism 433
Convert hex to decimal 165 Geometric class hierarchy 434
Compute great circle distance 173 Polymorphism and dynamic
Convert hex to binary 176 binding demo 448
The ArrayList class 456
Chapter 5 Loops 181 The MyStack class 463
Use while loop 182 New Account class 470
Guess a number 185
Multiple subtraction quiz 188 Chapter 12 Exception Handling and Text I/O 475
Use do-while loop 192 Exception-handling advantages 476
Minimize numeric errors 202 Create custom exception classes 496
Display loan schedule 219 Write and read data 502
Sum a series 220 HexFormatException 515

Chapter 6 Methods 227 Chapter 13 Abstract Classes and Interfaces 521


Define/invoke max method 230 Abstract GeometricObject class 522
Use void method 233 Calendar and Gregorian
Modularize code 239 Calendar classes 529
Stepwise refinement 249 The concept of interface 532
Reverse an integer 258 Redesign the Rectangle class 558
Estimate p 261
Chapter 14 JavaFX Basics 563
Chapter 7 Single-Dimensional Arrays 269 Getting started with JavaFX 564
Random shuffling 274 Understand property binding 570
Deck of cards 278 Use Image and ImageView 578
Selection sort 293 Use layout panes 580
Command-line arguments 297 Use shapes 589
21
22 VideoNotes
Display a tic-tac-toe board 608 Tic-Tac-Toe 693
Display a bar chart 610 Use Media, MediaPlayer,
and MediaView 698
Chapter 15 Event-Driven Programming Use radio buttons and text fields 705
and Animations 615 Set fonts 707
Handler and its registration 622
Anonymous handler 625 Chapter 17 Binary I/O 713
Move message using the Copy file 726
mouse 634 Object I/O 728
Animate a rising flag 640 Split a large file 738
Flashing text 646
Simple calculator 656 Chapter 18 Recursion 741
Check mouse-point location 658 Binary search 752
Display a running fan 661 Directory size 753
Fractal (Sierpinski triangle) 758
Chapter 16 JavaFX UI Controls and Multimedia 665 Search a string in a directory 769
Use ListView 684 Recursive tree 772
Use Slider 690

Animations

Chapter 7 Single-Dimensional Arrays 269 radix sort on Companion


linear search animation on Website 924
Companion Website 290
binary search animation on Chapter 24 Implementing Lists, Stacks,
Companion Website 290 Queues, and Priority Queues 939
selection sort animation on list animation on Companion
Companion Website 293 Website 940
stack and queue animation on
Chapter 8 Multidimensional Arrays 311 Companion Website 965
closest-pair animation on
the Companion Website 320 Chapter 25 Binary Search Trees 975
BST animation on
Chapter 22 Developing Efficient Algorithms 861 Companion Website 976
binary search animation on
the Companion Website 868 Chapter 26 AVL Trees 1011
selection sort animation on AVL tree animation on
the Companion Website 868 Companion Website 1012
closest-pair animation on
Companion Website 883 Chapter 27 Hashing 1031
Eight Queens animation on linear probing animation on
the Companion Website 886 Companion Website 1036
convex hull animation on quadratic probing animation on
the Companion Website 889 Companion Website 1037
separate chaining animation on
Chapter 23 Sorting 903 Companion Website 1040
insertion-sort animation on
Companion Website 904 Chapter 28 Graphs and Applications 1061
bubble sort animation on the graph learning tool on
Companion Website 907 Companion Website 1064
merge animation on Companion U.S. Map Search 1086
Website 911 Chapter 29 Weighted Graphs and
partition animation on Applications 1107
Companion Website 915 weighted graph learning tool
heap animation on Companion animation on Companion Website 1108
Website 917
Chapter

1
Introduction
to Computers,
Programs, and Java™
Objectives
■■ To understand computer basics, programs, and operating systems
(§§1.2–1.4).
■■ To describe the relationship between Java and the World Wide Web
(§1.5).
■■ To understand the meaning of Java language specification, API, JDK™,
JRE™, and IDE (§1.6).
■■ To write a simple Java program (§1.7).
■■ To display output on the console (§1.7).
■■ To explain the basic syntax of a Java program (§1.7).
■■ To create, compile, and run Java programs (§1.8).
■■ To use sound Java programming style and document programs properly
(§1.9).
■■ To explain the differences between syntax errors, runtime errors, and
logic errors (§1.10).
■■ To develop Java programs using NetBeans™ (§1.11).
■■ To develop Java programs using Eclipse™ (§1.12).
Discovering Diverse Content Through
Random Scribd Documents
The Project Gutenberg eBook of College Men
Without Money
This ebook is for the use of anyone anywhere in the United States
and most other parts of the world at no cost and with almost no
restrictions whatsoever. You may copy it, give it away or re-use it
under the terms of the Project Gutenberg License included with this
ebook or online at www.gutenberg.org. If you are not located in the
United States, you will have to check the laws of the country where
you are located before using this eBook.

Title: College Men Without Money

Author: Carl Brown Riddle

Release date: March 8, 2017 [eBook #54302]


Most recently updated: October 23, 2024

Language: English

Credits: Produced by Anita Hammond, Wayne Hammond and the


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

*** START OF THE PROJECT GUTENBERG EBOOK COLLEGE MEN


WITHOUT MONEY ***
COLLEGE MEN
WITHOUT MONEY
EDITED BY

C. B. RIDDLE

NEW YORK
THOMAS Y. CROWELL COMPANY
PUBLISHERS

Copyright, 1914
By THOMAS Y. CROWELL COMPANY
Published June, 1914
CONTENTS

PART I
PAGE
A Mother’s Desire Realized—Ames 1
“Magna Cum Laude”—Aspinall 5
Task Worth While—Clark 8
Making Odd Hours Pay—Day 12
The College Store—Dodge 15
Brother Helps Brother—Draper 19
The College Inspiration—Dyer 24
Overcoming Hardships—Frazier 29
The Dignity of Service—Fox 35
A Happy Misfortune—French 42
Finding One’s Place—Gernert 47
“The Tarheel”—Gunter 49
No Work Too Hard—Halfaker 53
Cultivating Side Lines—Heller 60
A Smiling Self-Reliance—Hughes 65
A Mother’s Influence—Kendall 67
Riches More of a Handicap than Poverty—Lawrence 75
The Will and the Way—McCuskey 79
Keep Good Company—McLeod 82
The Democracy of a College—Moon 83
Obeying the Call—Morgan 88
Determination and Steadfastness Wins—Mosley 91
Making Oneself Useful—Nelson 96
A Faith “Divinely Simple”—Nicks 112
One Who Knows It Can Be Done 115
Difficulty and Willingness Are Enemies—Rowland 120
Faithful in Little Things—Saunders 126
From Janitor to College President—Staley 134
Starting with Five Dollars 138
From Good to Better—Swain 142
A Task with a Moral—Traynor 146
From the University of Denver Bulletin 151
The Fraternity of Workers—Van Ruschen 157
How the Physical Side Helped—Wade 162
The Way Always Open—Walters 167
The Victory that Overcometh the World—Watkins 171
Opportunities Make us Known—Wentzel 177
Making Play out of Work—Wiggins 185
Nothing Succeeds Like Success—Wright 189
Work a Stimulus to Ambition 194
The University as a Goal 200
PART II
Working to Make Himself a More Useful Man—Bassford 205
Many Lanes of Usefulness—Boswell 208
Another Example of the Willing Heart—Daft 212
Difficulties Prepare for Real Work—Frye 215
Pluck Rather than Luck—Henry 221
Poverty Is Not His Master—Johnson 225
Defeat Does Not Mean Failure—Johnson 228
“Start Right”—Johnson 230
The Real Question—Jorgenson 233
Willingness to Work a Great Asset—Moore 239
Keep on Trying—Omahart 242
Optimism is an Asset—Oxley 245
The Desire for Something Better—Patrick 249
Determination versus Poverty—Porter 252
The Real Needs of the World—Rankin 255
The One Who Succeeds is the One Who Tries—Scurr 257
The Help Yourself Club—Sellars 261
The How and The Why—Shinn 263
Making Use of Every Opportunity—Smith 266
Education Worth the Price—West 273
Work no Class Barrier—Wright 280
PART III
How to Work One’s Way through College—Brown 283
Does a College Education Pay? 286
PREFACE
Having entered the preparatory schools with 94 cents, and college
with less, and knowing that the greater number of those who control
the affairs of the nation and who strive to make the country better,
are men and women who did likewise, the thought for this book
entered my mind. The first aim was to collect matter from students
only, but this was changed. The main part of the book contains
articles from college and university graduates. The last part of the
book contains contributions from students now in college, and shows
how the actual thing of working one’s way through college or
university is being done. A few of the articles which go to make this
volume were used as a special series in the Raleigh Times, Raleigh,
North Carolina, and requests from various parts of the country were
received by the compiler for the production of the series.

The object of the compiler is not to praise the merits of those who
have succeeded, but to point a moral to young men and women who
desire an education and have small means. A prominent editor says:
“The history of college education among English speaking people is
now about one thousand years old. It began with the University of
Oxford in England, which has been in existence a decade of
centuries. It has spread to many lands, but in all lands it has been
about the same to the poor boy. It can be truly said that he has
never seen an age or a country or a college where he had an easy
time in getting his diploma. It has always been a fearful struggle for
him, and it will doubtless continue to be. But it is also true that the
brightest pages, the very brightest, in all our long educational
history are those that record the triumphs of the poor boy. And his
triumphs are written throughout that great period. He has
demonstrated a thousand times over that ‘where there is a will there
is a way,’ that ‘poverty does not chain one to the soil.’”
So, my efforts have been to help rather than to praise, to make the
past a great light for the future, and to pave the way for more
college men not blessed with wealth. If this volume serves to aid
one in these directions I shall be glad.

To Professor W. P. Lawrence, Professor E. E. Randolph, Professor R.


A. Campbell and President W. A. Harper, of the Elon College Faculty,
the compiler is greatly indebted for their faithful service in the
preparation of this work; also to many others who offered
suggestions and advice.

C. B. Riddle.

Elon College, N. C.
March 16, 1914.
PART I
A MOTHER’S DESIRE REALIZED
FORREST B. AMES, B.A.

B EFORE the close of my high school course I faced two proposals,


acceptance of one of which would cause me to go to college;
the other would set me to work. The first was this: provided I would
live at home in Bangor and go back and forth daily to the University
of Maine in Orono (a ride of about fifty minutes on the electric car) I
was offered about half of the expenses of my entire college course.
The second was—work.

Thanks to my mother’s influence and the fact that I wanted a college


education, I had no hesitation in accepting the first proposal. Thus I
came to belong, not to a class of “college men with no money,” but
rather to that of “college men with little money.” The essential
difference is one of degree only, provided there is present a true
determination to secure a college education.

Why did I go to college? To a great extent because of my mother’s


influence; because of her who could not conceive of her sons as
non-college men. She thus constantly encouraged us to go to
college regardless of whether we had to earn all or part of our way.
In addition to this ever-present influence I was a somewhat
imaginative and philosophical lad. It seemed to me that just as a hill
was made not merely for climbing, but that the climber should be
rewarded for his attempt by the beautiful view of broader countries
seen from the summit; even so a college education was designed,
not to be a stumbling block to the youth of our country, but rather to
serve as a means of intellectual elevation from which should open up
visions of greater things in life. These two things made me become a
“college man with little money,” who was ready to do any honest
work to make up the financial deficiency.
How did I earn my way through college? In an account book, which
I have preserved for many years, I find this statement, written when
I was a sophomore in high school: “School closed (for the summer
vacation) Friday. On Saturday I helped Roy cut grass and received
twenty-five cents. From that regular employment followed and I
earned and spent money as follows:”

There follows, then, a record of fifteen cents from someone for


cutting grass, or fifty cents from another for a bit of carpenter work
such as a boy could do. Very consistently during the remainder of
my high school course I worked, caring for lawns and gardens in the
summer, and running one furnace and sometimes two and shoveling
snow in the winter. I also pumped a church organ. By these means I
earned and saved $200.00 in the two years before I was ready to go
to college. This sum I placed in the bank.

For two years of my college course I lived at home and went to and
from the University each day. To earn money I tended a furnace and
shoveled snow, pumped a church organ, and occasionally sold
tickets at various entertainments in the Bangor City Hall. In the fall
of the sophomore year I won a first prize of fifteen dollars in the
annual sophomore declamations. During the summer between my
first and second years in college I worked as an amateur landscape
gardener, caring for lawns and gardens and doing odd jobs of all
kinds. For the greater part of the summer following the second year
I worked as a carpenter. I also tried the work of book agent, but
made little headway at that.

Beginning with my junior year at college my plans were considerably


changed. No longer did I travel to and from college daily, but, thanks
to the generosity of a friend, I was permitted to live at the fraternity
which I had joined in my freshman year. Thus I was given an
opportunity to enter into the larger life and activity of the University,
and so to share some of the college honors and profit by them.
But still there was the necessity of earning money. I still lacked many
dollars, even many hundred dollars, necessary to secure my college
education. During that junior year I worked at every opportunity and
earned money by selling tickets at various places, giving readings at
a church entertainment, winning another first prize in the junior
declamations, taking school census in my home ward in Bangor, and
by doing odd jobs whenever any presented themselves. During the
summer I secured work at a seashore resort and because of the
somewhat isolated nature of the place saved nearly all my earnings.

In amount of money earned in all ways, my senior year was the best
of my entire college course. During the Christmas recess I worked as
floor-walker in a store, and during the spring vacation again took
school census, this time in a larger ward which returned me more
money. I won fifty dollars in an intercollegiate speaking contest, and
earned nearly sixty-five dollars as substitute teacher in Bangor high
school. These amounts, combined with my previous savings, or what
was left of them, and an advance from the same friend, enabled me
to graduate from the University of Maine in 1913 with all bills paid,
but burdened with a great debt of gratitude that I can never
properly pay.

As I look back over my college course, I feel that it was worth all the
work that I was obliged to do.

Orono, Maine.
“MAGNA CUM LAUDE”
REV. RICHARD ASPINALL, B.A., M.A., B.D.

A T the age of twenty-five I went to West Virginia Wesleyan


College with a fairly large amount of worldly experience, very
little book learning, and enough money to take me through two
terms of school. I was preparing myself for the ministry of the
Methodist Episcopal Church, and was willing to preach my way
through school. I did not know anyone in the school, nor did I have
any definite promise that I would get a charge near the College.
Incidentally, I might say that I had been in this country only
eighteen months at that time. I landed in New York with only six
dollars, plus the amount that the immigration authorities require
each one to have upon landing on these shores. I did not know a
man from Maine to California.

After consultation with the Dean I found that I needed one year to
complete the college entrance requirements. During the next
summer I made enough money to pay my few debts; so I returned
to the college square with the world. A few weeks after school
opened, I went to our conference and was assigned to a circuit in
close proximity to the College, which paid me $360 for the year.
There were six appointments on the circuit; each congregation
wanted me to hold a protracted meeting and I had to hire a horse
every Sunday, for the average distance for me to travel was twenty
miles a Sunday.

There was no opportunity to make any extra money, for I held


protracted meetings in the vacations and had to do extra pastoral
work in the summer, which, of course, had been sadly neglected
during the school year. It need hardly be said that there were many
trying times. I had much practical experience in a system of
bookkeeping; but, somehow, and at very irregular intervals, the bills
were all paid at the end of the year.

I was returned a second year. The salary was increased $50.00, and
for a time I was passing rich. But troubles were plentiful, sometimes.
I was going out on a mission of good cheer, riding thirty miles on
Sunday—it may be in sleet and snow, and the steward had been
able to collect only $3.21, when I needed much more than that to
pay my board bills. Then when I could succeed in casting these
gloomy thoughts from my mind, in would rush the inspiring thoughts
of my Latin, Greek, Hebrew and Math., all fighting for first
consideration. Notwithstanding, given good health, one can get
through. It has been done and can be done again, is part of my
philosophy.

The last two years saw me on another charge, paying much more
money, but a much more difficult field, mentally. I was able to
graduate, free from debt, though I had seldom been so during the
whole five years. I feel as though I have a right to say that I did not
slight my work, for I was graduated “Magna cum Laude” and took a
few other honors besides.

Taken collectively, the grind of lessons, the worries of a circuit


together with shortage of money are not always conducive to
optimism, but I felt like I had to get through. The same zest I had
then for learning is still with me. I may say that I have no more
money than I had when in college, but as much ambition.

Madison, N. J.
TASK WORTH WHILE
THOMAS ARKLE CLARK, B.L., DEAN OF MEN, UNIVERSITY OF ILLINOIS

I WORKED my way through college from necessity—I had to do so,


or to give up the idea of having a college education at all. I had
no ideas then concerning the great advantages of such a course.

When I was a little boy my father had formed the plan of sending
me to college when I should have reached the proper age, but he
died when I was scarcely fifteen years old, and my hope of ever
securing a college education vanished. Seven years later, when I was
twenty-two, a chance experience renewed within me the desire to
go to college, and I laid my plans accordingly.

I had little money, though I had been teaching school two years and
had also been farming for myself. It seemed to me then, and I feel it
much more strongly now that I have had an experience with
hundreds of other students in a similar situation, that it would be
better to delay beginning my college course until I had saved
enough money to give me a good start. This I did, farming another
year and spending an additional winter in teaching a country school.
When I was ready to enter college I had money, which I had myself
earned, more than sufficient to pay all of my college expenses for
two years.

I had not been in college long before I saw that the fellow with no
special talent or training is very much handicapped in earning his
living. Such a man must take what work he can get, and must
usually work at a minimum wage. Often, too, the only work which he
can get is mere drudgery. The man who can sing or can play a
musical instrument well, the man with a trade, or a particular fitness
for any special sort of work, can earn his living more quickly and
more pleasantly than can the man who must confine himself to
unskilled labor.

Soon after I entered college a chance came to me to become an


apprentice in the office of the college paper and to learn to be a
printer. I did not need to earn money during my first year, so I
entered the printing office, and gave myself to learning to set type.

I worked at the trade industriously during my leisure moments, the


fellows in the office were quite willing to instruct me, and at the end
of a year I had become so proficient that I was employed as a
regular type-setter. In this way I earned satisfactory wages during
the rest of my college course.

My connection with the college paper gave me an interest in


newspaper work in general, and I soon had an opportunity to do
reporting for one of the city daily papers published in the college
town. For this work I was paid a definite amount a column, with an
understanding that the total amount of news which I should furnish
each week should not exceed a set number of columns.

These two sources of revenue, together with small amounts which I


was able to earn proved quite sufficient to furnish me enough money
to meet my regular college expenses. They gave me, also, more
pleasure than I should have been able to obtain had I been forced to
earn my living by means of unskilled toil.

My summer vacations I employed on the farm. I had many rosy


opportunities presented to me by solicitors who came to the
University to earn possibly fabulous sums of money during the
vacation by retailing their wares, but I preferred to work on the farm
for two reasons: such work offered me a definite sum for my
summer’s work, small though it might be, and I was in such a
position that I felt that I should know what I could rely on. It gave
me in addition three months strenuous exercise in the open air, and
thus prepared me for the months of hard study that came through
the college year.

As I look back now at the manner in which I earned my way through


college, it seems to me in the light of the many years of experience
which I have had since, a very good way. As I have watched the
hundreds of self-supporting students at the University of Illinois, I
am led to the conclusion that it is seldom a good plan to start upon
a college course without money, even if one has to postpone going
until that is earned. Unskilled labor is unprofitable, and anyone who
would succeed must have or must develop skill or training in some
special work. Lastly, it seems to me that the average man will find it
very much better to employ his vacations in work that will bring him
a definite and assured income, even though that be small, than to
risk earning ten times as much, as a book agent, for example, where
he is quite likely to fail.

Urbana, Ill.
MAKING ODD HOURS PAY
REV. JONATHAN C. DAY, A.B., D.D.

I WAS born in Harlan County, Kentucky, which is one of the remote


southeastern mountain counties of that State, on the twentieth
of December, 1877. I was one of eight boys. After my mother died
my father married a second time. He had six boys and two
daughters by his second marriage. We lived on a rough mountain
farm. Our income was meager and our educational and cultural
advantages even more meager. Our public schools were of the
poorest kind and lasted only three months in the year. We did not
attend them even consecutively through these three months. I
always was ambitious, however, after I had learned to read, to get
what I could from school, and from books.

My mother died when I was fourteen years of age. It was about this
time that I began to try to attend public schools regularly although
ours were poor. At the age of seventeen I had my first five
consecutive months of school. This gave me a taste for more
knowledge, since here we were studying geography and history and
those branches which gave us some knowledge of a larger world
than we mountain boys knew.

At eighteen I entered the Presbyterian School at Harlan Town. I


graduated from this little academy when I was twenty. All of this
time I had taken great delight in working odd hours outside of
school and on Saturdays and holidays, to pay my way. By this time I
found it possible to teach in the country schools. This I did two
terms. There was finally an opening at college where I had a chance
to pay my way by taking care of the fires, milking cows, running
errands, etc., for a gentleman who lived near the college and who
had to be away from home most of the time.
I entered Tusculum College at Greeneville, Tenn., in September,
1897. I worked for Mr. L. L. Lawrence, an attorney, who lived near
the college campus. My work was not very hard, but took a great
many hours each day. By diligent application to my studies I found it
possible to make up the branches in which I was deficient in the
preparatory department, and to graduate with my Bachelor’s degree
on the 1st of June, 1901. Having to do the manual labor that I did
and at regular hours, established in me regular habits, both in
meeting engagements and in preparation for classes, which I have
found in later life invaluable. As I look back over my experience in
college, I cannot remember the time when I was not perfectly
delighted with the opportunity of work and study, even though I
went many weeks destitute of “spending money.”

After I had finished college I entered upon a course of theological


study which I pursued for four years graduating from McCormick
Seminary in the spring of 1907. Meantime, however, I gave two
years to teaching and to the work of the Y. M. C. A. as student
secretary in Tennessee. This I found necessary in order to earn
money to purchase books and carry on my courses of study without
running too heavily in debt.

Since I have been regularly in the ministry, I have many times given
thanks for the Providence that made it necessary for me to get what
little I did get in the way of education through this long course of
labor, manual and mental. Many encouragements came along the
way. There were many kind friends who, without my solicitation,
have helped me at various times. I believe that the man who tries
will always find much encouragement.

New York City.


THE COLLEGE STORE
PROFESSOR W. I. DODGE, B.S.A.

B Y way of introduction, I will say that when I was in school I


never had any inclination whatever to attend a higher institution
of learning. But upon graduation from the ninth grade I was
influenced to attend the academy. I was at that time living in St.
Johnsbury, Vermont. I attended the academy there two years, and
then finished my preparatory course at Vermont Academy, Saxton’s
River, Vermont. As time drew near for graduation there, I finally
became quite interested in agriculture and I decided to enter the
Agricultural Department of the University of Vermont at Burlington.
The next question was, “How am I to bear the expense?” My father
was perfectly willing to help me and desirous of helping me through,
but he was financially unable to send me through on his own
resources. Since I was desirous of learning, I agreed to find some
method of helping him out. It was finally decided that I should enter
that fall (1908) and my application was sent and accepted.

My father, who aided me to the extent of $50 the first year, went to
Burlington a short while before College was to open and held an
interview with Professor J. S. Hills, the Dean of the Agricultural
Department. It ended in my securing the work of “sampler” at the
Experimental Farm. The work included getting up at five o’clock
every morning and going out to the barn and “sampling” and
“weighing” the milk from fifty odd cows. There were two of us that
did this work. When there was nothing ahead we would help in the
milking. This required about two hours in the morning. At five o’clock
in the afternoon the same work had to be done. If any of the
readers have ever done this kind of work they can well appreciate
my circumstances. For remuneration, I received fifteen cents an hour
and was able to earn an average of twelve dollars a month, from
which I paid my board. This consisted of one meal in a boarding
house and two in my room. Although the work was rather
undesirable in many respects, I have, nevertheless, many times
thanked fortune for it. On Saturdays, I had a job emptying ashes
and carrying coal for a woman down town, and in the winter I kept
her roof and walks clean. In this way I picked up a neat sum. I did
this work all the first year of college. During the summer I was very
fortunate in securing a position at the Experiment Station under
Professor Washburn (the head of the Dairy Division) for $40 a
month, working nine hours a day. Along with this I kept my work at
the farm so I managed to get $55 or more a month. Most of this I
saved to help me in my sophomore year.

When the three months’ summer vacation was over, I still retained
my work at the farm and kept it during the whole year. My father
occasionally sent me a little money, and I got along as well as I
could. During my sophomore year my uncle died and left me a small
sum of money, but I used only $50 of it during my sophomore year.
During my summer recess in that year I again worked for Professor
Washburn on his books and experiment work. I received the
immense wage of $45 a month, and still worked at the Farm, so I
managed to obtain about $60 per month. I worked the whole three
months, and then I decided to change my work.

I went to see the student owner of the “College Store,” Mr. I. H.


Rosenberg, and obtained the work of clerk in the store at the salary
of four dollars a week. I worked the whole year for that and it more
than paid my board. The $125 saved during the summer paid my
necessary bills. Then I received $100 more from my uncle’s estate.

In June I decided to buy the “College Store,” as it was for sale, but
how was I to pay $729 when I didn’t have it? I wrote to a relative of
mine in regard to the money, but he would not lend me the money
without a note signed by myself, father and grandfather for security.
I thought there must be another way to obtain it, so I went down
town and conferred with Mr. G. D. Jarvis, a merchant in the city. He
had known me for two years, and had taken a strong interest in me,
and after knowing my circumstances he told me he would lend me
the money. Of course, I had no property to give as security; but Mr.
Jarvis knew me and took my note as security for the money wanted.
I paid $600 down for the store and gave a note for the balance, the
first of June. So I became owner of the “College Store” for my senior
year. During the summer I went to Nova Scotia and worked in a
creamery in Brookfield, doing the helper’s work. I wanted to learn
creamery work and I thought that was my opportunity; so I took it. I
received $12 a month and board. I came back to college no richer
financially, but richer in knowledge. I opened my store at the
opening of school, and I earned enough to pay my expenses
through my last year. I sold it in the spring to another student and
paid Mr. Jarvis.

I graduated in the class of 1912, the first class graduated by


President Guy Potter Benton, now of the University. I received the
degree of Bachelor of Science in Agriculture.

In June of my senior year I secured the position of teacher of


Agriculture and the Sciences in one of the Vermont schools. I am still
there, and enjoy my work very much.

Morrisville, Vermont.
BROTHER HELPS BROTHER
HENRY F. DRAPER, B.A.

W HEN I graduated from the high school of Oswego, Kansas, in


1896 at the age of seventeen, I had the ambition to attend
college, the University of Kansas in particular, which seemed to me
to be the normal thing for a young man to do. My parents were in
full accord, as their example and precept had always been favorable
to as large a use of books as circumstances would allow. Though up
to that time my every educational need had been met, it was
recognized that my college training must come only after I had
earned the money to provide it. I was the oldest of five children and
my father’s income was only that of a country doctor in a county
seat, a town of 2500 inhabitants.

Before her marriage my mother had taught school and many of her
best friends and mine were teaching school at the time of my
graduation from the high school. This and perhaps more particularly
the further fact that I had received good grades at school seemed
logically to suggest that by teaching school I should earn money for
a college education. But during the summer of 1896, and, again the
next year, I sought in vain to persuade country school boards that I
was the proper person to teach the youth of their district. They
considered me rather young and forsooth lacking in experience,
which I was seeking a chance to secure. And so I was saved from
becoming a poor school teacher.

Opportunities as clerk, however, were offered and by the first of


April, 1901, I had experiences in hardware, grocery, and shoe stores.
The various changes were made through no fault of my own; but,
though they were in the nature of promotions, the financial return
was so slight that after five years I had perhaps not more than $50
saved toward my cherished college career.
On April 15, 1901, I began work for a real estate loan company with
duties but little more responsible than a fifteen-year-old office boy
might have discharged. The wages were small, but were soon
advanced. In four years I was earning what was accounted a goodly
amount for a town of that size. Though I had spent some money on
vacation trips each summer and for necessary things throughout the
year, I had saved a few hundred dollars.

Meanwhile, my brother, two and a half years younger than I, had


secured fairly remunerative work earlier in life than I had done. He,
too, wanted a college education and had entered the University of
Kansas in September, 1901. As nearly as I can recall he had enough
money to go through the first year without doing any outside work.
Occasionally during the next three years I lent him money which he
repaid when I was later in school; but in the main he supplemented
his summers’ earnings by strenuous activities during the school year.
He was at different times steward of a boarding club, night clerk at a
hotel, and one of the student assistants in the University library. His
experiences and difficulties were really of more interest, and more
particularly those of a student working his way through college than
any I can relate of myself.

In September, 1905, when twenty-six years old, I went to Lawrence,


Kansas, and enrolled in the state university as a special student. I
desired courses particularly in history and economics. As I expected
my college career to be limited to one year, I believed the special
classification was advisable. Because I wished to study as much as
possible I attempted no outside work, but I was economical in my
expenditures. Yet I did not then, nor at any later time, deprive
myself of a reasonable amount of recreation.

At the close of school in June, 1906, I returned to my work in the


real estate loan office in my home town. I was not satisfied with the
extent of the schooling received. I kept under my ambition, however,
and laid aside my earnings again until September, 1907. I then
returned to the University and again enrolled as a special student. I
started to earn my board by washing dishes, but after six weeks’
trial I found that it took so much time that I quit outside work and
gave myself wholly to study.

The spell of the college was now strong upon me and I wanted to
continue until I could secure a bachelor’s degree. To so shape my
course during the next three years as to correct the irregularities of
my “special” course was a task, especially since I was now vitally in
newspaper work and desired more courses in history and English
than the schedule permitted for a regular student.

Though I yet had money to my credit, I wanted to be able to aid my


sister who started this year. Therefore, to earn my board, I served as
table waiter at a club from September, 1908, to June, 1909.
Meanwhile, my outside duties on the student newspaper and in Y. M.
C. A. work increased in addition to the larger opportunities for
profitable recreation. Thus my life was growing strenuous.

In an effort to keep down expenses, I started the fall of 1909 as


associate steward of a club. Ill success attended me, and before
Christmas I was paying board. My work for the student newspaper
brought me some slight return financially, but not commensurate
with the time it took. I was also a member of the Y. M. C. A. cabinet
this year.

From September, 1910, to my graduation in June, 1911, I gave a


very considerable amount of time to my newspaper work and had
more pay therefore; but at the end of my course I had borrowed
several hundred dollars from a brother. I was on the Y. M. C. A.
cabinet during this last year also.

My university training has not prepared me for any get-rich-quick


career. Efforts since graduation to push ahead into a newspaper life
have added to, rather than taken from, my debt. Nevertheless, I do
not regret the plan of action which I followed to get a college
education. I cannot estimate in dollars the satisfaction I have in the
retrospect. I was not penurious with myself when in school, and so
enjoyed life, even though always economical. The friendships formed
and the larger vision of life which I now have compensate me for
past difficulties and those yet to be overcome ere I can obtain such
financial stability as I might have acquired six or more years ago if I
had been content to continue in the real estate loan office of my
home town.

Oklahoma City, Okla.


Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

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

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookluna.com

You might also like