SlideShare a Scribd company logo
Quick and Easy Ebook Downloads – Start Now at ebookluna.com for Instant Access
(eBook PDF) Introduction to Programming with Java:
A Problem Solving Approach 3rd Edition
https://ebookluna.com/product/ebook-pdf-introduction-to-
programming-with-java-a-problem-solving-approach-3rd-
edition/
OR CLICK BUTTON
DOWLOAD EBOOK
Instantly Access and Download Textbook at https://ebookluna.com
John Dean
Park University
Raymond Dean
University of Kansas
JAVA
WITH
A Problem Solving Approach
Introduction to Programming
dea75768_fm_i-xxxviii.indd 1 4/30/20 11:54 AM
12.10. Empty Statement 552
12.11. Using break to Exit from a Loop 554
12.12. for Loop Header Details 555
12.13. Enumerated Types 557
12.14. forEach Method, Lambda Expressions,
Method References, and Streams 564
12.15. Hexadecimal, Octal, and Binary
Numbers 573
12.16. GUI Track: Unicode (Optional) 574
12.17. Introduction to GridWorld Case Study
(Optional) 579
CHAPTER 13
Aggregation, Composition,
and Inheritance 591
13.1. Introduction 592
13.2. Composition and Aggregation 592
13.3. Inheritance Overview 599
13.4. Implementation of a Person/Employee/
FullTime Hierarchy 603
13.5. Constructors in a Subclass 605
13.6. Method Overriding 606
13.7. Using the Person/Employee/FullTime
Hierarchy 609
13.8. The final Access Modifier 610
13.9. Using Inheritance with Aggregation and
Composition 610
13.10. Design Practice with Card Game
Example 613
13.11. GridWorld Case Study Extensions
(Optional) 619
13.12. Problem Solving with Association Classes
(Optional) 626
CHAPTER 14
Inheritance and Polymorphism 637
14.1. Introduction 638
14.2. The Object Class and Automatic Type
Promotion 638
14.3. The equals Method 639
14.4. The toString Method 643
14.5. Polymorphism and Dynamic Binding 648
14.6. Assignments When the Two Sides’ Classes
Are Different 653
14.7. Polymorphism with Arrays 654
14.8. abstract Methods and Classes 660
14.9. Interfaces 663
14.10. The protected Access Modifier 673
14.11. GUI Track: Three-Dimensional Graphics
(Optional) 677
CHAPTER 15
Exception Handling 691
15.1. Introduction 692
15.2. Overview of Exceptions and Exception
Messages 692
15.3. Using try and catch Blocks to Handle
“Dangerous” Method Calls 693
15.4. Line Plot Example 695
15.5. try Block Details 699
15.6. Two Categories of Exceptions—Checked and
Unchecked 700
15.7. Unchecked Exceptions 702
15.8. Checked Exceptions 705
15.9. Generic catch Block with Exception
Class 708
15.10. Multiple catch Blocks and Multiple
Exceptions per Block 712
15.11. Understanding Exception Messages 714
15.12. Using a throws Clause to Postpone the
catch 718
15.13. Automatic Cleanup Using Try-With-
Resources 720
15.14. GUI Track: Line Plot Example Revisited
(Optional) 722
CHAPTER 16
Files, Buffers, Channels, and Paths 735
16.1. Introduction 736
16.2. Simple Text-File Example: HTML
File Generator 737
16.3. A Website Reader 741
16.4. Object File I/O 743
16.5. Character Sets and File-Access
Options 748
16.6. Buffered Text File I/O 749
16.7. Primitive Buffers with Random Access 752
16.8. Channel I/O and Memory-Mapped Files 760
viii Contents
dea75768_fm_i-xxxviii.indd 8 4/30/20 11:54 AM
16.9. Path, Whole-File, and Directory
Operations 767
16.10. Walking a Directory Tree 769
16.11. GUI Track: Final Iteration of Problem
Solving with CRC Cards (Optional) 775
CHAPTER 17
GUI Programming Basics 787
17.1. Introduction 788
17.2. SimpleWindow Program 791
17.3. Stage and Scene 794
17.4. JavaFX Components 796
17.5. Label Control 797
17.6. TextField Control 799
17.7. Greeting Program 801
17.8. Event Handling 805
17.9. Property Binding 809
17.10. JavaFX CSS 812
17.11. Scene Graph Inheritance 818
17.12. Style Sheets and Cascading 821
17.13. Button Control and FactorialButton
Program 826
17.14. Distinguishing Between Multiple Events 832
17.15. Colors 834
17.16. ColorChooser Program 838
CHAPTER 18
GUI Programming—Layout Panes 849
18.1. Introduction 849
18.2. Layout Panes 851
18.3. FlowPane and GridPane—Competing
Layout Philosophies 853
18.4. VBox Program with Two Stages and an
Image File 858
18.5. BorderPane 867
18.6. TilePane and TextFlow Containers 872
18.7. TicTacToe Program 878
18.8. Embedded Panes, HBox, and MathCalculator
Program 882
18.9. Plain Pane Container and Component
Positioning 889
CHAPTER 19
GUI Programming—Additional GUI
Components, Additional Event Handlers,
Animation 896
19.1. Introduction 897
19.2. User Interface Design 897
19.3. TextArea Control 898
19.4. CheckBox and RadioButton Controls 903
19.5. ComboBox Control 909
19.6. Job Application Program 913
19.7. ScrollPane and Menu Classes 918
19.8. Images and Mouse Events 922
19.9. Lunar Eclipse Program with Circle,
RadialGradient, and Slider 928
19.10. Animation 933
Appendices
Appendix 1	
ASCII Character Set 943
Appendix 2 Operator Precedence 945
Appendix 3 Java Keywords and Other Reserved
Words 947
Appendix 4 Packages and Modules 951
Appendix 5 Java Coding-Style Conventions 963
Appendix 6 Javadoc with Tags 975
Appendix 7 UML Diagrams 980
Appendix 8	
Number Systems and Conversions
Between Them 986
Additional Online Material
Chapter S6	
Writing Methods in a Non-Object-
Oriented Environment
Chapter S9	
Arrays in a Non-Object-Oriented
Environment
Chapter S17	
GUI Programming Basics
Chapter S18	
GUI Programming—Component
Layout, Additional GUI Components
Appendix 9 Multithreading
Index 990
Contents ix
dea75768_fm_i-xxxviii.indd 9 5/12/20 1:41 PM
x
In this book, we lead you on a journey into the fun and exciting world of computer programming. Through-
out your journey, we’ll provide you with lots of problem-solving practice. After all, good programmers
need to be good problem solvers. We’ll show you how to implement your problem solutions with Java
programs. We provide a plethora of examples, some short and focused on a single concept, some longer and
more “real world.” We present the material in a conversational, easy-to-follow manner aimed at making
your journey a pleasant one. When you’re done with the book, you should be a proficient Java programmer.
Our textbook targets a wide range of readers. Primarily, it targets students in a standard college-level
“Introduction to Programming” course or course sequence where no prerequisite programming experience
is assumed. We have included the topics recommended by the College Board for high school students
studying for advanced placement (AP) in computer science. So this text should be good for those students
as well.
In addition to targeting students with no prerequisite programming experience, our textbook targets
industry practitioners and college-level students who have some programming experience and want to
learn Java. This second set of readers can skip the early chapters on general programming concepts and
focus on the features of Java that differ from the languages that they already know. In particular, because
C++ and Java are similar, readers with a C++ background should be able to cover the textbook in a single
three-credit-hour course. (But we should reiterate for those of you with no programming experience:
No prerequisite programming experience is required in order to use this text.)
Finally, our textbook targets those who are learning Java on their own, outside of a classroom environ-
ment. This third set of readers should read the entire textbook at a pace determined on a case-by-case basis.
What’s New in This Edition?
The changes in this edition are big and small. Big changes include new chapters, reorganized chapter sec-
tions, new programming constructs, new program examples, and new exercises. Smaller changes include
updating explanations and anecdotes. We’ve combed the entire book for opportunities to improve the
book’s clarity and readability. The following list highlights the more significant changes that we’ve made
to this edition.
∙ Introductory Chapter
	
To keep up with the computer industry’s growth, we’ve made quite a few changes to Chapter 1, such
as updating the information in the computer hardware and Java history sections.
∙ Switching Constructs
	
Java 12 and Java 13 made improvements to the venerable switch statement, and this edition describes
those improvements. We use the new switching techniques (multiple comma-­
separated case constants
and no break statements) for programs throughout the book. And we use switch statements versus
switch expressions according to what the problem calls for. If you’re a fan of the old-style switch
statement, no worries, we provide a description early on which will help you with legacy code.
Preface
dea75768_fm_i-xxxviii.indd 10 4/30/20 11:54 AM
Preface xi
∙ Local Variable Type Inferencing
	
Java 10 introduced the ability to use var as a type (rather than int, double, etc.) for a local variable
declaration where the declaration is part of an initialization. We describe the new syntax, but for self-
documentation reasons, we stick with traditional explicit type declarations for the most part.
∙ Name Change for Static Variables and Static Methods
	
The powers that be (the Oracle documentation folks) now use the terms static variable and static
method for what used to be known as class variable and class method, so we’ve updated accordingly.
∙ Miscellaneous Java API Library Updates
	
With the new Java releases since the second edition, there have been quite a few updates to the Java
API library. We’ve updated our discussions and programs with new API method and constructor calls
when appropriate. Most of our new API content can be found in our GUI coverage, but there are other
API changes sprinkled throughout the book. For example, with Java’s deprecation of the wrapper
class constructors, we’ve refactored our programs to rely on the wrapper classes’ valueOf methods.
∙ New Section—forEach Method and Streams
	
We introduce the forEach method as a simple alternative to the for-each loop in the context of an
ArrayList. We then use the forEach method in the context of streams, where it really shines. We
describe streams in depth, with their exciting potential to take advantage of parallel processing to
improve a program’s efficiency.
∙ Lambda Expressions and Method References
	
Lambda expressions and method references are techniques that allow you to implement the function-
ality of a method so you can use it as an argument in a method call. We first present lambda expres-
sions and method references as arguments for a forEach method call. Later, we use lambda expressions
and method references extensively to help with the GUI programs.
∙ Interfaces with Static Methods and Default Methods
	
We’ve rewritten Chapter 14’s section on interfaces to include a discussion of static methods and
default methods. Oracle added them to interfaces because they support an interface’s ability to imple-
ment multiple inheritance effectively.
∙ End-of-Chapter GUI Sections
	
We’ve rewritten all of our end-of-chapter GUI sections to take advantage of Java’s newer GUI constructs.
∙ Three New Chapters—JavaFX
	
In this book’s second edition, we used the AWT and Swing platforms for our two GUI chapters. This
third edition moves those chapters to the book’s website. We provide three new chapters in the main
body of the book that describe GUI programming using the JavaFX platform. As part of that presenta-
tion, you’ll learn how to format your programs using JavaFX CSS properties.
∙ New Appendix—Modules
	
In Appendix 4, we introduce modules, which allow you to group together packages. Modules make it
easier to organize and share classes for different programming needs. They are used to facilitate the
configuration of Java software for diverse hardware and software platforms.
dea75768_fm_i-xxxviii.indd 11 5/10/20 8:49 PM
xii Preface
∙ New Exercises
	
We have substantially changed most of the exercises and altered almost all of them in some way. As
before, we provide exercise solutions on the password-protected instructor’s portion of the book’s
website.
Compliant with the College Board’s AP
Computer Science A Curriculum
We have put a great deal of effort into ensuring that this textbook is compliant with the College Board’s
Advanced Placement (AP) Computer Science A curriculum content. It follows all the AP Computer
Science A guidelines. As such, it appears on the College Board’s approved textbook list at
https://apcentral.collegeboard.org/courses/ap-computer-science-a/course-audit.
Textbook Cornerstone #1: Problem Solving
Being able to solve problems is a critical skill that all programmers must possess. We teach programmatic
problem solving by emphasizing two of its key elements—algorithm development and program design.
Emphasis on Algorithm Development
In Chapter 2, we immerse readers into algorithm development by using pseudocode for the algorithm
examples instead of Java. In using pseudocode, students are able to work through nontrivial problems on
their own without getting bogged down in Java syntax—no need to worry about class headings, semico-
lons, braces, and so on.1
Working through nontrivial problems enables students to gain an early apprecia-
tion for creativity, logic, and organization. Without that appreciation, Java students tend to learn Java
syntax with a rote-memory attitude. But with that appreciation, students tend to learn Java syntax more
quickly and effectively because they have a motivational basis for learning it. In addition, they are able to
handle nontrivial Java homework assignments fairly early because they have prior experience with simi-
larly nontrivial pseudocode homework assignments.
In Chapter 3 and in later chapters, we rely primarily on Java for algorithm-development examples. But
for the more involved problems, we sometimes use high-level pseudocode to describe first-cut proposed
solutions. Using pseudocode enables readers to bypass syntax details and focus on the algorithm portion
of the solution.
Emphasis on Program Design
Problem solving is more than just developing an algorithm. It also involves figuring out the best imple-
mentation for the algorithm. That’s program design. Program design is extremely important, and that’s
why we spend so much time on it. Frequently, we explain the thought processes that a person might go
through when coming up with a solution. For example, we explain how to choose between different loop
types, how to split up a method into multiple methods, how to decide on appropriate classes, how to
1
Inevitably, we use a particular style for our pseudocode, but we repeatedly emphasize that other pseudocode styles are fine so long
as they convey the intended meaning. Our pseudocode style is a combination of free-form description for high-level tasks and more
specific commands for low-level tasks. We’ve chosen a pseudocode style that is intuitive, to welcome new programmers, and struc-
tured, to accommodate program logic.
dea75768_fm_i-xxxviii.indd 12 4/30/20 11:54 AM
Preface xiii
choose between instance and static members, and how to determine class relationships using inheritance
and composition. We challenge students to find the most elegant implementations for a particular task.
We devote a whole chapter to program design—Chapter 8, “Software Engineering.” In that chapter,
we provide an in-depth look at coding-style conventions and documentation for programmers and users.
We discuss design strategies like separation of concerns, modularization, and encapsulation. Also in the
chapter, we describe alternative design strategies—top-down, bottom-up, case-based, and iterative
enhancement.
Problem-Solving Sections
We often address problem solving (algorithm development and program design) in the natural flow of
explaining concepts. But we also cover problem solving in sections that are wholly devoted to it. In each
problem-solving section, we present a situation that contains an unresolved problem. In coming up with a
solution for the problem, we try to mimic the real-world problem-solving experience by using an iterative
design strategy. We present a first-cut solution, analyze the solution, and then discuss possible improve-
ments to it. We use a conversational trial-and-error format (e.g., “What type of layout manager should
we use? We first tried the GridLayout manager. That works OK, but not great. Let’s now try the
BorderLayout manager.”). This casual tone sets the student at ease by conveying the message that it is
normal, and in fact expected, that a programmer will need to work through a problem multiple times
before finding the best solution.
Additional Problem-Solving Mechanisms
We include problem-solving examples and problem-solving advice throughout the text (not just in
Chapter 2, Chapter 8, and the problem-solving sections). As a point of emphasis, we insert a problem-
solving box, with an icon and a succinct tip, next to the text that contains the problem-solving example
and/or advice.
We are strong believers in learning by example. As such, our textbook contains a multitude of com-
plete program examples. Readers are encouraged to use our programs as recipes for solving similar pro-
grams on their own.
Textbook Cornerstone #2: Fundamentals First
Postpone Concepts That Require Complex Syntax
We feel that many introductory programming textbooks jump too quickly into concepts that require com-
plex syntax. In using complex syntax early, students get in the habit of entering code without fully under-
standing it or, worse yet, copying and pasting from example code without fully understanding the example
code. That can lead to less-than-ideal programs and students who are limited in their ability to solve a wide
variety of problems. Thus, we prefer to postpone concepts that require complex syntax. We prefer to intro-
duce such concepts later on, when students are better able to understand them fully.
As a prime example of that philosophy, we cover the simpler forms of GUI programming early (in
an optional graphics track), but we cover the more complicated forms of GUI programming later in the
book. Specifically, we postpone event-driven GUI programming until the end of the book. This is dif-
ferent from some other Java textbooks, which favor early full immersion into event-driven GUI pro-
gramming. We feel that strategy is a mistake because proper event-driven GUI programming requires a
great deal of programming maturity. When they learn it at the end of the book, our readers are better
able to understand it fully.
dea75768_fm_i-xxxviii.indd 13 4/30/20 11:54 AM
xiv Preface
Tracing Examples
To write code effectively, it’s imperative to understand code thoroughly. We’ve found that step-by-step
tracing of program code is an effective way to ensure thorough understanding. Thus, in the earlier parts of
the textbook, when we introduce a new programming structure, we often illustrate it with a meticulous
trace. The detailed tracing technique we use illustrates the thought process programmers employ while
debugging. It’s a printed alternative to the sequence of screen displays generated by debuggers in inte-
grated development environment (IDE) software.
Input and Output
In the optional GUI-track sections and in the GUI chapters at the end of the book, we use GUI commands
for input and output (I/O). But because of our emphasis on fundamentals, we use console commands for
I/O for the rest of the book.2
For console input, we use the Scanner class. For console output, we use the
standard System.out.print, System.out.println, and System.out.printf methods.
Textbook Cornerstone #3: Real World
More often than not, today’s classroom students and industry practitioners prefer to learn with a hands-
on, real-world approach. To meet this need, our textbook and its associated website include:
∙ compiler tools
∙ complete program examples
∙ practical guidance in program design
∙ coding-style guidelines based on industry standards
∙ Unified Modeling Language (UML) notation for class relationship diagrams
∙ practical homework-project assignments
Compiler Tools
We do not tie the textbook to any particular compiler tool—you are free to use any compiler tool(s) that you
like. If you do not have a preferred compiler in mind, then you might want to try out one or more of these:
∙ Java Standard Edition Development Kit (JDK), by Oracle
∙ TextPad, by Helios
∙ Eclipse, by the Eclipse Foundation
∙ Netbeans, backed by Oracle
∙ BlueJ, by the University of Kent and Deaken University
To obtain the above compilers, visit our textbook website at http://www.mhhe.com/dean3e, find the
appropriate compiler link(s), and download away for free.
Complete Program Examples
In addition to providing code fragments to illustrate specific concepts, our textbook contains lots of com-
plete program examples. With complete programs, students are able to (1) see how the analyzed code ties
in with the rest of a program, and (2) test the code by running it.
2
We introduce GUI I/O at the end of Chapter 3 with dialog boxes. That opens up an optional door for GUI fans. If readers are so
inclined, they can use the Alert, TextInputDialog, and ChoiceDialog classes to implement all our programs with GUI
I/O rather than console I/O.
dea75768_fm_i-xxxviii.indd 14 4/30/20 11:54 AM
Preface xv
Coding-Style Conventions
We include coding-style tips throughout the textbook. The coding-style tips are based on Oracle’s coding
conventions (https://www.oracle.com/technetwork/java/codeconvtoc-136057.html), Google’s coding con-
ventions (https://google.github.io/styleguide/javaguide.html), and industry practice. In Appendix 5, we
provide a complete reference for the book’s coding-style conventions and an associated example program
that illustrates these conventions.
UML Notation
UML has become a standard for describing the entities in large software projects. Rather than overwhelm
beginning programmers with syntax for the entire UML (which is quite extensive), we present a subset of
UML. Throughout the textbook, we incorporate UML notation to represent classes and class relationships
pictorially. For those interested in more details, we provide additional UML notation in Appendix 7.
Homework Problems
We provide homework problems that are illustrative, practical, and clearly worded. The problems range
from easy to challenging. They are grouped into three categories—review questions, exercises, and proj-
ects. We include review questions and exercises at the end of each chapter, and we provide projects on our
textbook’s website.
The review questions tend to have short answers, and the answers are in the textbook. The review
questions use these formats: short-answer, multiple-choice, true/false, fill-in-the-blank, tracing,
debugging, and write a code fragment. Each review question is based on a relatively small part of the
chapter.
The exercises tend to have short to moderate-length answers, and the answers are not in the textbook.
The exercises use these formats: short-answer, tracing, debugging, and write a code fragment. Exercises
are keyed to the highest prerequisite section number in the chapter, but they sometimes integrate concepts
from several parts of the chapter. For this third edition, we have changed almost all of the end-of-chapter
exercises, including exercises associated with unchanged material in the body of the text.
The projects consist of problem descriptions whose solutions are complete programs. Project solu-
tions are not in the textbook. Projects require students to employ creativity and problem-solving skills and
apply what they’ve learned in the chapter. These projects often include optional parts, which provide chal-
lenges for the more talented students. Projects are keyed to the highest prerequisite section number in the
chapter, but they often integrate concepts from several preceding parts of the chapter. For this third edition,
we have modified old projects and added new projects to make all projects conform to content in the body
of the current text. Because the most substantial body-of-text changes are in the final three chapters, most
of the project modifications and additions are associated with these chapters.
An important special feature of this book is the way that it specifies problems. “Sample sessions”
show the precise output generated for a particular set of input values. These sample sessions include inputs
that represent typical situations and sometimes also extreme or boundary situations.
Academic-Area Projects
To enhance the appeal of projects and to show how the current chapter’s programming techniques might
apply to different areas of interest, we take project content from several academic areas:
∙ computer science and numerical methods
∙ business and accounting
dea75768_fm_i-xxxviii.indd 15 4/30/20 11:54 AM
xvi Preface
∙ social sciences and statistics
∙ math and physics
∙ engineering and architecture
∙ biology and ecology
Most of the academic-area projects do not require prerequisite knowledge in a particular area. Thus,
instructors are free to assign almost any of the projects to any of their students. To provide a general reader
with enough specialized knowledge to work a problem in a particular academic area, we sometimes expand
the problem statement to explain a few special concepts in that academic area.
Most of the academic-area projects do not require students to have completed projects from earlier
chapters; that is, most projects do not build on previous projects. Thus, for the most part, instructors are
free to assign projects without worrying about prerequisite projects. In some cases, a project repeats a
previous chapter’s project with a different approach. The teacher may elect to take advantage of this rep-
etition to dramatize the availability of alternatives, but this is not necessary.
Project assignments can be tailored to fit readers’ needs. For example:
∙ For readers outside of academia—
Readers can choose projects that match their interests.
∙ When a course has students from one academic area—
Instructors can assign projects from the relevant academic area.
∙ When a course has students with diverse backgrounds—
	
Instructors can ask students to choose projects from their own academic areas, or instructors can
ignore the academic-area delineations and simply assign projects that are most appealing.
To help you decide which projects to work on, we’ve included a “Project Summary” section after the
preface. It lists all the projects by chapter and section, and for each project, it specifies:
∙ prerequisite chapter and section
∙ academic area
∙ estimated difficulty
∙ a title and brief description
After using the “Project Summary” section to get an idea of which projects you might like to work on, see
the textbook’s website for the full project descriptions.
Organization
In writing this book, we lead readers through three important programming methodologies: structured
programming, OOP, and event-driven programming. For our structured programming coverage, we intro-
duce basic concepts such as variables and operators, if statements, and loops. Then we show readers how
to call prebuilt methods from Oracle’s Java API library. Many of these methods, like those in the Math
class, are non-OOP methods that can be called directly. Others, like those in the String class, are OOP
methods that must be called by a previously created object. After an “interlude” that gives readers a brief
taste of what it’s like to write methods in a non-OOP environment, we move into OOP programming, and
introduce basic OOP concepts such as classes, objects, instance variables, instance methods, and construc-
tors. We also introduce static variables and static methods, which are useful in certain situations. However,
we note that they should be used less often than instance variables and instance methods. Next, we move
dea75768_fm_i-xxxviii.indd 16 4/30/20 11:54 AM
Visit https://testbankfan.com
now to explore a rich
collection of testbank or
solution manual and enjoy
exciting offers!
Preface xvii
on to more advanced OOP concepts—arrays, collections, interfaces, and inheritance. Chapters on excep-
tion handling and files provide a transition into event-driven GUI programming. We describe and employ
event-driven GUI programming in the final three chapters.
The content and sequence we promote enable students to develop their skills from a solid foundation
of programming fundamentals. To foster this fundamentals-first approach, our book starts with a mini-
mum set of concepts and details. It then gradually broadens concepts and adds detail later. We avoid over-
loading early chapters by deferring certain less-important details to later chapters.
GUI Track
Many programmers find Graphical User Interface (GUI) programming to be fun. As such, GUI program-
ming can be a great motivational tool for keeping readers interested and engaged. That’s why we include
graphics sections throughout the book, starting in Chapter 1. We call those sections our “GUI track.” Most
of these end-of-chapter sections use GUI code that complements the current chapter’s previously pre-
sented non-GUI material. For readers who do not have time for the GUI track, no problem. Any or all of
the GUI track sections may be skipped because the rest of the book does not depend on any of the GUI-
track material.
Although the rest of the book does not depend on the GUI-track material, be aware that some of the
GUI-track sections depend on some of the material in prior GUI-track sections:
∙ Chapter 3’s GUI section introduces dialog boxes for user input, and dialog boxes are used in later GUI
sections for Chapters 10, 11, 15, and 16.
∙ Chapters 8, 10, and 16 have GUI sections that implement a common program, with iterative enhance-
ments in each new GUI section.
∙ Chapters 12 and 13 have GUI sections that implement a common GridWorld program (for readers
interested in the College Board’s AP Computer Science A curriculum). The GridWorld code uses
AWT and Swing GUI software.
Chapter 1
In Chapter 1, we first explain basic computer terms—what are the hardware components, what is source
code, what is object code, and so on. We then narrow our focus and describe the programming language
we’ll be using for the remainder of the book—Java. Finally, we give students a quick view of the classic
bare-bones “Hello World” program. We explain how to create and run the program using minimalist­
software—Microsoft’s Notepad text editor and Oracle’s command-line JDK tools.
Chapter 2
In Chapter 2, we present problem-solving techniques with an emphasis on algorithmic design. In imple-
menting algorithm solutions, we use generic tools—flowcharts and pseudocode—with pseudocode given
greater weight. As part of our algorithm-design explanation, we describe structured programming tech-
niques. In order to give students an appreciation for semantic details, we show how to trace algorithms.
Chapters 3–5
We present structured programming techniques using Java in Chapters 3–5. Chapter 3 describes sequential
programming basics—variables, input/output, assignment statements, and simple method calls. Chapter 4
describes nonsequential program flow—if statements, switch constructs, and loops. In Chapter 5, we
explain methods in more detail and show readers how to use prebuilt methods in the Java API library.
dea75768_fm_i-xxxviii.indd 17 4/30/20 11:54 AM
xviii Preface
In all three chapters, we teach algorithm design by solving problems and writing programs with the newly
introduced Java syntax.
Interlude
This “mini-chapter” contains two programs that show how to write multiple methods without using OOP.
The Interlude presents a fork in the road between two study sequences. For the standard study sequence,
read the chapters in the standard order (Chapters 1 through 19). For the “objects later” study sequence,
after reading Chapter 5, read the supplemental chapters S6 and S9 online before returning to Chapter 6,
where you’ll begin your study of OOP in earnest.
Chapters 6–7
Chapter 6 introduces the basic elements of OOP in Java. This includes implementing classes and imple-
menting methods and variables within those classes. We use UML class diagrams and object-oriented
tracing techniques to illustrate these concepts.
Chapter 7 provides additional OOP details. It explains how reference variables are assigned, tested for
equality, and passed as arguments to a method. It explains overloaded methods and constructors. It also
explains the use of static variables, static methods, and different types of named constants.
Chapter 8
While the art of program design and the science of computerized problem-solving are developed through-
out the textbook, in Chapter 8, we focus on these aspects in the context of OOP. This chapter begins with
an organized treatment of programming style. It introduces javadoc, the Java application that automati-
cally generates documentation for user-programmers. It describes ways to communicate with users who
are not programmers. It describes organizational strategies like separation of concerns, modularization,
encapsulation, and provision of general-purpose utilities. Coded examples show how to implement these
strategies. It describes the major programming paradigms—top-down design, bottom-up design, using
pre-written software for low-level modules, and prototyping.
Chapters 9–10
Chapter 9 describes arrays, including arrays of primitives, arrays of objects, and multidimensional arrays.
It illustrates array use with complete programs that sort, search, and construct histograms. Chapter 10
describes Java’s powerful array alternative, ArrayList. This provides a simple example of generic-­element
specification. It also introduces the Java Collections Framework, which in turn, provides natural illustrations
of Java interfaces. The prewritten classes in the Java Collections Framework provide a simple introduction of
sets, maps, and queues. A relatively short but complete program shows how the pre-written Java implementa-
tions of these data structures can be used to create and traverse a multiconnected random network.
Chapter 11
Chapter 11 describes another way to process a collection of data—recursion. This chapter includes a
­
discussion of various recursive strategies. It introduces recursion with a real-life example and a familiar
problem that one can solve easily with either looping or recursion. Then it moves gradually to problems
that are harder to solve with looping and more easily solved with recursion. Although this chapter
appears after the chapter on ArrayLists and the Java Collections Framework, it does not depend on
these ­
concepts—it uses just ordinary arrays.
dea75768_fm_i-xxxviii.indd 18 5/12/20 1:23 PM
Preface xix
Chapter 12
Early on, students need to be immersed in problem-solving activities. Covering too much syntax detail
early can detract from that objective. Thus, we initially gloss over some less-important syntax details and
come back to those details later in Chapter 12. This chapter provides more details on items such as these:
∙ byte and short primitive types
∙ Unicode character set
∙ type promotions
∙ postfix versus prefix modes for the increment and decrement operators
∙ conditional operator
∙ short-circuit evaluation
∙ enum data type
∙ forEach method
∙ lambda expressions
∙ method references
∙ streams
The chapter ends with a friendly introduction to a relatively large public-domain program called Grid-
World, which the College Board has used for many years as part of its AP Computer Science A course of
study. This gives students a glimpse of how larger programs are organized.
Chapters 13–14
Chapters 13 and 14 describe class relationships in depth with numerous examples. Chapter 13 describes
aggregation, composition, and inheritance. Chapter 14 describes advanced inheritance-related details such
as the Object class, polymorphism, abstract classes, and the finer points of interfaces. An optional section
at the end of Chapter 13 describes an extension of the GridWorld environment introduced in Chapter 12
and provides additional exposure to Java’s legacy AWT and Swing graphics. Exercises in Chapters 13 and
14 relate material in these two chapters to corresponding GridWorld features.
Chapters 15−16
Chapter 15 describes exception handling, and Chapter 16 describes files. We present exception handling
before files because file-handling code requires the use of exception handling. For example, to open a file
one must check for an exception. In addition to simple text I/O, our treatment of files includes buffering,
random access, channeling, and memory mapping.
Chapters 17−19
As in the end-of-chapter GUI sections, Chapters 17−19 present GUI concepts using the JavaFX platform.
But the programming strategies differ. What follows are the strategies used in Chapters 17–19 (which are
different from the strategies used in the end-of-chapter GUI sections). For user input, the programs use the
components TextField, TextArea, Button, RadioButton, CheckBox, ComboBox, ScrollPane, and Menu.
For layout, the programs use the containers FlowPane, VBox, HBox, GridPane, BorderPane, TilePane, and
TextFlow. For formatting, the programs use JavaFX CSS properties.
Depending on how much and what kind of GUI techniques you’re interested in, you can study one or
more of the end-of-chapter GUI sections or skip all of them. That won’t affect your ability to grasp what’s
in Chapters 17−19. If you’re short on time, you can omit all of the book’s GUI material without compro-
mising your understanding of other material in the book.
dea75768_fm_i-xxxviii.indd 19 5/10/20 8:50 PM
xx Preface
Chapters S17−S18
Chapters S17 and S18 (the S’s stand for supplemental) are posted online. They describe the older Java GUI
platforms—AWT and Swing. The trend has been for new Java programs to use JavaFX, and not AWT and
Swing. However, there’s quite a bit of AWT and Swing code currently in production, and that means
there’s still a need for Java programmers to understand the older techniques so they can update and improve
existing code. So if you find yourself in that position, Chapters S17 and S18 are a good starting point for
learning what you need to know.
Appendices
Most of the appendices cover reference material, like the ASCII character set and the operator precedence
table. For this third edition, we have updated Appendix 4 by including a detailed description of Java modules.
Subject-Matter Dependencies and
Sequence-Changing Opportunities
We’ve positioned the textbook’s material in a natural order for someone who wants fundamentals and also wants
an early introduction to OOP. We feel that our order is the most efficient and effective one for learning how to
become a proficient OOP programmer. Nonetheless, we realize that different readers have different content-
ordering preferences. To accommodate those different preferences, we’ve provided some built-in flexibility.
Figure 0.1 illustrates that flexibility by showing chapter dependencies and, more importantly, chapter
­
nondependencies. For example, the arrow between Chapter 3 and Chapter 4 means that Chapter 3 must be read
prior to Chapter 4. Because there are no arrows going out of Chapters 1, 11, and 16 that point to other complete
chapters, you may skip those chapters without losing prerequisite material that later chapters need. We use
rectangles with rounded corners to indicate chapter sections that you may want to read in advance. If you choose
that option, you’ll want to return to the normal chapter sequence after completing the advanced sections.
Here are some sequence-changing opportunities revealed by Figure 0.1:
∙ Readers can skip Chapter 1, “Introduction to Computers and Programming.”
∙ For an earlier introduction to OOP, readers can read the OOP overview section in Chapter 6 after
reading Chapter 1.
∙ Readers can learn OOP syntax and semantics in Chapter 6 after finishing Java basics in Chapter 3.
∙ For additional looping practice, readers can learn about arrays in Chapter 9 after finishing loops in Chapter 4.
∙ Readers can skip Chapter 11, “Recursion,” and Chapter 16, “Files.”
∙ Readers who prefer a late objects approach can postpone reading Chapter 6, “Object-Oriented Pro-
gramming,” by first reading Chapter S6, “Writing Methods in a Non-Object-Oriented Environment,”
Sections 9.1–9.6 (which explain the basics of arrays), and Chapter S9, “Arrays in a Non-Object-
Oriented Environment.”
∙ For GUI programming, readers who prefer the Swing platform should read Chapters S17 and S18.
To support content-ordering flexibility, the book contains “hyperlinks.” A hyperlink is an optional
jump forward from one place in the book to another place. The jumps are legal in terms of prerequisite
knowledge, meaning that the jumped-over (skipped) material is unnecessary for an understanding of the
later material. We supply hyperlinks for each of the nonsequential arrows in Figure 0.1. For example, we
supply hyperlinks that go from Chapter 1 to Chapter 6 and from Chapter 3 to Chapter 12. For each hyperlink
tail end (in the earlier chapter), we tell the reader where they may optionally jump to. For each hyperlink
target end (in the later chapter), we provide an icon at the side of the target text that helps readers find the
place where they are to begin reading.
dea75768_fm_i-xxxviii.indd 20 5/12/20 1:24 PM
Preface xxi
Figure 0.1 Chapter dependencies
Ch 5: Using Prebuilt Methods
Ch 1: Introduction
Ch 2: Algorithms and Design
Ch 3: Java Basics
Ch 4: Control Statements
§6.2 OOP
Overview
§6.1−§6.8 OOP
Basics
§12.6−§12.12 Alternate
Coding Mechanisms
§9.1−§9.6 Arrays
§12.1−§12.5 Type
Details
Interlude
Ch 8: Software Engineering
Ch 6: Object-Oriented Programming
Ch 7: OOP−Additional Details
§11.1−§11.5 Non-
Array Recursion
§9.1−§9.6 Array Basics
Chapter S6: Writing
Methods in a Non-Object-
Oriented Environment
Chapter S9: Arrays in a
Non-Object-Oriented
Environment
Ch 9: Arrays
Ch 10: ArrayList and
Introduction to Java Collections
Framework
Ch 12: Type Details and Alternate
Coding Mechanisms
Ch 11: Recursion
Ch 13: Aggregation, Composition
and Inheritance
Ch 16: Files
Ch 14: Inheritance and
Polymorphism
Ch 15: Exception
Handling
Ch S17: Swing GUI
Programming Basics
Ch 17: GUI Programming Basics
Ch 18: GUI Programming—
Layout Panes
Ch 19: GUI Programming—
Additional GUI Components,
Additional Event Handlers, Animation
Ch S18: Swing GUI
Component Layout,
Additional GUI Components
dea75768_fm_i-xxxviii.indd 21 4/30/20 11:54 AM
Discovering Diverse Content Through
Random Scribd Documents
(eBook PDF) Introduction to Programming with Java: A Problem Solving Approach 3rd Edition
(eBook PDF) Introduction to Programming with Java: A Problem Solving Approach 3rd Edition
(eBook PDF) Introduction to Programming with Java: A Problem Solving Approach 3rd Edition
The Project Gutenberg eBook of If You're
Smart—
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: If You're Smart—
Author: Malcolm Jameson
Illustrator: William A. Kolliker
Release date: February 24, 2020 [eBook #61498]
Most recently updated: October 17, 2024
Language: English
Credits: Produced by Greg Weeks, Mary Meehan and the Online
Distributed Proofreading Team at http://www.pgdp.net
*** START OF THE PROJECT GUTENBERG EBOOK IF YOU'RE SMART
— ***
(eBook PDF) Introduction to Programming with Java: A Problem Solving Approach 3rd Edition
IF YOU'RE SMART—
By Colin Keith
Seems a pretty obvious crack for a business
sharper
to make to an inventor. If you're so smart,
why
don't you make some money yourself? Maybe
so.
But this scientist had an even better answer—
[Transcriber's Note: This etext was produced from
Astounding Science-Fiction April 1942.
Extensive research did not uncover any evidence that
the U.S. copyright on this publication was renewed.]
If you're so damn smart, why ain't you rich?
That hoary wisecrack must have been all of three centuries old when
Wolf Carmichael pulled it on Dr. Claud Kellog. The Wolf of Saturn
loved it and used it often. That day he lay back in his swivel chair,
chuckling offensively somewhere in the fatty depths of his triple
chin, as he threw it. But his roving, piggish eyes showed no mirth.
They were hard and scheming, the ruthless eyes that had made him
master of all commerce and industry throughout the Saturnian
system. To his money-grubbing mentality, this question was the
ultimate in triumphant repartee.
A scholar named Archimedes was asked that question once,
replied Dr. Kellog, flushing angrily, and to prove he could be rich if
he wished, he knocked off his important mathematical researches
long enough to buy up all the wine presses in the country. It was
winter, then, but when the next fall came the vintners had to have
their presses back or else lose the grape crop. Archimedes made a
tidy profit.
Never heard of him, snorted Carmichael. Musta been some little
fellow on Venus. If he was a real big shot in the booze racket, he'd
be on the board of Interplanetary Distillers. He aint.
Carmichael threw away the stump of the cigar he was smoking and
lit another.
To get back to this gadget of yours, he resumed indifferently.
Maybe it's as good as you say, maybe not. But George Carmichael
was always the boy to give a struggling inventor a chance—
Kellog winced. Yeah. Wolf would back anything that promised sure
profit and no loss—provided he was given control.
—so here's what I'm willing to do. Your proposition to have me lend
you enough to get your machines built is out—the machines might
flop, then where'd I be? What we'll do is this—incorporate your
whatchamacallit—
Antichron.
Antichron, huh? We'll incorporate it first, then put it into production.
I get fifty-five percent of the stock for promotion fee, we sell twenty
to the public for working capital, and all the rest is yours. See?
Kellog saw. It was a typical Carmichael proposition. Kellog would
furnish the work and brains, the sucker public the money. If the
venture failed, Carmichael couldn't be hurt; if it succeeded, he would
rake in the lion's share. Kellog reached for his hat and jammed it on
his head.
That's pure burglary, Mr. Carmichael, he said fairly evenly,
mustering all his powers of self-restraint. I'll see you in hell first.
Tut, tut, my boy, said Carmichael with a repetition of his nasty
chuckle, how fiery you are! That's bad. You should never mix
emotion with business. Take me. Am I offended? No. I'll be here
tomorrow, and the day after that, and the day after that, ready to do
business with you. You'll come back—they always do.
Kellog only glared at him, then strode from the room, boiling at the
arrogance of the grasping capitalist. And as he angrily made his way
down the main street of Saturnport, everything he saw added to his
rage—and to his gloom, too. For every enterprise of any magnitude
on Titan, or on any of the other Saturnian satellites, was owned or
controlled by Carmichael. The list was an imposing one. Carmichael
was the president of the Titanic Trust Co., the only bank. He owned
the Saturnport Supply Co. and Titan Shipyards outright. He had a fat
finger in Rhean Ranches, Miman Mines, Titan Radio Power, the Dione
angrauk packeries, and the ruby pits on Enceladus. What burned up
Kellog the most was Trans-Saturnian Lighter Service.
That line of small intersatellite freighters had been established and
built by his father, years before. It supplied a much-needed service,
for the great interplanetary ships stopped only at Saturnport. The
little lighters carried the slaughtered angrauks from Rhea to the
packeries of Dione, and thence to the big port. They hauled ores
from the mines of Mimas to the smelters on Titan, and did other
chores of the kind. Carmichael saw it was a profitable line and tried
to buy into it. The elder Kellog resisted. Carmichael shut down his
mines for a year, cutting off important revenue. A quarantine on
angrauks was mysteriously promulgated; taxes on intersatellite
shipping increased. The bank called Kellog's notes. His lighter service
was forced into bankruptcy.
And Carmichael bought it for a song, muttered Doc, bitterly, had
the new taxes repealed and the quarantine rescinded. It broke dad's
heart.
That was the way the Wolf of Saturn did things. Honeyed words,
cash advances, at first, anything for a foothold. Then squeeze,
squeeze until the enterprise was his. Now that he had the colonies
of the Saturnian system well under his thumb, he was branching out
into larger fields. He had ambitions of going back to the Earth one
day and taking his place among the mighty in Wall Street, where the
Systemic Stock Exchange was. He wanted to lock horns with such
magnates as Aalman, head of Venus Exploitation, Inc., and chairman
of the board of the Tellurian Master Bank. He wanted a bigger say-so
in the operation of the Interplanetary Transport Co. and a
directorship on Etherways, the planets' communication system.
Therefore, when he was not in his office at the Carmichael Building,
he could be found in the brokerage office of Neville  Beardsley,
trading fiercely in securities, trying to match wits with Aalman and
the other tycoons.
Doc Kellog knew all that and knew how hopeless his fight was. Yet
that illiterate taunt still rang in his ears. He was smart, but he wasn't
rich. There must be something wrong with his approach to things.
Other men with half his brains got along and prospered; why
couldn't he? That thought was uppermost in his mind when he
reached his laboratory.
What luck, Doc? asked cheery Billy Wade, his chief assistant.
The usual, growled Kellog. He wants to hog the show, otherwise
no dice. I told him to go to hell.
Swell, grinned Billy Wade, admiringly, but where do we get off?
Fold up and get jobs somewhere?
Maybe. Doc Kellog's anger had cooled somewhat and dejection
had succeeded it. But he was not quite ready to surrender. The
memory of that sneering challenge still rankled. Kellog sat down and
stared at the floor in deep thought.
Things looked black. The single model of his antichron worked
perfectly. It had proved that his theory was correct. He could warp
space-time, given power enough, and bring all the planets together,
just as centuries before the introduction of telegraph and radio
brought all the countries of the Earth together. But his money was
gone, his bills mounting, and he was forced to deal with interlocking
monopolies for all his supplies, power and credit. Carmichael knew
that as well as he did and was waiting for the plum to drop in his
lap. Kellog knew that Carmichael would fight him tooth and nail
unless he cut him in. And that Kellog was resolved not to do.
He had never thought of his invention in terms of money before, but
rather in terms of the immense boon it would be to all humanity,
taking it for granted that his own compensation would be just and
adequate. But now he was racking his brain for a way to turn it into
money—lots of money—and quickly. He had exhausted all his own
resources in building the one model he had, and the power bills
were eating him up. If they were not paid by the end of the week,
Titan Power would attach his laboratory and its contents, which was
the same as saying Carmichael would.
Antichron—what were its chief virtues? What could he cash in on
now? For he must not only save what he had, but construct other
machines to introduce to the public. He sat up and looked at his
model thoughtfully. It was a clumsy-looking device, a monster
machine taking up the whole side of the room. Its main feature was
a six-foot-square crystal window, framed by shiny steel panels
studded with knobs, dials, glowing tubes, buttons and cranks. The
crystal resembled an ordinary televise scanner of the type used by
Etherways, except that it was thicker and double-faced. Whatever
form of energy, whether heat, electricity or light, impinged on one
face was immediately transmitted to the other. Where it differed
from the standard models was that its two faces could be split apart
when subjected to antichronic stresses, and separated by any
number of millions of miles. But the same antichronic stresses also
created a warp in space-time so that the interval seemed not to
exist. It was a window that with the proper manipulations of its
complex controls could be made to look upon any spot in the
universe and receive energy impulse from it then.
That then was its great virtue. Long before space travel was an
actuality, mathematicians had known that there was no such thing
as simultaneity. Time, like space, was relative. They had had their
first practical demonstration of it when they tried to use two-way
television between the Earth and Moon. Radio waves took a little
over a second to travel each way. A man would speak, then wait for
two seconds before his answer began coming back to him. Later,
that time lag became almost intolerable. From Callisto it was three
quarters of an hour—you activated the machine, waited forty or so
minutes for it to light up, and then you waited an equal period for
the inquiring face looking at you to register understanding and begin
his reply. Obviously, where an hour and a half intervened between
question and answer, sprightly conversation was impossible. The
antichron would cure that. With the space between warped out of
existence, instantaneous response could be had.
Why ain't I rich, huh? repeated Kellog, sourly, and began thinking
on how men got rich. Not by inventing useful things or hard work,
necessarily. He thought of Carmichael's career, and Aalman's, and
those of others. They had one common denominator—they were
men who bought and sold, bought cheap and sold dear. And where
did they find their sellers and buyers? Why, on the Stock Exchange,
of course. Kellog's eyes lit up and he almost trembled with
excitement as the full implications of that chance thought dawned
upon him. He jumped up and called Wade to him.
How much money have we? he asked excitedly.
Billy Wade pulled out a wallet and squinted at its contents.
There's about a thousand here of my own and the three thousand
you gave me to keep for the power bill.
Willing to gamble?
Wade just grinned and handed over the money.
Quick, now. Grab the current 'Ephemerides' and find the Earth's
present position and rate of relative movement. Then look up the
exact latitude and longitude of the lower tip of Manhattan Island—
that's in New York.
Kellog ran over to the antichron and began setting the dials as Wade
called out the figures. Then he threw a master switch and the
machine hummed into activity. In a moment the screen was glowing,
then transparent. It was as if Kellog were looking out of a window
high over a green park surrounded on three sides by water. He
adjusted the mechanism and caused the projected screen to lower
itself to a great sprawling building that lay below. He forced it
through a wall, and there he was—looking in on the trading floor of
the nerve center of the Solar System, the Systemic Stock Exchange!
Thousands of men were milling about beneath, gesticulating and
shouting. At the other end of the vast hall an immense annunciator
board stood, on which names and numbers appeared. A flickering
screen beside it was displaying news flashes.
A notebook! Hurry! exclaimed Doc Kellog. He jotted down
quotations as he watched. Callistan Radioactives was high and
climbing—a sale at 423-1/2, then another at 428, then at 430-1/4. A
flash came over the screen saying Martian Gems had passed its
dividend. Martian Gems promptly dropped twelve points. Etherways
and I. P. T. were strong. The market generally was strong.
Let her run, Doc shouted, shoving the book into his pocket. Damn
the power bill. If I'm right, it won't matter; if I'm wrong, it won't
matter either. I'll be seeing you.
Then he was out and gone, hurrying to Neville  Beardsley.
Mr. Neville took the money, but he looked at the young scientist
dubiously.
Small margin accounts are dangerous, he warned. We accept
them, but we don't solicit them. Those wolves out there will take the
shirt off your back so quick it will make your head swim.
Fair enough, answered Kellog cheerfully. As a matter of fact, I am
in the market for a few wolfskins myself. Here, buy me some
Callistan Radioactives and sell some Martian Gems; all you can for
the money.
Neville grunted disapprovingly, but took the money. Nobody but an
ignorant fool would sell Martian short, and Callistan was no bargain
above 400. Kellog went on into the board room and sat down behind
the group of local capitalists who were scanning the board in a
listless, bored way. Kellog had a hard time restraining his elation, for
the figures on the board they were looking at were ancient history to
him. His information was over an hour ahead of it. After a while he
got up and phoned Wade from a booth.
Read me the latest dope, he said. Then listened as Wade gave him
the quotations. Martian had stopped falling; there was a flurry in
Oberon Metals. He hung up and stopped at Neville's desk on the way
back to his chair.
Cover that Martian sale, then buy me some Oberon.
Neville blinked. Oberon had been inactive for days. But he noticed
Kellog had doubled his money on the Martian transaction, and had a
nice paper profit on his Callistan stock.
Beginner's luck, he cautioned, as he filed the order.
When Kellog got the day's close from Wade, he closed out his line. It
was not a bad day's work. His cash balance on Neville's books was
over fourteen thousand. He left it there; tomorrow was another day.
The next day he ran the fourteen thousand up to forty-five. The day
after that he finished up with a couple of hundred. He drew enough
of it to pay the power bill, then walked on to the booking office of
Titan General Shops.
Last week, said Kellog to the clerk, I left an order here for some
parts for a special televise machine—
It's N. G., said the insolent clerk. Credit disapproved.
I've got the money now, added Kellog. But the clerk shook his
head and walked away. Over his shoulder he flung:
You gotta get Wolf's O. K. He stopped it—personally.
Oh, said Kellog. So he wouldn't be permitted to develop his
invention on Titan even if he had money! Carmichael held the reins
—the supply house, the shops, the power plant, transportation.
Kellog walked slowly back to his laboratory, thinking on the way
what his next step would be.
The following day he had better luck. When he looked from his
antichron onto the clamoring mob of Wall Street brokers he knew at
once that something unusual was afoot. Pandemonium reigned, and
often awed faces would turn to stare up at the quotation board with
its ever-changing symbols of good and bad news. Kellog read the
last bulletin hurriedly.
Following the suicide early this morning of Charles Bean, general
manager of Venus Exploitation, rumors persist that the company's
billion-dollar investment in mimil plantations has had to be written
off as a total loss. The stock opened at 240, but fell off over a
hundred points in the first few minutes of trading. The last sale was
at 97—
Kellog waited, tense. He watched Exploitation sink rapidly to 60, 50,
then 40. A gong rang and the screen lighted up again.
A correction to the last bulletin, it said. President Aalman has
made a statement. He says that Bean's suicide was due entirely to
domestic difficulties. The mimil venture has been tremendously
successful. So much so that the board of directors announce a one
hundred percent stock dividend and an equal amount in cash. He
further states that he will buy personally all the stock that is offered
under 500.
At once the tumult on the floor increased to a howling typhoon of
sound as the brokers suddenly reversed their position and began
hunting sellers as fervidly as they had previously been hunting
buyers. The bidding was wild, leaping by bounds to ever-higher
figures. Exploitation rose from its depths like a soaring skyrocket—up
into the hundreds, past the five-hundred mark of Aalman's bid, on to
a thousand and upward.
Another gong. Another announcement.
It is apparent that an effort is being made to corner Venus
Exploitation. The Exchange authorities have ordered, dealings in the
stock suspended. Speculators short of stock may settle at the rate of
two thousand dollars per share.
Wow! yelled Doc Kellog, and a moment later he was burning up
the road to Neville  Beardsley.
The board room was crowded when he got there. All the big shots of
Titan were present, not excepting Carmichael. There was sheer
panic in the faces of some as they stared at the earlier bulletins, for
Exploitation represented a heavy investment for most of them. Even
Wolf's usually expressionless face showed concern as he saw his
spare millions dwindle to half and less. He was so intent on following
the damning figures that he did not notice the entrance of Kellog, or
that he sat down beside him in the chair vacated by a haggard man
who had just rushed despairingly from the room.
It's more of Aalman's skulduggery, the pirate! growled Carmichael
to the fellow sitting on the other side. He's looted the company,
that's what. We're stuck. I'm getting out while I can.
He wrote an order and beckoned to Neville.
The hell of it is, Wolf added, to his crafty-looking partner, that
while this order is getting to New York, the stock will drop forty
points more. Damn that time lag!
Neville approached, bowed respectfully, and took the order. He
looked at it, then remarked:
This is for more than you own. Are you taking a short position?
Right! The stuff's wallpaper. When Aalman milks 'em, they stay
milked. Tomorrow I can cover at three. Get rid of this—quick.
Neville bowed again and turned away. Kellog plucked him by the
sleeve. He had sneaked a look at the order. The amount he had on
balance would margin it.
I'll take that—at the current price, he whispered. You needn't
send it to New York.
You're crazy, said Neville, but he noted the order.
Kellog sat back and waited, gloating. In a few minutes the news
would come through that the market had reversed itself. He had
made a brilliant double play. If Carmichael's selling order had gone
through in the regular way, when it hit New York his stock would
have brought him hundreds of dollars a share; conversely, if his own
buying order had, he would have had to pay the corresponding
price. As it was, he got Carmichael's stock at 43, close to the
bottom, and for it Wolf received but 43.
Whipsawed! Carmichael yelled when Aalman's bullish statement
was broadcast. The dirty rattlesnake. He started the rumors to
depress the stock; now he's buying it in at a bargain. Neville! Cancel
my selling orders.
Neville was late in coming. In the meantime the later flash showed
on the screen—the one telling of suspension of trading and the
penalties levied on short-sellers.
Sorry, sir, said Neville, as placatingly as possible, but it is already
executed. You said quick, so I disposed of it locally.
Carmichael snorted and looked about him.
What fool— he began, but Neville simply said, The gentleman on
your right.
Carmichael glared at Kellog. Kellog glared right back.
You! howled Wolf, his porcine eyes incredulous.
Me, grinned Kellog. You owe me five thousand shares of
Exploitation, I believe. I want it.
Carmichael sputtered and gazed questioningly at Neville. It must be
a joke—this silly upstart of a scientist holding the whip hand over
him. Why, only a few days before he had come whining to his office
for the loan of a miserable few thousand. Now he was demanding
ten million. Preposterous!
If you haven't the cash, I'll settle for a deed to Titan Shops, lock,
stock and barrel, offered Kellog smoothly, but he could not conceal
the triumph in his eyes. I am rather anxious to get a little job done
there, but up to now they haven't been very ... uh ... co-operative.
Carmichael grunted like a prodded boar, frowning. He was in a tight
spot; he knew it. He had to settle and he did not have the cash.
Moreover, it hurt him to give up a property. But there seemed to be
no choice, and he was aware that the other speculators in the room
were watching him closely. He couldn't welsh—not openly.
Done! he exploded.
That night Kellog took over the Titan General Shops. He and Wade
worked late, laying out the program for the following day. Tomorrow
they would start construction on the first batch of commercial
antichrons. But just at midnight a messenger came, bearing a
communication from the power company. It read:
You are hereby notified that due to inadequate generating
facilities, Titan Radio Power finds itself compelled to curtail
its service. Since our contract to furnish your plant with
power was made with Mr. George Carmichael personally
and not with the Titan General Shops, the change of
ownership voids it. All service will be discontinued within
four hours.
The dirty rat! blazed Kellog.
Wolf is the word, corrected Billy Wade with a sigh. You can't beat
him.
We'll see, said Kellog grimly. Let's have a look at the electrical
hook-up here. Maybe we can use antichron in another way.
Neither he nor Wade attempted to sleep that night. They were much
too busy. The machine was retuned and put in search for the New
York home of the general manager of Tellurian Power. They found
him, aroused him and made their proposition. Yes, the Earth plants
had unlimited power. Yes, if Kellog could project a receiving plate
into one of Tellurian's generating plants, its men would connect
leads to it. The general manager doubted whether power could be
transmitted from planet to planet—it had never been done before—
but if they would pay for it, he would send it.
Kellog closed the deal. Then he and Wade went about altering the
antichron for gathering pure current, not light. They marked the
back face to show where the Earthly electrodes should be placed. On
the front they attached their own connections. Those led to the
shops. Then they set the space-time warper to working. In a
moment the back face was gone. No doubt, at that instant, startled
engineers were puzzling over the bizarre outlet that had suddenly
appeared in their plant.
Say, said Billy Wade. He said unlimited power, didn't he? And the
rate there is a tenth what it is here. Why not peddle some juice on
the side?
Right! yelped Kellog, and he reached for a pad.
POWER FOR SALE, CHEAP
Owing to surplus productive capacity provided by new
owners, Titan General Shops is in a position to furnish any
quantity of power at the rate of ten cents a mega-watt
hour.
Get that to the Saturnport Herald to be run in the next edition, he
told Wade.
This'll wash up Titan Power, if my guess is any good, remarked
Wade cheerfully. They've been getting away with murder.
Yep, said Kellog dreamily. Carmichael would have to write off
another asset, for local power could not possibly compete with
Tellurian now that there was a way to transmit it. And the power
monopoly was the biggest plum in Wolf's basket.
In an hour the first surges of energy were coming in from Earth,
flowing from the antichron into the local radio distributing emission
set. The electricians at the plant simply tuned out on Titan Power
and in on the laboratory set. The shift was made.
Carmichael did not take the fresh assault upon him lying down. He
promptly went about getting an injunction against the unfranchised
sale of power, but it was several days before he could get it issued.
In the meantime, with the full facilities of the shop at his disposal,
Kellog had completed a batch of sight-sound antichrons for use in
communication. He hired and instructed operators. Then the
machines were focused on the various important planets, satellites
and asteroids. At one stroke Saturnport became the central clearing
house of the Solar System for news. If necessary, a Pluto signal
could be relayed through Titan to Earth in only the time necessary to
make the connections. Etherways was at once ruined. All its
equipment was junk, except for nearby use.
That ought to hurt, observed Billy Wade, jubilantly. They say Wolf
had a pile of Etherways Preferred.
Probably, said Kellog. But he was smarting under the injunction.
The corrupt local court had forbidden the outside sale of power. Not
only that, the Saturnport Council—all creatures of Carmichael—
issued an edict prohibiting the importation of power generated
outside of Titan. This time the shops did have to close down until
Kellog could improvise some old-fashioned magnetic generators of
the field-armature type. Not content with inflicting those
inconveniences on Kellog, Carmichael might be expected next to
bring suit for personal damages ensuing from the collapse of
Etherways. Etherways represented the investment of important
money, and the men who lost were not the type who would console
themselves that their company had been replaced by something
incomparably better.
I've got to go all the way, concluded Kellog, soberly. If I don't get
him, he'll get me.
Again he put his and Wade's head together and designed a new type
of antichron. It was three-dimensional—a cubical box, to be exact,
with four sides and a bottom, but open at the top. It worked on the
same principle as the flat screen, but with slight variations. It
operated as a shuttle, not continuously.
Kellog put one of his television machines in focus with the mine on
Mimas. Miman Mines was only partly owned by Carmichael; he
controlled the industries on the lesser satellites by virtue of his
strangle-hold on transportation. So the manager was willing to talk
to Kellog.
What do you pay that buccaneer to haul ore to Titan? asked
Kellog.
Twenty cents a ton.
I'll haul it for two.
You can't, objected the manager. The Trans-Saturnian Lighter
Service's charter says—
I know what it says, snapped back Kellog. My father drew it up. It
confers a perpetual monopoly on all intersatellite ship-borne
commerce. Now listen. Clear a place about twenty feet square and
arrange to dump ore in it from twenty feet or more above. Mark it
off with safety lines and don't ever let a man step across the lines.
Then watch my smoke.
He cut the connection long enough to send similar instructions to the
receiving station by the smelter. Then he watched through the
antichron while the preparations were being made at both ends of
the line. When they were ready he turned the machine over to
Wade.
Wade sat down and got to work. His job was very much like that of
the operator of a grab bucket. He kept his eyes on the visual screen,
his hands on the controls of the cubical one.
Current!—the empty cube appears on Mimas—an avalanche of ore
fills it—shift current—it disappears from Mimas, appears at the
smelter on Titan—the unloading cradle on which it materializes tips
and dumps the ore—when it is upright again, shift current. Mimas,
fill; Titan, dump. Mimas, fill; Titan, dump. That was all there was to
it. Hundreds of tons a minute, delivered in Titan the day it is mined.
That shoots Interplanetary Transportation and Trans-Saturnian all to
hell, I should say, drawled the editor of the Herald, who had been
invited to watch the demonstration. He was conducting a campaign
to have Carmichael's injunction revoked. Now that the people knew
cheap power was available, they were angry about it. Yes,
continued the editor, they're sunk. I'm going to stroll down to the
bank and draw out my balance before the run starts.
What do you mean? asked Kellog.
Plenty. The bank is really a sort of holding company for Wolf. Now
that his companies are all shot, it'll crash. You may not know it yet,
but Carmichael is ruined. He will be a very sick wolf in an hour or
so.
Who is the Wolf of Saturn? People on Titan will point out a blowzy,
sodden old derelict who hangs out in a dive near the skyport and tell
you that Carmy, as they call him now, used to wear that title. He
was a big shot once, they say.
But if you should ask any of the frequenters of the big building on
lower Manhattan who the Wolf of Saturn is, they will tell you
instantly. It is a crackpot on Titan by the name of Kellog. He was the
fellow who ruthlessly and without warning wrecked two of the
biggest and most profitable enterprises in the universe—Etherways,
Inc., and Interplanetary Transport—and many of the smartest
financiers of the System with it. What a guy! Not only that, but he
wrecked the System's entire price structure with his cheap services.
Benefactor? they will squall. He's a wild man—a wolf!
*** END OF THE PROJECT GUTENBERG EBOOK IF YOU'RE SMART—
***
Updated editions will replace the previous one—the old editions will
be renamed.
Creating the works from print editions not protected by U.S.
copyright law means that no one owns a United States copyright in
these works, so the Foundation (and you!) can copy and distribute it
in the United States without permission and without paying
copyright royalties. Special rules, set forth in the General Terms of
Use part of this license, apply to copying and distributing Project
Gutenberg™ electronic works to protect the PROJECT GUTENBERG™
concept and trademark. Project Gutenberg is a registered trademark,
and may not be used if you charge for an eBook, except by following
the terms of the trademark license, including paying royalties for use
of the Project Gutenberg trademark. If you do not charge anything
for copies of this eBook, complying with the trademark license is
very easy. You may use this eBook for nearly any purpose such as
creation of derivative works, reports, performances and research.
Project Gutenberg eBooks may be modified and printed and given
away—you may do practically ANYTHING in the United States with
eBooks not protected by U.S. copyright law. Redistribution is subject
to the trademark license, especially commercial redistribution.
START: FULL LICENSE
THE FULL PROJECT GUTENBERG LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK
To protect the Project Gutenberg™ mission of promoting the free
distribution of electronic works, by using or distributing this work (or
any other work associated in any way with the phrase “Project
Gutenberg”), you agree to comply with all the terms of the Full
Project Gutenberg™ License available with this file or online at
www.gutenberg.org/license.
Section 1. General Terms of Use and
Redistributing Project Gutenberg™
electronic works
1.A. By reading or using any part of this Project Gutenberg™
electronic work, you indicate that you have read, understand, agree
to and accept all the terms of this license and intellectual property
(trademark/copyright) agreement. If you do not agree to abide by all
the terms of this agreement, you must cease using and return or
destroy all copies of Project Gutenberg™ electronic works in your
possession. If you paid a fee for obtaining a copy of or access to a
Project Gutenberg™ electronic work and you do not agree to be
bound by the terms of this agreement, you may obtain a refund
from the person or entity to whom you paid the fee as set forth in
paragraph 1.E.8.
1.B. “Project Gutenberg” is a registered trademark. It may only be
used on or associated in any way with an electronic work by people
who agree to be bound by the terms of this agreement. There are a
few things that you can do with most Project Gutenberg™ electronic
works even without complying with the full terms of this agreement.
See paragraph 1.C below. There are a lot of things you can do with
Project Gutenberg™ electronic works if you follow the terms of this
agreement and help preserve free future access to Project
Gutenberg™ electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation (“the
Foundation” or PGLAF), owns a compilation copyright in the
collection of Project Gutenberg™ electronic works. Nearly all the
individual works in the collection are in the public domain in the
United States. If an individual work is unprotected by copyright law
in the United States and you are located in the United States, we do
not claim a right to prevent you from copying, distributing,
performing, displaying or creating derivative works based on the
work as long as all references to Project Gutenberg are removed. Of
course, we hope that you will support the Project Gutenberg™
mission of promoting free access to electronic works by freely
sharing Project Gutenberg™ works in compliance with the terms of
this agreement for keeping the Project Gutenberg™ name associated
with the work. You can easily comply with the terms of this
agreement by keeping this work in the same format with its attached
full Project Gutenberg™ License when you share it without charge
with others.
1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside the
United States, check the laws of your country in addition to the
terms of this agreement before downloading, copying, displaying,
performing, distributing or creating derivative works based on this
work or any other Project Gutenberg™ work. The Foundation makes
no representations concerning the copyright status of any work in
any country other than the United States.
1.E. Unless you have removed all references to Project Gutenberg:
1.E.1. The following sentence, with active links to, or other
immediate access to, the full Project Gutenberg™ License must
appear prominently whenever any copy of a Project Gutenberg™
work (any work on which the phrase “Project Gutenberg” appears,
or with which the phrase “Project Gutenberg” is associated) is
accessed, displayed, performed, viewed, copied or distributed:
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.
1.E.2. If an individual Project Gutenberg™ electronic work is derived
from texts not protected by U.S. copyright law (does not contain a
notice indicating that it is posted with permission of the copyright
holder), the work can be copied and distributed to anyone in the
United States without paying any fees or charges. If you are
redistributing or providing access to a work with the phrase “Project
Gutenberg” associated with or appearing on the work, you must
comply either with the requirements of paragraphs 1.E.1 through
1.E.7 or obtain permission for the use of the work and the Project
Gutenberg™ trademark as set forth in paragraphs 1.E.8 or 1.E.9.
1.E.3. If an individual Project Gutenberg™ electronic work is posted
with the permission of the copyright holder, your use and distribution
must comply with both paragraphs 1.E.1 through 1.E.7 and any
additional terms imposed by the copyright holder. Additional terms
will be linked to the Project Gutenberg™ License for all works posted
with the permission of the copyright holder found at the beginning
of this work.
1.E.4. Do not unlink or detach or remove the full Project
Gutenberg™ License terms from this work, or any files containing a
part of this work or any other work associated with Project
Gutenberg™.
1.E.5. Do not copy, display, perform, distribute or redistribute this
electronic work, or any part of this electronic work, without
prominently displaying the sentence set forth in paragraph 1.E.1
with active links or immediate access to the full terms of the Project
Gutenberg™ License.
1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if you
provide access to or distribute copies of a Project Gutenberg™ work
in a format other than “Plain Vanilla ASCII” or other format used in
the official version posted on the official Project Gutenberg™ website
(www.gutenberg.org), you must, at no additional cost, fee or
expense to the user, provide a copy, a means of exporting a copy, or
a means of obtaining a copy upon request, of the work in its original
“Plain Vanilla ASCII” or other form. Any alternate format must
include the full Project Gutenberg™ License as specified in
paragraph 1.E.1.
1.E.7. Do not charge a fee for access to, viewing, displaying,
performing, copying or distributing any Project Gutenberg™ works
unless you comply with paragraph 1.E.8 or 1.E.9.
1.E.8. You may charge a reasonable fee for copies of or providing
access to or distributing Project Gutenberg™ electronic works
provided that:
• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”
• You provide a full refund of any money paid by a user who
notifies you in writing (or by e-mail) within 30 days of receipt
that s/he does not agree to the terms of the full Project
Gutenberg™ License. You must require such a user to return or
destroy all copies of the works possessed in a physical medium
and discontinue all use of and all access to other copies of
Project Gutenberg™ works.
• You provide, in accordance with paragraph 1.F.3, a full refund of
any money paid for a work or a replacement copy, if a defect in
the electronic work is discovered and reported to you within 90
days of receipt of the work.
• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.
1.E.9. If you wish to charge a fee or distribute a Project Gutenberg™
electronic work or group of works on different terms than are set
forth in this agreement, you must obtain permission in writing from
the Project Gutenberg Literary Archive Foundation, the manager of
the Project Gutenberg™ trademark. Contact the Foundation as set
forth in Section 3 below.
1.F.
1.F.1. Project Gutenberg volunteers and employees expend
considerable effort to identify, do copyright research on, transcribe
and proofread works not protected by U.S. copyright law in creating
the Project Gutenberg™ collection. Despite these efforts, Project
Gutenberg™ electronic works, and the medium on which they may
be stored, may contain “Defects,” such as, but not limited to,
incomplete, inaccurate or corrupt data, transcription errors, a
copyright or other intellectual property infringement, a defective or
damaged disk or other medium, a computer virus, or computer
codes that damage or cannot be read by your equipment.
1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except for
the “Right of Replacement or Refund” described in paragraph 1.F.3,
the Project Gutenberg Literary Archive Foundation, the owner of the
Project Gutenberg™ trademark, and any other party distributing a
Project Gutenberg™ electronic work under this agreement, disclaim
all liability to you for damages, costs and expenses, including legal
fees. YOU AGREE THAT YOU HAVE NO REMEDIES FOR
NEGLIGENCE, STRICT LIABILITY, BREACH OF WARRANTY OR
BREACH OF CONTRACT EXCEPT THOSE PROVIDED IN PARAGRAPH
1.F.3. YOU AGREE THAT THE FOUNDATION, THE TRADEMARK
OWNER, AND ANY DISTRIBUTOR UNDER THIS AGREEMENT WILL
NOT BE LIABLE TO YOU FOR ACTUAL, DIRECT, INDIRECT,
CONSEQUENTIAL, PUNITIVE OR INCIDENTAL DAMAGES EVEN IF
YOU GIVE NOTICE OF THE POSSIBILITY OF SUCH DAMAGE.
1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you
discover a defect in this electronic work within 90 days of receiving
it, you can receive a refund of the money (if any) you paid for it by
sending a written explanation to the person you received the work
from. If you received the work on a physical medium, you must
return the medium with your written explanation. The person or
entity that provided you with the defective work may elect to provide
a replacement copy in lieu of a refund. If you received the work
electronically, the person or entity providing it to you may choose to
give you a second opportunity to receive the work electronically in
lieu of a refund. If the second copy is also defective, you may
demand a refund in writing without further opportunities to fix the
problem.
1.F.4. Except for the limited right of replacement or refund set forth
in paragraph 1.F.3, this work is provided to you ‘AS-IS’, WITH NO
OTHER WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.
1.F.5. Some states do not allow disclaimers of certain implied
warranties or the exclusion or limitation of certain types of damages.
If any disclaimer or limitation set forth in this agreement violates the
law of the state applicable to this agreement, the agreement shall be
interpreted to make the maximum disclaimer or limitation permitted
by the applicable state law. The invalidity or unenforceability of any
provision of this agreement shall not void the remaining provisions.
1.F.6. INDEMNITY - You agree to indemnify and hold the Foundation,
the trademark owner, any agent or employee of the Foundation,
anyone providing copies of Project Gutenberg™ electronic works in
accordance with this agreement, and any volunteers associated with
the production, promotion and distribution of Project Gutenberg™
electronic works, harmless from all liability, costs and expenses,
including legal fees, that arise directly or indirectly from any of the
following which you do or cause to occur: (a) distribution of this or
any Project Gutenberg™ work, (b) alteration, modification, or
additions or deletions to any Project Gutenberg™ work, and (c) any
Defect you cause.
Section 2. Information about the Mission
of Project Gutenberg™
Project Gutenberg™ is synonymous with the free distribution of
electronic works in formats readable by the widest variety of
computers including obsolete, old, middle-aged and new computers.
It exists because of the efforts of hundreds of volunteers and
donations from people in all walks of life.
Volunteers and financial support to provide volunteers with the
assistance they need are critical to reaching Project Gutenberg™’s
goals and ensuring that the Project Gutenberg™ collection will
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

More Related Content

Similar to (eBook PDF) Introduction to Programming with Java: A Problem Solving Approach 3rd Edition (20)

PDF
A Comprehensive Introduction To Objectoriented Programming With Java C Thomas Wu
yajishatte
 
PDF
A Comprehensive Introduction to Object-Oriented Programming with Java.pdf
Yasmine Anino
 
PDF
Java Foundations Introduction to Program Design and Data Structures (5th Edit...
hariomtapang
 
PDF
Java Foundations Introduction To Program Design And Data Structures 2nd Editi...
eestissingar
 
PDF
(eBook PDF) Starting Out with Java: From Control Structures through Objects, ...
dsqdewaets644
 
PDF
Download full ebook of Java Cookbook Ian F Darwin Darwin Ian F instant downlo...
tvuxidu670
 
PDF
Java Complete Reference Fifth Edition
umavanth
 
PDF
Mastering Java: A Beginner's Guide 1st Edition Sufyan Bin Uzayr
wilkserronlc
 
PDF
Download full ebook of Programming With Java Edet Theophilus instant download...
noyzdapat39
 
PDF
Java How To Program Early Objects Eleventh Edition Deitel Harvey M Deitel
yehlewiste2y
 
PDF
Java programming-language-handbook
Philip Solomon
 
PDF
Java Programming.pdf
IthagoniShirisha
 
PDF
java-language-programação.2-PDF Room.pdf
carloseduardogonalve36
 
PPT
Chapter 1 java
ahmed abugharsa
 
PDF
Mastering Java A Beginners Guide Divya Sachdeva Natalya Ustukpayeva
aitsenerg
 
PDF
Objectoriented Programming And Java 2nd Ed Danny C C Poo Derek Beng Kee Kiong...
orianzotto3i
 
PDF
Learning Java 4th Edition Patrick Niemeyer Daniel Leuck
zachryqypi73
 
PDF
Essential Java For Scientists And Engineers 1st Brian D Hahn
yralabasah
 
PPTX
Java programmingjsjdjdjdjdjdjdjdjdiidiei
rajputtejaswa12
 
PDF
[FREE PDF sample] Object Oriented Programming and Java Second Edition Danny P...
ackeylocusr5
 
A Comprehensive Introduction To Objectoriented Programming With Java C Thomas Wu
yajishatte
 
A Comprehensive Introduction to Object-Oriented Programming with Java.pdf
Yasmine Anino
 
Java Foundations Introduction to Program Design and Data Structures (5th Edit...
hariomtapang
 
Java Foundations Introduction To Program Design And Data Structures 2nd Editi...
eestissingar
 
(eBook PDF) Starting Out with Java: From Control Structures through Objects, ...
dsqdewaets644
 
Download full ebook of Java Cookbook Ian F Darwin Darwin Ian F instant downlo...
tvuxidu670
 
Java Complete Reference Fifth Edition
umavanth
 
Mastering Java: A Beginner's Guide 1st Edition Sufyan Bin Uzayr
wilkserronlc
 
Download full ebook of Programming With Java Edet Theophilus instant download...
noyzdapat39
 
Java How To Program Early Objects Eleventh Edition Deitel Harvey M Deitel
yehlewiste2y
 
Java programming-language-handbook
Philip Solomon
 
Java Programming.pdf
IthagoniShirisha
 
java-language-programação.2-PDF Room.pdf
carloseduardogonalve36
 
Chapter 1 java
ahmed abugharsa
 
Mastering Java A Beginners Guide Divya Sachdeva Natalya Ustukpayeva
aitsenerg
 
Objectoriented Programming And Java 2nd Ed Danny C C Poo Derek Beng Kee Kiong...
orianzotto3i
 
Learning Java 4th Edition Patrick Niemeyer Daniel Leuck
zachryqypi73
 
Essential Java For Scientists And Engineers 1st Brian D Hahn
yralabasah
 
Java programmingjsjdjdjdjdjdjdjdjdiidiei
rajputtejaswa12
 
[FREE PDF sample] Object Oriented Programming and Java Second Edition Danny P...
ackeylocusr5
 

Recently uploaded (20)

PDF
Supply Chain Security A Comprehensive Approach 1st Edition Arthur G. Arway
rxgnika452
 
PDF
Wikinomics How Mass Collaboration Changes Everything Don Tapscott
wcsqyzf5909
 
PDF
CAD25 Gbadago and Fafa Presentation Revised-Aston Business School, UK.pdf
Kweku Zurek
 
DOCX
MUSIC AND ARTS 5 DLL MATATAG LESSON EXEMPLAR QUARTER 1_Q1_W1.docx
DianaValiente5
 
PDF
VCE Literature Section A Exam Response Guide
jpinnuck
 
PPTX
How to use grouped() method in Odoo 18 - Odoo Slides
Celine George
 
PPTX
SYMPATHOMIMETICS[ADRENERGIC AGONISTS] pptx
saip95568
 
PDF
Our Guide to the July 2025 USPS® Rate Change
Postal Advocate Inc.
 
PDF
Andreas Schleicher_Teaching Compass_Education 2040.pdf
EduSkills OECD
 
DOCX
ANNOTATION on objective 10 on pmes 2022-2025
joviejanesegundo1
 
PDF
DIGESTION OF CARBOHYDRATES ,PROTEINS AND LIPIDS
raviralanaresh2
 
PPTX
Elo the HeroTHIS IS A STORY ABOUT A BOY WHO SAVED A LITTLE GOAT .pptx
JoyIPanos
 
PDF
Nanotechnology and Functional Foods Effective Delivery of Bioactive Ingredien...
rmswlwcxai8321
 
PPTX
How Physics Enhances Our Quality of Life.pptx
AngeliqueTolentinoDe
 
PDF
Free eBook ~100 Common English Proverbs (ebook) pdf.pdf
OH TEIK BIN
 
PPT
M&A5 Q1 1 differentiate evolving early Philippine conventional and contempora...
ErlizaRosete
 
PPTX
ENGLISH -PPT- Week1 Quarter1 -day-1.pptx
garcialhavz
 
PDF
Gladiolous Cultivation practices by AKL.pdf
kushallamichhame
 
PPTX
Peer Teaching Observations During School Internship
AjayaMohanty7
 
PPTX
2025 Completing the Pre-SET Plan Form.pptx
mansk2
 
Supply Chain Security A Comprehensive Approach 1st Edition Arthur G. Arway
rxgnika452
 
Wikinomics How Mass Collaboration Changes Everything Don Tapscott
wcsqyzf5909
 
CAD25 Gbadago and Fafa Presentation Revised-Aston Business School, UK.pdf
Kweku Zurek
 
MUSIC AND ARTS 5 DLL MATATAG LESSON EXEMPLAR QUARTER 1_Q1_W1.docx
DianaValiente5
 
VCE Literature Section A Exam Response Guide
jpinnuck
 
How to use grouped() method in Odoo 18 - Odoo Slides
Celine George
 
SYMPATHOMIMETICS[ADRENERGIC AGONISTS] pptx
saip95568
 
Our Guide to the July 2025 USPS® Rate Change
Postal Advocate Inc.
 
Andreas Schleicher_Teaching Compass_Education 2040.pdf
EduSkills OECD
 
ANNOTATION on objective 10 on pmes 2022-2025
joviejanesegundo1
 
DIGESTION OF CARBOHYDRATES ,PROTEINS AND LIPIDS
raviralanaresh2
 
Elo the HeroTHIS IS A STORY ABOUT A BOY WHO SAVED A LITTLE GOAT .pptx
JoyIPanos
 
Nanotechnology and Functional Foods Effective Delivery of Bioactive Ingredien...
rmswlwcxai8321
 
How Physics Enhances Our Quality of Life.pptx
AngeliqueTolentinoDe
 
Free eBook ~100 Common English Proverbs (ebook) pdf.pdf
OH TEIK BIN
 
M&A5 Q1 1 differentiate evolving early Philippine conventional and contempora...
ErlizaRosete
 
ENGLISH -PPT- Week1 Quarter1 -day-1.pptx
garcialhavz
 
Gladiolous Cultivation practices by AKL.pdf
kushallamichhame
 
Peer Teaching Observations During School Internship
AjayaMohanty7
 
2025 Completing the Pre-SET Plan Form.pptx
mansk2
 
Ad

(eBook PDF) Introduction to Programming with Java: A Problem Solving Approach 3rd Edition

  • 1. Quick and Easy Ebook Downloads – Start Now at ebookluna.com for Instant Access (eBook PDF) Introduction to Programming with Java: A Problem Solving Approach 3rd Edition https://ebookluna.com/product/ebook-pdf-introduction-to- programming-with-java-a-problem-solving-approach-3rd- edition/ OR CLICK BUTTON DOWLOAD EBOOK Instantly Access and Download Textbook at https://ebookluna.com
  • 2. John Dean Park University Raymond Dean University of Kansas JAVA WITH A Problem Solving Approach Introduction to Programming dea75768_fm_i-xxxviii.indd 1 4/30/20 11:54 AM
  • 3. 12.10. Empty Statement 552 12.11. Using break to Exit from a Loop 554 12.12. for Loop Header Details 555 12.13. Enumerated Types 557 12.14. forEach Method, Lambda Expressions, Method References, and Streams 564 12.15. Hexadecimal, Octal, and Binary Numbers 573 12.16. GUI Track: Unicode (Optional) 574 12.17. Introduction to GridWorld Case Study (Optional) 579 CHAPTER 13 Aggregation, Composition, and Inheritance 591 13.1. Introduction 592 13.2. Composition and Aggregation 592 13.3. Inheritance Overview 599 13.4. Implementation of a Person/Employee/ FullTime Hierarchy 603 13.5. Constructors in a Subclass 605 13.6. Method Overriding 606 13.7. Using the Person/Employee/FullTime Hierarchy 609 13.8. The final Access Modifier 610 13.9. Using Inheritance with Aggregation and Composition 610 13.10. Design Practice with Card Game Example 613 13.11. GridWorld Case Study Extensions (Optional) 619 13.12. Problem Solving with Association Classes (Optional) 626 CHAPTER 14 Inheritance and Polymorphism 637 14.1. Introduction 638 14.2. The Object Class and Automatic Type Promotion 638 14.3. The equals Method 639 14.4. The toString Method 643 14.5. Polymorphism and Dynamic Binding 648 14.6. Assignments When the Two Sides’ Classes Are Different 653 14.7. Polymorphism with Arrays 654 14.8. abstract Methods and Classes 660 14.9. Interfaces 663 14.10. The protected Access Modifier 673 14.11. GUI Track: Three-Dimensional Graphics (Optional) 677 CHAPTER 15 Exception Handling 691 15.1. Introduction 692 15.2. Overview of Exceptions and Exception Messages 692 15.3. Using try and catch Blocks to Handle “Dangerous” Method Calls 693 15.4. Line Plot Example 695 15.5. try Block Details 699 15.6. Two Categories of Exceptions—Checked and Unchecked 700 15.7. Unchecked Exceptions 702 15.8. Checked Exceptions 705 15.9. Generic catch Block with Exception Class 708 15.10. Multiple catch Blocks and Multiple Exceptions per Block 712 15.11. Understanding Exception Messages 714 15.12. Using a throws Clause to Postpone the catch 718 15.13. Automatic Cleanup Using Try-With- Resources 720 15.14. GUI Track: Line Plot Example Revisited (Optional) 722 CHAPTER 16 Files, Buffers, Channels, and Paths 735 16.1. Introduction 736 16.2. Simple Text-File Example: HTML File Generator 737 16.3. A Website Reader 741 16.4. Object File I/O 743 16.5. Character Sets and File-Access Options 748 16.6. Buffered Text File I/O 749 16.7. Primitive Buffers with Random Access 752 16.8. Channel I/O and Memory-Mapped Files 760 viii Contents dea75768_fm_i-xxxviii.indd 8 4/30/20 11:54 AM
  • 4. 16.9. Path, Whole-File, and Directory Operations 767 16.10. Walking a Directory Tree 769 16.11. GUI Track: Final Iteration of Problem Solving with CRC Cards (Optional) 775 CHAPTER 17 GUI Programming Basics 787 17.1. Introduction 788 17.2. SimpleWindow Program 791 17.3. Stage and Scene 794 17.4. JavaFX Components 796 17.5. Label Control 797 17.6. TextField Control 799 17.7. Greeting Program 801 17.8. Event Handling 805 17.9. Property Binding 809 17.10. JavaFX CSS 812 17.11. Scene Graph Inheritance 818 17.12. Style Sheets and Cascading 821 17.13. Button Control and FactorialButton Program 826 17.14. Distinguishing Between Multiple Events 832 17.15. Colors 834 17.16. ColorChooser Program 838 CHAPTER 18 GUI Programming—Layout Panes 849 18.1. Introduction 849 18.2. Layout Panes 851 18.3. FlowPane and GridPane—Competing Layout Philosophies 853 18.4. VBox Program with Two Stages and an Image File 858 18.5. BorderPane 867 18.6. TilePane and TextFlow Containers 872 18.7. TicTacToe Program 878 18.8. Embedded Panes, HBox, and MathCalculator Program 882 18.9. Plain Pane Container and Component Positioning 889 CHAPTER 19 GUI Programming—Additional GUI Components, Additional Event Handlers, Animation 896 19.1. Introduction 897 19.2. User Interface Design 897 19.3. TextArea Control 898 19.4. CheckBox and RadioButton Controls 903 19.5. ComboBox Control 909 19.6. Job Application Program 913 19.7. ScrollPane and Menu Classes 918 19.8. Images and Mouse Events 922 19.9. Lunar Eclipse Program with Circle, RadialGradient, and Slider 928 19.10. Animation 933 Appendices Appendix 1 ASCII Character Set 943 Appendix 2 Operator Precedence 945 Appendix 3 Java Keywords and Other Reserved Words 947 Appendix 4 Packages and Modules 951 Appendix 5 Java Coding-Style Conventions 963 Appendix 6 Javadoc with Tags 975 Appendix 7 UML Diagrams 980 Appendix 8 Number Systems and Conversions Between Them 986 Additional Online Material Chapter S6 Writing Methods in a Non-Object- Oriented Environment Chapter S9 Arrays in a Non-Object-Oriented Environment Chapter S17 GUI Programming Basics Chapter S18 GUI Programming—Component Layout, Additional GUI Components Appendix 9 Multithreading Index 990 Contents ix dea75768_fm_i-xxxviii.indd 9 5/12/20 1:41 PM
  • 5. x In this book, we lead you on a journey into the fun and exciting world of computer programming. Through- out your journey, we’ll provide you with lots of problem-solving practice. After all, good programmers need to be good problem solvers. We’ll show you how to implement your problem solutions with Java programs. We provide a plethora of examples, some short and focused on a single concept, some longer and more “real world.” We present the material in a conversational, easy-to-follow manner aimed at making your journey a pleasant one. When you’re done with the book, you should be a proficient Java programmer. Our textbook targets a wide range of readers. Primarily, it targets students in a standard college-level “Introduction to Programming” course or course sequence where no prerequisite programming experience is assumed. We have included the topics recommended by the College Board for high school students studying for advanced placement (AP) in computer science. So this text should be good for those students as well. In addition to targeting students with no prerequisite programming experience, our textbook targets industry practitioners and college-level students who have some programming experience and want to learn Java. This second set of readers can skip the early chapters on general programming concepts and focus on the features of Java that differ from the languages that they already know. In particular, because C++ and Java are similar, readers with a C++ background should be able to cover the textbook in a single three-credit-hour course. (But we should reiterate for those of you with no programming experience: No prerequisite programming experience is required in order to use this text.) Finally, our textbook targets those who are learning Java on their own, outside of a classroom environ- ment. This third set of readers should read the entire textbook at a pace determined on a case-by-case basis. What’s New in This Edition? The changes in this edition are big and small. Big changes include new chapters, reorganized chapter sec- tions, new programming constructs, new program examples, and new exercises. Smaller changes include updating explanations and anecdotes. We’ve combed the entire book for opportunities to improve the book’s clarity and readability. The following list highlights the more significant changes that we’ve made to this edition. ∙ Introductory Chapter To keep up with the computer industry’s growth, we’ve made quite a few changes to Chapter 1, such as updating the information in the computer hardware and Java history sections. ∙ Switching Constructs Java 12 and Java 13 made improvements to the venerable switch statement, and this edition describes those improvements. We use the new switching techniques (multiple comma-­ separated case constants and no break statements) for programs throughout the book. And we use switch statements versus switch expressions according to what the problem calls for. If you’re a fan of the old-style switch statement, no worries, we provide a description early on which will help you with legacy code. Preface dea75768_fm_i-xxxviii.indd 10 4/30/20 11:54 AM
  • 6. Preface xi ∙ Local Variable Type Inferencing Java 10 introduced the ability to use var as a type (rather than int, double, etc.) for a local variable declaration where the declaration is part of an initialization. We describe the new syntax, but for self- documentation reasons, we stick with traditional explicit type declarations for the most part. ∙ Name Change for Static Variables and Static Methods The powers that be (the Oracle documentation folks) now use the terms static variable and static method for what used to be known as class variable and class method, so we’ve updated accordingly. ∙ Miscellaneous Java API Library Updates With the new Java releases since the second edition, there have been quite a few updates to the Java API library. We’ve updated our discussions and programs with new API method and constructor calls when appropriate. Most of our new API content can be found in our GUI coverage, but there are other API changes sprinkled throughout the book. For example, with Java’s deprecation of the wrapper class constructors, we’ve refactored our programs to rely on the wrapper classes’ valueOf methods. ∙ New Section—forEach Method and Streams We introduce the forEach method as a simple alternative to the for-each loop in the context of an ArrayList. We then use the forEach method in the context of streams, where it really shines. We describe streams in depth, with their exciting potential to take advantage of parallel processing to improve a program’s efficiency. ∙ Lambda Expressions and Method References Lambda expressions and method references are techniques that allow you to implement the function- ality of a method so you can use it as an argument in a method call. We first present lambda expres- sions and method references as arguments for a forEach method call. Later, we use lambda expressions and method references extensively to help with the GUI programs. ∙ Interfaces with Static Methods and Default Methods We’ve rewritten Chapter 14’s section on interfaces to include a discussion of static methods and default methods. Oracle added them to interfaces because they support an interface’s ability to imple- ment multiple inheritance effectively. ∙ End-of-Chapter GUI Sections We’ve rewritten all of our end-of-chapter GUI sections to take advantage of Java’s newer GUI constructs. ∙ Three New Chapters—JavaFX In this book’s second edition, we used the AWT and Swing platforms for our two GUI chapters. This third edition moves those chapters to the book’s website. We provide three new chapters in the main body of the book that describe GUI programming using the JavaFX platform. As part of that presenta- tion, you’ll learn how to format your programs using JavaFX CSS properties. ∙ New Appendix—Modules In Appendix 4, we introduce modules, which allow you to group together packages. Modules make it easier to organize and share classes for different programming needs. They are used to facilitate the configuration of Java software for diverse hardware and software platforms. dea75768_fm_i-xxxviii.indd 11 5/10/20 8:49 PM
  • 7. xii Preface ∙ New Exercises We have substantially changed most of the exercises and altered almost all of them in some way. As before, we provide exercise solutions on the password-protected instructor’s portion of the book’s website. Compliant with the College Board’s AP Computer Science A Curriculum We have put a great deal of effort into ensuring that this textbook is compliant with the College Board’s Advanced Placement (AP) Computer Science A curriculum content. It follows all the AP Computer Science A guidelines. As such, it appears on the College Board’s approved textbook list at https://apcentral.collegeboard.org/courses/ap-computer-science-a/course-audit. Textbook Cornerstone #1: Problem Solving Being able to solve problems is a critical skill that all programmers must possess. We teach programmatic problem solving by emphasizing two of its key elements—algorithm development and program design. Emphasis on Algorithm Development In Chapter 2, we immerse readers into algorithm development by using pseudocode for the algorithm examples instead of Java. In using pseudocode, students are able to work through nontrivial problems on their own without getting bogged down in Java syntax—no need to worry about class headings, semico- lons, braces, and so on.1 Working through nontrivial problems enables students to gain an early apprecia- tion for creativity, logic, and organization. Without that appreciation, Java students tend to learn Java syntax with a rote-memory attitude. But with that appreciation, students tend to learn Java syntax more quickly and effectively because they have a motivational basis for learning it. In addition, they are able to handle nontrivial Java homework assignments fairly early because they have prior experience with simi- larly nontrivial pseudocode homework assignments. In Chapter 3 and in later chapters, we rely primarily on Java for algorithm-development examples. But for the more involved problems, we sometimes use high-level pseudocode to describe first-cut proposed solutions. Using pseudocode enables readers to bypass syntax details and focus on the algorithm portion of the solution. Emphasis on Program Design Problem solving is more than just developing an algorithm. It also involves figuring out the best imple- mentation for the algorithm. That’s program design. Program design is extremely important, and that’s why we spend so much time on it. Frequently, we explain the thought processes that a person might go through when coming up with a solution. For example, we explain how to choose between different loop types, how to split up a method into multiple methods, how to decide on appropriate classes, how to 1 Inevitably, we use a particular style for our pseudocode, but we repeatedly emphasize that other pseudocode styles are fine so long as they convey the intended meaning. Our pseudocode style is a combination of free-form description for high-level tasks and more specific commands for low-level tasks. We’ve chosen a pseudocode style that is intuitive, to welcome new programmers, and struc- tured, to accommodate program logic. dea75768_fm_i-xxxviii.indd 12 4/30/20 11:54 AM
  • 8. Preface xiii choose between instance and static members, and how to determine class relationships using inheritance and composition. We challenge students to find the most elegant implementations for a particular task. We devote a whole chapter to program design—Chapter 8, “Software Engineering.” In that chapter, we provide an in-depth look at coding-style conventions and documentation for programmers and users. We discuss design strategies like separation of concerns, modularization, and encapsulation. Also in the chapter, we describe alternative design strategies—top-down, bottom-up, case-based, and iterative enhancement. Problem-Solving Sections We often address problem solving (algorithm development and program design) in the natural flow of explaining concepts. But we also cover problem solving in sections that are wholly devoted to it. In each problem-solving section, we present a situation that contains an unresolved problem. In coming up with a solution for the problem, we try to mimic the real-world problem-solving experience by using an iterative design strategy. We present a first-cut solution, analyze the solution, and then discuss possible improve- ments to it. We use a conversational trial-and-error format (e.g., “What type of layout manager should we use? We first tried the GridLayout manager. That works OK, but not great. Let’s now try the BorderLayout manager.”). This casual tone sets the student at ease by conveying the message that it is normal, and in fact expected, that a programmer will need to work through a problem multiple times before finding the best solution. Additional Problem-Solving Mechanisms We include problem-solving examples and problem-solving advice throughout the text (not just in Chapter 2, Chapter 8, and the problem-solving sections). As a point of emphasis, we insert a problem- solving box, with an icon and a succinct tip, next to the text that contains the problem-solving example and/or advice. We are strong believers in learning by example. As such, our textbook contains a multitude of com- plete program examples. Readers are encouraged to use our programs as recipes for solving similar pro- grams on their own. Textbook Cornerstone #2: Fundamentals First Postpone Concepts That Require Complex Syntax We feel that many introductory programming textbooks jump too quickly into concepts that require com- plex syntax. In using complex syntax early, students get in the habit of entering code without fully under- standing it or, worse yet, copying and pasting from example code without fully understanding the example code. That can lead to less-than-ideal programs and students who are limited in their ability to solve a wide variety of problems. Thus, we prefer to postpone concepts that require complex syntax. We prefer to intro- duce such concepts later on, when students are better able to understand them fully. As a prime example of that philosophy, we cover the simpler forms of GUI programming early (in an optional graphics track), but we cover the more complicated forms of GUI programming later in the book. Specifically, we postpone event-driven GUI programming until the end of the book. This is dif- ferent from some other Java textbooks, which favor early full immersion into event-driven GUI pro- gramming. We feel that strategy is a mistake because proper event-driven GUI programming requires a great deal of programming maturity. When they learn it at the end of the book, our readers are better able to understand it fully. dea75768_fm_i-xxxviii.indd 13 4/30/20 11:54 AM
  • 9. xiv Preface Tracing Examples To write code effectively, it’s imperative to understand code thoroughly. We’ve found that step-by-step tracing of program code is an effective way to ensure thorough understanding. Thus, in the earlier parts of the textbook, when we introduce a new programming structure, we often illustrate it with a meticulous trace. The detailed tracing technique we use illustrates the thought process programmers employ while debugging. It’s a printed alternative to the sequence of screen displays generated by debuggers in inte- grated development environment (IDE) software. Input and Output In the optional GUI-track sections and in the GUI chapters at the end of the book, we use GUI commands for input and output (I/O). But because of our emphasis on fundamentals, we use console commands for I/O for the rest of the book.2 For console input, we use the Scanner class. For console output, we use the standard System.out.print, System.out.println, and System.out.printf methods. Textbook Cornerstone #3: Real World More often than not, today’s classroom students and industry practitioners prefer to learn with a hands- on, real-world approach. To meet this need, our textbook and its associated website include: ∙ compiler tools ∙ complete program examples ∙ practical guidance in program design ∙ coding-style guidelines based on industry standards ∙ Unified Modeling Language (UML) notation for class relationship diagrams ∙ practical homework-project assignments Compiler Tools We do not tie the textbook to any particular compiler tool—you are free to use any compiler tool(s) that you like. If you do not have a preferred compiler in mind, then you might want to try out one or more of these: ∙ Java Standard Edition Development Kit (JDK), by Oracle ∙ TextPad, by Helios ∙ Eclipse, by the Eclipse Foundation ∙ Netbeans, backed by Oracle ∙ BlueJ, by the University of Kent and Deaken University To obtain the above compilers, visit our textbook website at http://www.mhhe.com/dean3e, find the appropriate compiler link(s), and download away for free. Complete Program Examples In addition to providing code fragments to illustrate specific concepts, our textbook contains lots of com- plete program examples. With complete programs, students are able to (1) see how the analyzed code ties in with the rest of a program, and (2) test the code by running it. 2 We introduce GUI I/O at the end of Chapter 3 with dialog boxes. That opens up an optional door for GUI fans. If readers are so inclined, they can use the Alert, TextInputDialog, and ChoiceDialog classes to implement all our programs with GUI I/O rather than console I/O. dea75768_fm_i-xxxviii.indd 14 4/30/20 11:54 AM
  • 10. Preface xv Coding-Style Conventions We include coding-style tips throughout the textbook. The coding-style tips are based on Oracle’s coding conventions (https://www.oracle.com/technetwork/java/codeconvtoc-136057.html), Google’s coding con- ventions (https://google.github.io/styleguide/javaguide.html), and industry practice. In Appendix 5, we provide a complete reference for the book’s coding-style conventions and an associated example program that illustrates these conventions. UML Notation UML has become a standard for describing the entities in large software projects. Rather than overwhelm beginning programmers with syntax for the entire UML (which is quite extensive), we present a subset of UML. Throughout the textbook, we incorporate UML notation to represent classes and class relationships pictorially. For those interested in more details, we provide additional UML notation in Appendix 7. Homework Problems We provide homework problems that are illustrative, practical, and clearly worded. The problems range from easy to challenging. They are grouped into three categories—review questions, exercises, and proj- ects. We include review questions and exercises at the end of each chapter, and we provide projects on our textbook’s website. The review questions tend to have short answers, and the answers are in the textbook. The review questions use these formats: short-answer, multiple-choice, true/false, fill-in-the-blank, tracing, debugging, and write a code fragment. Each review question is based on a relatively small part of the chapter. The exercises tend to have short to moderate-length answers, and the answers are not in the textbook. The exercises use these formats: short-answer, tracing, debugging, and write a code fragment. Exercises are keyed to the highest prerequisite section number in the chapter, but they sometimes integrate concepts from several parts of the chapter. For this third edition, we have changed almost all of the end-of-chapter exercises, including exercises associated with unchanged material in the body of the text. The projects consist of problem descriptions whose solutions are complete programs. Project solu- tions are not in the textbook. Projects require students to employ creativity and problem-solving skills and apply what they’ve learned in the chapter. These projects often include optional parts, which provide chal- lenges for the more talented students. Projects are keyed to the highest prerequisite section number in the chapter, but they often integrate concepts from several preceding parts of the chapter. For this third edition, we have modified old projects and added new projects to make all projects conform to content in the body of the current text. Because the most substantial body-of-text changes are in the final three chapters, most of the project modifications and additions are associated with these chapters. An important special feature of this book is the way that it specifies problems. “Sample sessions” show the precise output generated for a particular set of input values. These sample sessions include inputs that represent typical situations and sometimes also extreme or boundary situations. Academic-Area Projects To enhance the appeal of projects and to show how the current chapter’s programming techniques might apply to different areas of interest, we take project content from several academic areas: ∙ computer science and numerical methods ∙ business and accounting dea75768_fm_i-xxxviii.indd 15 4/30/20 11:54 AM
  • 11. xvi Preface ∙ social sciences and statistics ∙ math and physics ∙ engineering and architecture ∙ biology and ecology Most of the academic-area projects do not require prerequisite knowledge in a particular area. Thus, instructors are free to assign almost any of the projects to any of their students. To provide a general reader with enough specialized knowledge to work a problem in a particular academic area, we sometimes expand the problem statement to explain a few special concepts in that academic area. Most of the academic-area projects do not require students to have completed projects from earlier chapters; that is, most projects do not build on previous projects. Thus, for the most part, instructors are free to assign projects without worrying about prerequisite projects. In some cases, a project repeats a previous chapter’s project with a different approach. The teacher may elect to take advantage of this rep- etition to dramatize the availability of alternatives, but this is not necessary. Project assignments can be tailored to fit readers’ needs. For example: ∙ For readers outside of academia— Readers can choose projects that match their interests. ∙ When a course has students from one academic area— Instructors can assign projects from the relevant academic area. ∙ When a course has students with diverse backgrounds— Instructors can ask students to choose projects from their own academic areas, or instructors can ignore the academic-area delineations and simply assign projects that are most appealing. To help you decide which projects to work on, we’ve included a “Project Summary” section after the preface. It lists all the projects by chapter and section, and for each project, it specifies: ∙ prerequisite chapter and section ∙ academic area ∙ estimated difficulty ∙ a title and brief description After using the “Project Summary” section to get an idea of which projects you might like to work on, see the textbook’s website for the full project descriptions. Organization In writing this book, we lead readers through three important programming methodologies: structured programming, OOP, and event-driven programming. For our structured programming coverage, we intro- duce basic concepts such as variables and operators, if statements, and loops. Then we show readers how to call prebuilt methods from Oracle’s Java API library. Many of these methods, like those in the Math class, are non-OOP methods that can be called directly. Others, like those in the String class, are OOP methods that must be called by a previously created object. After an “interlude” that gives readers a brief taste of what it’s like to write methods in a non-OOP environment, we move into OOP programming, and introduce basic OOP concepts such as classes, objects, instance variables, instance methods, and construc- tors. We also introduce static variables and static methods, which are useful in certain situations. However, we note that they should be used less often than instance variables and instance methods. Next, we move dea75768_fm_i-xxxviii.indd 16 4/30/20 11:54 AM
  • 12. Visit https://testbankfan.com now to explore a rich collection of testbank or solution manual and enjoy exciting offers!
  • 13. Preface xvii on to more advanced OOP concepts—arrays, collections, interfaces, and inheritance. Chapters on excep- tion handling and files provide a transition into event-driven GUI programming. We describe and employ event-driven GUI programming in the final three chapters. The content and sequence we promote enable students to develop their skills from a solid foundation of programming fundamentals. To foster this fundamentals-first approach, our book starts with a mini- mum set of concepts and details. It then gradually broadens concepts and adds detail later. We avoid over- loading early chapters by deferring certain less-important details to later chapters. GUI Track Many programmers find Graphical User Interface (GUI) programming to be fun. As such, GUI program- ming can be a great motivational tool for keeping readers interested and engaged. That’s why we include graphics sections throughout the book, starting in Chapter 1. We call those sections our “GUI track.” Most of these end-of-chapter sections use GUI code that complements the current chapter’s previously pre- sented non-GUI material. For readers who do not have time for the GUI track, no problem. Any or all of the GUI track sections may be skipped because the rest of the book does not depend on any of the GUI- track material. Although the rest of the book does not depend on the GUI-track material, be aware that some of the GUI-track sections depend on some of the material in prior GUI-track sections: ∙ Chapter 3’s GUI section introduces dialog boxes for user input, and dialog boxes are used in later GUI sections for Chapters 10, 11, 15, and 16. ∙ Chapters 8, 10, and 16 have GUI sections that implement a common program, with iterative enhance- ments in each new GUI section. ∙ Chapters 12 and 13 have GUI sections that implement a common GridWorld program (for readers interested in the College Board’s AP Computer Science A curriculum). The GridWorld code uses AWT and Swing GUI software. Chapter 1 In Chapter 1, we first explain basic computer terms—what are the hardware components, what is source code, what is object code, and so on. We then narrow our focus and describe the programming language we’ll be using for the remainder of the book—Java. Finally, we give students a quick view of the classic bare-bones “Hello World” program. We explain how to create and run the program using minimalist­ software—Microsoft’s Notepad text editor and Oracle’s command-line JDK tools. Chapter 2 In Chapter 2, we present problem-solving techniques with an emphasis on algorithmic design. In imple- menting algorithm solutions, we use generic tools—flowcharts and pseudocode—with pseudocode given greater weight. As part of our algorithm-design explanation, we describe structured programming tech- niques. In order to give students an appreciation for semantic details, we show how to trace algorithms. Chapters 3–5 We present structured programming techniques using Java in Chapters 3–5. Chapter 3 describes sequential programming basics—variables, input/output, assignment statements, and simple method calls. Chapter 4 describes nonsequential program flow—if statements, switch constructs, and loops. In Chapter 5, we explain methods in more detail and show readers how to use prebuilt methods in the Java API library. dea75768_fm_i-xxxviii.indd 17 4/30/20 11:54 AM
  • 14. xviii Preface In all three chapters, we teach algorithm design by solving problems and writing programs with the newly introduced Java syntax. Interlude This “mini-chapter” contains two programs that show how to write multiple methods without using OOP. The Interlude presents a fork in the road between two study sequences. For the standard study sequence, read the chapters in the standard order (Chapters 1 through 19). For the “objects later” study sequence, after reading Chapter 5, read the supplemental chapters S6 and S9 online before returning to Chapter 6, where you’ll begin your study of OOP in earnest. Chapters 6–7 Chapter 6 introduces the basic elements of OOP in Java. This includes implementing classes and imple- menting methods and variables within those classes. We use UML class diagrams and object-oriented tracing techniques to illustrate these concepts. Chapter 7 provides additional OOP details. It explains how reference variables are assigned, tested for equality, and passed as arguments to a method. It explains overloaded methods and constructors. It also explains the use of static variables, static methods, and different types of named constants. Chapter 8 While the art of program design and the science of computerized problem-solving are developed through- out the textbook, in Chapter 8, we focus on these aspects in the context of OOP. This chapter begins with an organized treatment of programming style. It introduces javadoc, the Java application that automati- cally generates documentation for user-programmers. It describes ways to communicate with users who are not programmers. It describes organizational strategies like separation of concerns, modularization, encapsulation, and provision of general-purpose utilities. Coded examples show how to implement these strategies. It describes the major programming paradigms—top-down design, bottom-up design, using pre-written software for low-level modules, and prototyping. Chapters 9–10 Chapter 9 describes arrays, including arrays of primitives, arrays of objects, and multidimensional arrays. It illustrates array use with complete programs that sort, search, and construct histograms. Chapter 10 describes Java’s powerful array alternative, ArrayList. This provides a simple example of generic-­element specification. It also introduces the Java Collections Framework, which in turn, provides natural illustrations of Java interfaces. The prewritten classes in the Java Collections Framework provide a simple introduction of sets, maps, and queues. A relatively short but complete program shows how the pre-written Java implementa- tions of these data structures can be used to create and traverse a multiconnected random network. Chapter 11 Chapter 11 describes another way to process a collection of data—recursion. This chapter includes a ­ discussion of various recursive strategies. It introduces recursion with a real-life example and a familiar problem that one can solve easily with either looping or recursion. Then it moves gradually to problems that are harder to solve with looping and more easily solved with recursion. Although this chapter appears after the chapter on ArrayLists and the Java Collections Framework, it does not depend on these ­ concepts—it uses just ordinary arrays. dea75768_fm_i-xxxviii.indd 18 5/12/20 1:23 PM
  • 15. Preface xix Chapter 12 Early on, students need to be immersed in problem-solving activities. Covering too much syntax detail early can detract from that objective. Thus, we initially gloss over some less-important syntax details and come back to those details later in Chapter 12. This chapter provides more details on items such as these: ∙ byte and short primitive types ∙ Unicode character set ∙ type promotions ∙ postfix versus prefix modes for the increment and decrement operators ∙ conditional operator ∙ short-circuit evaluation ∙ enum data type ∙ forEach method ∙ lambda expressions ∙ method references ∙ streams The chapter ends with a friendly introduction to a relatively large public-domain program called Grid- World, which the College Board has used for many years as part of its AP Computer Science A course of study. This gives students a glimpse of how larger programs are organized. Chapters 13–14 Chapters 13 and 14 describe class relationships in depth with numerous examples. Chapter 13 describes aggregation, composition, and inheritance. Chapter 14 describes advanced inheritance-related details such as the Object class, polymorphism, abstract classes, and the finer points of interfaces. An optional section at the end of Chapter 13 describes an extension of the GridWorld environment introduced in Chapter 12 and provides additional exposure to Java’s legacy AWT and Swing graphics. Exercises in Chapters 13 and 14 relate material in these two chapters to corresponding GridWorld features. Chapters 15−16 Chapter 15 describes exception handling, and Chapter 16 describes files. We present exception handling before files because file-handling code requires the use of exception handling. For example, to open a file one must check for an exception. In addition to simple text I/O, our treatment of files includes buffering, random access, channeling, and memory mapping. Chapters 17−19 As in the end-of-chapter GUI sections, Chapters 17−19 present GUI concepts using the JavaFX platform. But the programming strategies differ. What follows are the strategies used in Chapters 17–19 (which are different from the strategies used in the end-of-chapter GUI sections). For user input, the programs use the components TextField, TextArea, Button, RadioButton, CheckBox, ComboBox, ScrollPane, and Menu. For layout, the programs use the containers FlowPane, VBox, HBox, GridPane, BorderPane, TilePane, and TextFlow. For formatting, the programs use JavaFX CSS properties. Depending on how much and what kind of GUI techniques you’re interested in, you can study one or more of the end-of-chapter GUI sections or skip all of them. That won’t affect your ability to grasp what’s in Chapters 17−19. If you’re short on time, you can omit all of the book’s GUI material without compro- mising your understanding of other material in the book. dea75768_fm_i-xxxviii.indd 19 5/10/20 8:50 PM
  • 16. xx Preface Chapters S17−S18 Chapters S17 and S18 (the S’s stand for supplemental) are posted online. They describe the older Java GUI platforms—AWT and Swing. The trend has been for new Java programs to use JavaFX, and not AWT and Swing. However, there’s quite a bit of AWT and Swing code currently in production, and that means there’s still a need for Java programmers to understand the older techniques so they can update and improve existing code. So if you find yourself in that position, Chapters S17 and S18 are a good starting point for learning what you need to know. Appendices Most of the appendices cover reference material, like the ASCII character set and the operator precedence table. For this third edition, we have updated Appendix 4 by including a detailed description of Java modules. Subject-Matter Dependencies and Sequence-Changing Opportunities We’ve positioned the textbook’s material in a natural order for someone who wants fundamentals and also wants an early introduction to OOP. We feel that our order is the most efficient and effective one for learning how to become a proficient OOP programmer. Nonetheless, we realize that different readers have different content- ordering preferences. To accommodate those different preferences, we’ve provided some built-in flexibility. Figure 0.1 illustrates that flexibility by showing chapter dependencies and, more importantly, chapter ­ nondependencies. For example, the arrow between Chapter 3 and Chapter 4 means that Chapter 3 must be read prior to Chapter 4. Because there are no arrows going out of Chapters 1, 11, and 16 that point to other complete chapters, you may skip those chapters without losing prerequisite material that later chapters need. We use rectangles with rounded corners to indicate chapter sections that you may want to read in advance. If you choose that option, you’ll want to return to the normal chapter sequence after completing the advanced sections. Here are some sequence-changing opportunities revealed by Figure 0.1: ∙ Readers can skip Chapter 1, “Introduction to Computers and Programming.” ∙ For an earlier introduction to OOP, readers can read the OOP overview section in Chapter 6 after reading Chapter 1. ∙ Readers can learn OOP syntax and semantics in Chapter 6 after finishing Java basics in Chapter 3. ∙ For additional looping practice, readers can learn about arrays in Chapter 9 after finishing loops in Chapter 4. ∙ Readers can skip Chapter 11, “Recursion,” and Chapter 16, “Files.” ∙ Readers who prefer a late objects approach can postpone reading Chapter 6, “Object-Oriented Pro- gramming,” by first reading Chapter S6, “Writing Methods in a Non-Object-Oriented Environment,” Sections 9.1–9.6 (which explain the basics of arrays), and Chapter S9, “Arrays in a Non-Object- Oriented Environment.” ∙ For GUI programming, readers who prefer the Swing platform should read Chapters S17 and S18. To support content-ordering flexibility, the book contains “hyperlinks.” A hyperlink is an optional jump forward from one place in the book to another place. The jumps are legal in terms of prerequisite knowledge, meaning that the jumped-over (skipped) material is unnecessary for an understanding of the later material. We supply hyperlinks for each of the nonsequential arrows in Figure 0.1. For example, we supply hyperlinks that go from Chapter 1 to Chapter 6 and from Chapter 3 to Chapter 12. For each hyperlink tail end (in the earlier chapter), we tell the reader where they may optionally jump to. For each hyperlink target end (in the later chapter), we provide an icon at the side of the target text that helps readers find the place where they are to begin reading. dea75768_fm_i-xxxviii.indd 20 5/12/20 1:24 PM
  • 17. Preface xxi Figure 0.1 Chapter dependencies Ch 5: Using Prebuilt Methods Ch 1: Introduction Ch 2: Algorithms and Design Ch 3: Java Basics Ch 4: Control Statements §6.2 OOP Overview §6.1−§6.8 OOP Basics §12.6−§12.12 Alternate Coding Mechanisms §9.1−§9.6 Arrays §12.1−§12.5 Type Details Interlude Ch 8: Software Engineering Ch 6: Object-Oriented Programming Ch 7: OOP−Additional Details §11.1−§11.5 Non- Array Recursion §9.1−§9.6 Array Basics Chapter S6: Writing Methods in a Non-Object- Oriented Environment Chapter S9: Arrays in a Non-Object-Oriented Environment Ch 9: Arrays Ch 10: ArrayList and Introduction to Java Collections Framework Ch 12: Type Details and Alternate Coding Mechanisms Ch 11: Recursion Ch 13: Aggregation, Composition and Inheritance Ch 16: Files Ch 14: Inheritance and Polymorphism Ch 15: Exception Handling Ch S17: Swing GUI Programming Basics Ch 17: GUI Programming Basics Ch 18: GUI Programming— Layout Panes Ch 19: GUI Programming— Additional GUI Components, Additional Event Handlers, Animation Ch S18: Swing GUI Component Layout, Additional GUI Components dea75768_fm_i-xxxviii.indd 21 4/30/20 11:54 AM
  • 18. Discovering Diverse Content Through Random Scribd Documents
  • 22. The Project Gutenberg eBook of If You're Smart—
  • 23. 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: If You're Smart— Author: Malcolm Jameson Illustrator: William A. Kolliker Release date: February 24, 2020 [eBook #61498] Most recently updated: October 17, 2024 Language: English Credits: Produced by Greg Weeks, Mary Meehan and the Online Distributed Proofreading Team at http://www.pgdp.net *** START OF THE PROJECT GUTENBERG EBOOK IF YOU'RE SMART — ***
  • 26. By Colin Keith Seems a pretty obvious crack for a business sharper to make to an inventor. If you're so smart, why don't you make some money yourself? Maybe so. But this scientist had an even better answer— [Transcriber's Note: This etext was produced from Astounding Science-Fiction April 1942. Extensive research did not uncover any evidence that the U.S. copyright on this publication was renewed.]
  • 27. If you're so damn smart, why ain't you rich? That hoary wisecrack must have been all of three centuries old when Wolf Carmichael pulled it on Dr. Claud Kellog. The Wolf of Saturn loved it and used it often. That day he lay back in his swivel chair, chuckling offensively somewhere in the fatty depths of his triple chin, as he threw it. But his roving, piggish eyes showed no mirth. They were hard and scheming, the ruthless eyes that had made him master of all commerce and industry throughout the Saturnian system. To his money-grubbing mentality, this question was the ultimate in triumphant repartee. A scholar named Archimedes was asked that question once, replied Dr. Kellog, flushing angrily, and to prove he could be rich if he wished, he knocked off his important mathematical researches long enough to buy up all the wine presses in the country. It was winter, then, but when the next fall came the vintners had to have their presses back or else lose the grape crop. Archimedes made a tidy profit. Never heard of him, snorted Carmichael. Musta been some little fellow on Venus. If he was a real big shot in the booze racket, he'd be on the board of Interplanetary Distillers. He aint. Carmichael threw away the stump of the cigar he was smoking and lit another. To get back to this gadget of yours, he resumed indifferently. Maybe it's as good as you say, maybe not. But George Carmichael was always the boy to give a struggling inventor a chance— Kellog winced. Yeah. Wolf would back anything that promised sure profit and no loss—provided he was given control. —so here's what I'm willing to do. Your proposition to have me lend you enough to get your machines built is out—the machines might flop, then where'd I be? What we'll do is this—incorporate your whatchamacallit—
  • 28. Antichron. Antichron, huh? We'll incorporate it first, then put it into production. I get fifty-five percent of the stock for promotion fee, we sell twenty to the public for working capital, and all the rest is yours. See? Kellog saw. It was a typical Carmichael proposition. Kellog would furnish the work and brains, the sucker public the money. If the venture failed, Carmichael couldn't be hurt; if it succeeded, he would rake in the lion's share. Kellog reached for his hat and jammed it on his head. That's pure burglary, Mr. Carmichael, he said fairly evenly, mustering all his powers of self-restraint. I'll see you in hell first. Tut, tut, my boy, said Carmichael with a repetition of his nasty chuckle, how fiery you are! That's bad. You should never mix emotion with business. Take me. Am I offended? No. I'll be here tomorrow, and the day after that, and the day after that, ready to do business with you. You'll come back—they always do. Kellog only glared at him, then strode from the room, boiling at the arrogance of the grasping capitalist. And as he angrily made his way down the main street of Saturnport, everything he saw added to his rage—and to his gloom, too. For every enterprise of any magnitude on Titan, or on any of the other Saturnian satellites, was owned or controlled by Carmichael. The list was an imposing one. Carmichael was the president of the Titanic Trust Co., the only bank. He owned the Saturnport Supply Co. and Titan Shipyards outright. He had a fat finger in Rhean Ranches, Miman Mines, Titan Radio Power, the Dione angrauk packeries, and the ruby pits on Enceladus. What burned up Kellog the most was Trans-Saturnian Lighter Service. That line of small intersatellite freighters had been established and built by his father, years before. It supplied a much-needed service, for the great interplanetary ships stopped only at Saturnport. The little lighters carried the slaughtered angrauks from Rhea to the packeries of Dione, and thence to the big port. They hauled ores from the mines of Mimas to the smelters on Titan, and did other
  • 29. chores of the kind. Carmichael saw it was a profitable line and tried to buy into it. The elder Kellog resisted. Carmichael shut down his mines for a year, cutting off important revenue. A quarantine on angrauks was mysteriously promulgated; taxes on intersatellite shipping increased. The bank called Kellog's notes. His lighter service was forced into bankruptcy. And Carmichael bought it for a song, muttered Doc, bitterly, had the new taxes repealed and the quarantine rescinded. It broke dad's heart. That was the way the Wolf of Saturn did things. Honeyed words, cash advances, at first, anything for a foothold. Then squeeze, squeeze until the enterprise was his. Now that he had the colonies of the Saturnian system well under his thumb, he was branching out into larger fields. He had ambitions of going back to the Earth one day and taking his place among the mighty in Wall Street, where the Systemic Stock Exchange was. He wanted to lock horns with such magnates as Aalman, head of Venus Exploitation, Inc., and chairman of the board of the Tellurian Master Bank. He wanted a bigger say-so in the operation of the Interplanetary Transport Co. and a directorship on Etherways, the planets' communication system. Therefore, when he was not in his office at the Carmichael Building, he could be found in the brokerage office of Neville Beardsley, trading fiercely in securities, trying to match wits with Aalman and the other tycoons. Doc Kellog knew all that and knew how hopeless his fight was. Yet that illiterate taunt still rang in his ears. He was smart, but he wasn't rich. There must be something wrong with his approach to things. Other men with half his brains got along and prospered; why couldn't he? That thought was uppermost in his mind when he reached his laboratory. What luck, Doc? asked cheery Billy Wade, his chief assistant. The usual, growled Kellog. He wants to hog the show, otherwise no dice. I told him to go to hell.
  • 30. Swell, grinned Billy Wade, admiringly, but where do we get off? Fold up and get jobs somewhere? Maybe. Doc Kellog's anger had cooled somewhat and dejection had succeeded it. But he was not quite ready to surrender. The memory of that sneering challenge still rankled. Kellog sat down and stared at the floor in deep thought. Things looked black. The single model of his antichron worked perfectly. It had proved that his theory was correct. He could warp space-time, given power enough, and bring all the planets together, just as centuries before the introduction of telegraph and radio brought all the countries of the Earth together. But his money was gone, his bills mounting, and he was forced to deal with interlocking monopolies for all his supplies, power and credit. Carmichael knew that as well as he did and was waiting for the plum to drop in his lap. Kellog knew that Carmichael would fight him tooth and nail unless he cut him in. And that Kellog was resolved not to do. He had never thought of his invention in terms of money before, but rather in terms of the immense boon it would be to all humanity, taking it for granted that his own compensation would be just and adequate. But now he was racking his brain for a way to turn it into money—lots of money—and quickly. He had exhausted all his own resources in building the one model he had, and the power bills were eating him up. If they were not paid by the end of the week, Titan Power would attach his laboratory and its contents, which was the same as saying Carmichael would. Antichron—what were its chief virtues? What could he cash in on now? For he must not only save what he had, but construct other machines to introduce to the public. He sat up and looked at his model thoughtfully. It was a clumsy-looking device, a monster machine taking up the whole side of the room. Its main feature was a six-foot-square crystal window, framed by shiny steel panels
  • 31. studded with knobs, dials, glowing tubes, buttons and cranks. The crystal resembled an ordinary televise scanner of the type used by Etherways, except that it was thicker and double-faced. Whatever form of energy, whether heat, electricity or light, impinged on one face was immediately transmitted to the other. Where it differed from the standard models was that its two faces could be split apart when subjected to antichronic stresses, and separated by any number of millions of miles. But the same antichronic stresses also created a warp in space-time so that the interval seemed not to exist. It was a window that with the proper manipulations of its complex controls could be made to look upon any spot in the universe and receive energy impulse from it then. That then was its great virtue. Long before space travel was an actuality, mathematicians had known that there was no such thing as simultaneity. Time, like space, was relative. They had had their first practical demonstration of it when they tried to use two-way television between the Earth and Moon. Radio waves took a little over a second to travel each way. A man would speak, then wait for two seconds before his answer began coming back to him. Later, that time lag became almost intolerable. From Callisto it was three quarters of an hour—you activated the machine, waited forty or so minutes for it to light up, and then you waited an equal period for the inquiring face looking at you to register understanding and begin his reply. Obviously, where an hour and a half intervened between question and answer, sprightly conversation was impossible. The antichron would cure that. With the space between warped out of existence, instantaneous response could be had. Why ain't I rich, huh? repeated Kellog, sourly, and began thinking on how men got rich. Not by inventing useful things or hard work, necessarily. He thought of Carmichael's career, and Aalman's, and those of others. They had one common denominator—they were men who bought and sold, bought cheap and sold dear. And where did they find their sellers and buyers? Why, on the Stock Exchange, of course. Kellog's eyes lit up and he almost trembled with
  • 32. excitement as the full implications of that chance thought dawned upon him. He jumped up and called Wade to him. How much money have we? he asked excitedly. Billy Wade pulled out a wallet and squinted at its contents. There's about a thousand here of my own and the three thousand you gave me to keep for the power bill. Willing to gamble? Wade just grinned and handed over the money. Quick, now. Grab the current 'Ephemerides' and find the Earth's present position and rate of relative movement. Then look up the exact latitude and longitude of the lower tip of Manhattan Island— that's in New York. Kellog ran over to the antichron and began setting the dials as Wade called out the figures. Then he threw a master switch and the machine hummed into activity. In a moment the screen was glowing, then transparent. It was as if Kellog were looking out of a window high over a green park surrounded on three sides by water. He adjusted the mechanism and caused the projected screen to lower itself to a great sprawling building that lay below. He forced it through a wall, and there he was—looking in on the trading floor of the nerve center of the Solar System, the Systemic Stock Exchange! Thousands of men were milling about beneath, gesticulating and shouting. At the other end of the vast hall an immense annunciator board stood, on which names and numbers appeared. A flickering screen beside it was displaying news flashes. A notebook! Hurry! exclaimed Doc Kellog. He jotted down quotations as he watched. Callistan Radioactives was high and climbing—a sale at 423-1/2, then another at 428, then at 430-1/4. A flash came over the screen saying Martian Gems had passed its dividend. Martian Gems promptly dropped twelve points. Etherways and I. P. T. were strong. The market generally was strong.
  • 33. Let her run, Doc shouted, shoving the book into his pocket. Damn the power bill. If I'm right, it won't matter; if I'm wrong, it won't matter either. I'll be seeing you. Then he was out and gone, hurrying to Neville Beardsley.
  • 34. Mr. Neville took the money, but he looked at the young scientist dubiously. Small margin accounts are dangerous, he warned. We accept them, but we don't solicit them. Those wolves out there will take the shirt off your back so quick it will make your head swim. Fair enough, answered Kellog cheerfully. As a matter of fact, I am in the market for a few wolfskins myself. Here, buy me some Callistan Radioactives and sell some Martian Gems; all you can for the money. Neville grunted disapprovingly, but took the money. Nobody but an ignorant fool would sell Martian short, and Callistan was no bargain above 400. Kellog went on into the board room and sat down behind the group of local capitalists who were scanning the board in a listless, bored way. Kellog had a hard time restraining his elation, for the figures on the board they were looking at were ancient history to him. His information was over an hour ahead of it. After a while he got up and phoned Wade from a booth. Read me the latest dope, he said. Then listened as Wade gave him the quotations. Martian had stopped falling; there was a flurry in Oberon Metals. He hung up and stopped at Neville's desk on the way back to his chair. Cover that Martian sale, then buy me some Oberon. Neville blinked. Oberon had been inactive for days. But he noticed Kellog had doubled his money on the Martian transaction, and had a nice paper profit on his Callistan stock. Beginner's luck, he cautioned, as he filed the order. When Kellog got the day's close from Wade, he closed out his line. It was not a bad day's work. His cash balance on Neville's books was over fourteen thousand. He left it there; tomorrow was another day. The next day he ran the fourteen thousand up to forty-five. The day after that he finished up with a couple of hundred. He drew enough
  • 35. of it to pay the power bill, then walked on to the booking office of Titan General Shops. Last week, said Kellog to the clerk, I left an order here for some parts for a special televise machine— It's N. G., said the insolent clerk. Credit disapproved. I've got the money now, added Kellog. But the clerk shook his head and walked away. Over his shoulder he flung: You gotta get Wolf's O. K. He stopped it—personally. Oh, said Kellog. So he wouldn't be permitted to develop his invention on Titan even if he had money! Carmichael held the reins —the supply house, the shops, the power plant, transportation. Kellog walked slowly back to his laboratory, thinking on the way what his next step would be. The following day he had better luck. When he looked from his antichron onto the clamoring mob of Wall Street brokers he knew at once that something unusual was afoot. Pandemonium reigned, and often awed faces would turn to stare up at the quotation board with its ever-changing symbols of good and bad news. Kellog read the last bulletin hurriedly. Following the suicide early this morning of Charles Bean, general manager of Venus Exploitation, rumors persist that the company's billion-dollar investment in mimil plantations has had to be written off as a total loss. The stock opened at 240, but fell off over a hundred points in the first few minutes of trading. The last sale was at 97— Kellog waited, tense. He watched Exploitation sink rapidly to 60, 50, then 40. A gong rang and the screen lighted up again. A correction to the last bulletin, it said. President Aalman has made a statement. He says that Bean's suicide was due entirely to domestic difficulties. The mimil venture has been tremendously successful. So much so that the board of directors announce a one hundred percent stock dividend and an equal amount in cash. He
  • 36. further states that he will buy personally all the stock that is offered under 500. At once the tumult on the floor increased to a howling typhoon of sound as the brokers suddenly reversed their position and began hunting sellers as fervidly as they had previously been hunting buyers. The bidding was wild, leaping by bounds to ever-higher figures. Exploitation rose from its depths like a soaring skyrocket—up into the hundreds, past the five-hundred mark of Aalman's bid, on to a thousand and upward. Another gong. Another announcement. It is apparent that an effort is being made to corner Venus Exploitation. The Exchange authorities have ordered, dealings in the stock suspended. Speculators short of stock may settle at the rate of two thousand dollars per share. Wow! yelled Doc Kellog, and a moment later he was burning up the road to Neville Beardsley. The board room was crowded when he got there. All the big shots of Titan were present, not excepting Carmichael. There was sheer panic in the faces of some as they stared at the earlier bulletins, for Exploitation represented a heavy investment for most of them. Even Wolf's usually expressionless face showed concern as he saw his spare millions dwindle to half and less. He was so intent on following the damning figures that he did not notice the entrance of Kellog, or that he sat down beside him in the chair vacated by a haggard man who had just rushed despairingly from the room. It's more of Aalman's skulduggery, the pirate! growled Carmichael to the fellow sitting on the other side. He's looted the company, that's what. We're stuck. I'm getting out while I can. He wrote an order and beckoned to Neville.
  • 37. The hell of it is, Wolf added, to his crafty-looking partner, that while this order is getting to New York, the stock will drop forty points more. Damn that time lag! Neville approached, bowed respectfully, and took the order. He looked at it, then remarked: This is for more than you own. Are you taking a short position? Right! The stuff's wallpaper. When Aalman milks 'em, they stay milked. Tomorrow I can cover at three. Get rid of this—quick. Neville bowed again and turned away. Kellog plucked him by the sleeve. He had sneaked a look at the order. The amount he had on balance would margin it. I'll take that—at the current price, he whispered. You needn't send it to New York. You're crazy, said Neville, but he noted the order. Kellog sat back and waited, gloating. In a few minutes the news would come through that the market had reversed itself. He had made a brilliant double play. If Carmichael's selling order had gone through in the regular way, when it hit New York his stock would have brought him hundreds of dollars a share; conversely, if his own buying order had, he would have had to pay the corresponding price. As it was, he got Carmichael's stock at 43, close to the bottom, and for it Wolf received but 43. Whipsawed! Carmichael yelled when Aalman's bullish statement was broadcast. The dirty rattlesnake. He started the rumors to depress the stock; now he's buying it in at a bargain. Neville! Cancel my selling orders. Neville was late in coming. In the meantime the later flash showed on the screen—the one telling of suspension of trading and the penalties levied on short-sellers. Sorry, sir, said Neville, as placatingly as possible, but it is already executed. You said quick, so I disposed of it locally.
  • 38. Carmichael snorted and looked about him. What fool— he began, but Neville simply said, The gentleman on your right. Carmichael glared at Kellog. Kellog glared right back. You! howled Wolf, his porcine eyes incredulous. Me, grinned Kellog. You owe me five thousand shares of Exploitation, I believe. I want it. Carmichael sputtered and gazed questioningly at Neville. It must be a joke—this silly upstart of a scientist holding the whip hand over him. Why, only a few days before he had come whining to his office for the loan of a miserable few thousand. Now he was demanding ten million. Preposterous! If you haven't the cash, I'll settle for a deed to Titan Shops, lock, stock and barrel, offered Kellog smoothly, but he could not conceal the triumph in his eyes. I am rather anxious to get a little job done there, but up to now they haven't been very ... uh ... co-operative. Carmichael grunted like a prodded boar, frowning. He was in a tight spot; he knew it. He had to settle and he did not have the cash. Moreover, it hurt him to give up a property. But there seemed to be no choice, and he was aware that the other speculators in the room were watching him closely. He couldn't welsh—not openly. Done! he exploded. That night Kellog took over the Titan General Shops. He and Wade worked late, laying out the program for the following day. Tomorrow they would start construction on the first batch of commercial antichrons. But just at midnight a messenger came, bearing a communication from the power company. It read:
  • 39. You are hereby notified that due to inadequate generating facilities, Titan Radio Power finds itself compelled to curtail its service. Since our contract to furnish your plant with power was made with Mr. George Carmichael personally and not with the Titan General Shops, the change of ownership voids it. All service will be discontinued within four hours. The dirty rat! blazed Kellog. Wolf is the word, corrected Billy Wade with a sigh. You can't beat him. We'll see, said Kellog grimly. Let's have a look at the electrical hook-up here. Maybe we can use antichron in another way. Neither he nor Wade attempted to sleep that night. They were much too busy. The machine was retuned and put in search for the New York home of the general manager of Tellurian Power. They found him, aroused him and made their proposition. Yes, the Earth plants had unlimited power. Yes, if Kellog could project a receiving plate into one of Tellurian's generating plants, its men would connect leads to it. The general manager doubted whether power could be transmitted from planet to planet—it had never been done before— but if they would pay for it, he would send it. Kellog closed the deal. Then he and Wade went about altering the antichron for gathering pure current, not light. They marked the back face to show where the Earthly electrodes should be placed. On the front they attached their own connections. Those led to the shops. Then they set the space-time warper to working. In a moment the back face was gone. No doubt, at that instant, startled engineers were puzzling over the bizarre outlet that had suddenly appeared in their plant. Say, said Billy Wade. He said unlimited power, didn't he? And the rate there is a tenth what it is here. Why not peddle some juice on the side? Right! yelped Kellog, and he reached for a pad.
  • 40. POWER FOR SALE, CHEAP Owing to surplus productive capacity provided by new owners, Titan General Shops is in a position to furnish any quantity of power at the rate of ten cents a mega-watt hour. Get that to the Saturnport Herald to be run in the next edition, he told Wade. This'll wash up Titan Power, if my guess is any good, remarked Wade cheerfully. They've been getting away with murder. Yep, said Kellog dreamily. Carmichael would have to write off another asset, for local power could not possibly compete with Tellurian now that there was a way to transmit it. And the power monopoly was the biggest plum in Wolf's basket. In an hour the first surges of energy were coming in from Earth, flowing from the antichron into the local radio distributing emission set. The electricians at the plant simply tuned out on Titan Power and in on the laboratory set. The shift was made. Carmichael did not take the fresh assault upon him lying down. He promptly went about getting an injunction against the unfranchised sale of power, but it was several days before he could get it issued. In the meantime, with the full facilities of the shop at his disposal, Kellog had completed a batch of sight-sound antichrons for use in communication. He hired and instructed operators. Then the machines were focused on the various important planets, satellites and asteroids. At one stroke Saturnport became the central clearing house of the Solar System for news. If necessary, a Pluto signal could be relayed through Titan to Earth in only the time necessary to make the connections. Etherways was at once ruined. All its equipment was junk, except for nearby use.
  • 41. That ought to hurt, observed Billy Wade, jubilantly. They say Wolf had a pile of Etherways Preferred. Probably, said Kellog. But he was smarting under the injunction. The corrupt local court had forbidden the outside sale of power. Not only that, the Saturnport Council—all creatures of Carmichael— issued an edict prohibiting the importation of power generated outside of Titan. This time the shops did have to close down until Kellog could improvise some old-fashioned magnetic generators of the field-armature type. Not content with inflicting those inconveniences on Kellog, Carmichael might be expected next to bring suit for personal damages ensuing from the collapse of Etherways. Etherways represented the investment of important money, and the men who lost were not the type who would console themselves that their company had been replaced by something incomparably better. I've got to go all the way, concluded Kellog, soberly. If I don't get him, he'll get me. Again he put his and Wade's head together and designed a new type of antichron. It was three-dimensional—a cubical box, to be exact, with four sides and a bottom, but open at the top. It worked on the same principle as the flat screen, but with slight variations. It operated as a shuttle, not continuously. Kellog put one of his television machines in focus with the mine on Mimas. Miman Mines was only partly owned by Carmichael; he controlled the industries on the lesser satellites by virtue of his strangle-hold on transportation. So the manager was willing to talk to Kellog. What do you pay that buccaneer to haul ore to Titan? asked Kellog. Twenty cents a ton. I'll haul it for two.
  • 42. You can't, objected the manager. The Trans-Saturnian Lighter Service's charter says— I know what it says, snapped back Kellog. My father drew it up. It confers a perpetual monopoly on all intersatellite ship-borne commerce. Now listen. Clear a place about twenty feet square and arrange to dump ore in it from twenty feet or more above. Mark it off with safety lines and don't ever let a man step across the lines. Then watch my smoke. He cut the connection long enough to send similar instructions to the receiving station by the smelter. Then he watched through the antichron while the preparations were being made at both ends of the line. When they were ready he turned the machine over to Wade. Wade sat down and got to work. His job was very much like that of the operator of a grab bucket. He kept his eyes on the visual screen, his hands on the controls of the cubical one. Current!—the empty cube appears on Mimas—an avalanche of ore fills it—shift current—it disappears from Mimas, appears at the smelter on Titan—the unloading cradle on which it materializes tips and dumps the ore—when it is upright again, shift current. Mimas, fill; Titan, dump. Mimas, fill; Titan, dump. That was all there was to it. Hundreds of tons a minute, delivered in Titan the day it is mined. That shoots Interplanetary Transportation and Trans-Saturnian all to hell, I should say, drawled the editor of the Herald, who had been invited to watch the demonstration. He was conducting a campaign to have Carmichael's injunction revoked. Now that the people knew cheap power was available, they were angry about it. Yes, continued the editor, they're sunk. I'm going to stroll down to the bank and draw out my balance before the run starts. What do you mean? asked Kellog. Plenty. The bank is really a sort of holding company for Wolf. Now that his companies are all shot, it'll crash. You may not know it yet,
  • 43. but Carmichael is ruined. He will be a very sick wolf in an hour or so. Who is the Wolf of Saturn? People on Titan will point out a blowzy, sodden old derelict who hangs out in a dive near the skyport and tell you that Carmy, as they call him now, used to wear that title. He was a big shot once, they say. But if you should ask any of the frequenters of the big building on lower Manhattan who the Wolf of Saturn is, they will tell you instantly. It is a crackpot on Titan by the name of Kellog. He was the fellow who ruthlessly and without warning wrecked two of the biggest and most profitable enterprises in the universe—Etherways, Inc., and Interplanetary Transport—and many of the smartest financiers of the System with it. What a guy! Not only that, but he wrecked the System's entire price structure with his cheap services. Benefactor? they will squall. He's a wild man—a wolf!
  • 44. *** END OF THE PROJECT GUTENBERG EBOOK IF YOU'RE SMART— *** Updated editions will replace the previous one—the old editions will be renamed. Creating the works from print editions not protected by U.S. copyright law means that no one owns a United States copyright in these works, so the Foundation (and you!) can copy and distribute it in the United States without permission and without paying copyright royalties. Special rules, set forth in the General Terms of Use part of this license, apply to copying and distributing Project Gutenberg™ electronic works to protect the PROJECT GUTENBERG™ concept and trademark. Project Gutenberg is a registered trademark, and may not be used if you charge for an eBook, except by following the terms of the trademark license, including paying royalties for use of the Project Gutenberg trademark. If you do not charge anything for copies of this eBook, complying with the trademark license is very easy. You may use this eBook for nearly any purpose such as creation of derivative works, reports, performances and research. Project Gutenberg eBooks may be modified and printed and given away—you may do practically ANYTHING in the United States with eBooks not protected by U.S. copyright law. Redistribution is subject to the trademark license, especially commercial redistribution. START: FULL LICENSE
  • 45. THE FULL PROJECT GUTENBERG LICENSE
  • 46. PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK To protect the Project Gutenberg™ mission of promoting the free distribution of electronic works, by using or distributing this work (or any other work associated in any way with the phrase “Project Gutenberg”), you agree to comply with all the terms of the Full Project Gutenberg™ License available with this file or online at www.gutenberg.org/license. Section 1. General Terms of Use and Redistributing Project Gutenberg™ electronic works 1.A. By reading or using any part of this Project Gutenberg™ electronic work, you indicate that you have read, understand, agree to and accept all the terms of this license and intellectual property (trademark/copyright) agreement. If you do not agree to abide by all the terms of this agreement, you must cease using and return or destroy all copies of Project Gutenberg™ electronic works in your possession. If you paid a fee for obtaining a copy of or access to a Project Gutenberg™ electronic work and you do not agree to be bound by the terms of this agreement, you may obtain a refund from the person or entity to whom you paid the fee as set forth in paragraph 1.E.8. 1.B. “Project Gutenberg” is a registered trademark. It may only be used on or associated in any way with an electronic work by people who agree to be bound by the terms of this agreement. There are a few things that you can do with most Project Gutenberg™ electronic works even without complying with the full terms of this agreement. See paragraph 1.C below. There are a lot of things you can do with Project Gutenberg™ electronic works if you follow the terms of this agreement and help preserve free future access to Project Gutenberg™ electronic works. See paragraph 1.E below.
  • 47. 1.C. The Project Gutenberg Literary Archive Foundation (“the Foundation” or PGLAF), owns a compilation copyright in the collection of Project Gutenberg™ electronic works. Nearly all the individual works in the collection are in the public domain in the United States. If an individual work is unprotected by copyright law in the United States and you are located in the United States, we do not claim a right to prevent you from copying, distributing, performing, displaying or creating derivative works based on the work as long as all references to Project Gutenberg are removed. Of course, we hope that you will support the Project Gutenberg™ mission of promoting free access to electronic works by freely sharing Project Gutenberg™ works in compliance with the terms of this agreement for keeping the Project Gutenberg™ name associated with the work. You can easily comply with the terms of this agreement by keeping this work in the same format with its attached full Project Gutenberg™ License when you share it without charge with others. 1.D. The copyright laws of the place where you are located also govern what you can do with this work. Copyright laws in most countries are in a constant state of change. If you are outside the United States, check the laws of your country in addition to the terms of this agreement before downloading, copying, displaying, performing, distributing or creating derivative works based on this work or any other Project Gutenberg™ work. The Foundation makes no representations concerning the copyright status of any work in any country other than the United States. 1.E. Unless you have removed all references to Project Gutenberg: 1.E.1. The following sentence, with active links to, or other immediate access to, the full Project Gutenberg™ License must appear prominently whenever any copy of a Project Gutenberg™ work (any work on which the phrase “Project Gutenberg” appears, or with which the phrase “Project Gutenberg” is associated) is accessed, displayed, performed, viewed, copied or distributed:
  • 48. 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. 1.E.2. If an individual Project Gutenberg™ electronic work is derived from texts not protected by U.S. copyright law (does not contain a notice indicating that it is posted with permission of the copyright holder), the work can be copied and distributed to anyone in the United States without paying any fees or charges. If you are redistributing or providing access to a work with the phrase “Project Gutenberg” associated with or appearing on the work, you must comply either with the requirements of paragraphs 1.E.1 through 1.E.7 or obtain permission for the use of the work and the Project Gutenberg™ trademark as set forth in paragraphs 1.E.8 or 1.E.9. 1.E.3. If an individual Project Gutenberg™ electronic work is posted with the permission of the copyright holder, your use and distribution must comply with both paragraphs 1.E.1 through 1.E.7 and any additional terms imposed by the copyright holder. Additional terms will be linked to the Project Gutenberg™ License for all works posted with the permission of the copyright holder found at the beginning of this work. 1.E.4. Do not unlink or detach or remove the full Project Gutenberg™ License terms from this work, or any files containing a part of this work or any other work associated with Project Gutenberg™. 1.E.5. Do not copy, display, perform, distribute or redistribute this electronic work, or any part of this electronic work, without prominently displaying the sentence set forth in paragraph 1.E.1
  • 49. with active links or immediate access to the full terms of the Project Gutenberg™ License. 1.E.6. You may convert to and distribute this work in any binary, compressed, marked up, nonproprietary or proprietary form, including any word processing or hypertext form. However, if you provide access to or distribute copies of a Project Gutenberg™ work in a format other than “Plain Vanilla ASCII” or other format used in the official version posted on the official Project Gutenberg™ website (www.gutenberg.org), you must, at no additional cost, fee or expense to the user, provide a copy, a means of exporting a copy, or a means of obtaining a copy upon request, of the work in its original “Plain Vanilla ASCII” or other form. Any alternate format must include the full Project Gutenberg™ License as specified in paragraph 1.E.1. 1.E.7. Do not charge a fee for access to, viewing, displaying, performing, copying or distributing any Project Gutenberg™ works unless you comply with paragraph 1.E.8 or 1.E.9. 1.E.8. You may charge a reasonable fee for copies of or providing access to or distributing Project Gutenberg™ electronic works provided that: • You pay a royalty fee of 20% of the gross profits you derive from the use of Project Gutenberg™ works calculated using the method you already use to calculate your applicable taxes. The fee is owed to the owner of the Project Gutenberg™ trademark, but he has agreed to donate royalties under this paragraph to the Project Gutenberg Literary Archive Foundation. Royalty payments must be paid within 60 days following each date on which you prepare (or are legally required to prepare) your periodic tax returns. Royalty payments should be clearly marked as such and sent to the Project Gutenberg Literary Archive Foundation at the address specified in Section 4, “Information
  • 50. about donations to the Project Gutenberg Literary Archive Foundation.” • You provide a full refund of any money paid by a user who notifies you in writing (or by e-mail) within 30 days of receipt that s/he does not agree to the terms of the full Project Gutenberg™ License. You must require such a user to return or destroy all copies of the works possessed in a physical medium and discontinue all use of and all access to other copies of Project Gutenberg™ works. • You provide, in accordance with paragraph 1.F.3, a full refund of any money paid for a work or a replacement copy, if a defect in the electronic work is discovered and reported to you within 90 days of receipt of the work. • You comply with all other terms of this agreement for free distribution of Project Gutenberg™ works. 1.E.9. If you wish to charge a fee or distribute a Project Gutenberg™ electronic work or group of works on different terms than are set forth in this agreement, you must obtain permission in writing from the Project Gutenberg Literary Archive Foundation, the manager of the Project Gutenberg™ trademark. Contact the Foundation as set forth in Section 3 below. 1.F. 1.F.1. Project Gutenberg volunteers and employees expend considerable effort to identify, do copyright research on, transcribe and proofread works not protected by U.S. copyright law in creating the Project Gutenberg™ collection. Despite these efforts, Project Gutenberg™ electronic works, and the medium on which they may be stored, may contain “Defects,” such as, but not limited to, incomplete, inaccurate or corrupt data, transcription errors, a copyright or other intellectual property infringement, a defective or
  • 51. damaged disk or other medium, a computer virus, or computer codes that damage or cannot be read by your equipment. 1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except for the “Right of Replacement or Refund” described in paragraph 1.F.3, the Project Gutenberg Literary Archive Foundation, the owner of the Project Gutenberg™ trademark, and any other party distributing a Project Gutenberg™ electronic work under this agreement, disclaim all liability to you for damages, costs and expenses, including legal fees. YOU AGREE THAT YOU HAVE NO REMEDIES FOR NEGLIGENCE, STRICT LIABILITY, BREACH OF WARRANTY OR BREACH OF CONTRACT EXCEPT THOSE PROVIDED IN PARAGRAPH 1.F.3. YOU AGREE THAT THE FOUNDATION, THE TRADEMARK OWNER, AND ANY DISTRIBUTOR UNDER THIS AGREEMENT WILL NOT BE LIABLE TO YOU FOR ACTUAL, DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE OR INCIDENTAL DAMAGES EVEN IF YOU GIVE NOTICE OF THE POSSIBILITY OF SUCH DAMAGE. 1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you discover a defect in this electronic work within 90 days of receiving it, you can receive a refund of the money (if any) you paid for it by sending a written explanation to the person you received the work from. If you received the work on a physical medium, you must return the medium with your written explanation. The person or entity that provided you with the defective work may elect to provide a replacement copy in lieu of a refund. If you received the work electronically, the person or entity providing it to you may choose to give you a second opportunity to receive the work electronically in lieu of a refund. If the second copy is also defective, you may demand a refund in writing without further opportunities to fix the problem. 1.F.4. Except for the limited right of replacement or refund set forth in paragraph 1.F.3, this work is provided to you ‘AS-IS’, WITH NO OTHER WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED,
  • 52. INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PURPOSE. 1.F.5. Some states do not allow disclaimers of certain implied warranties or the exclusion or limitation of certain types of damages. If any disclaimer or limitation set forth in this agreement violates the law of the state applicable to this agreement, the agreement shall be interpreted to make the maximum disclaimer or limitation permitted by the applicable state law. The invalidity or unenforceability of any provision of this agreement shall not void the remaining provisions. 1.F.6. INDEMNITY - You agree to indemnify and hold the Foundation, the trademark owner, any agent or employee of the Foundation, anyone providing copies of Project Gutenberg™ electronic works in accordance with this agreement, and any volunteers associated with the production, promotion and distribution of Project Gutenberg™ electronic works, harmless from all liability, costs and expenses, including legal fees, that arise directly or indirectly from any of the following which you do or cause to occur: (a) distribution of this or any Project Gutenberg™ work, (b) alteration, modification, or additions or deletions to any Project Gutenberg™ work, and (c) any Defect you cause. Section 2. Information about the Mission of Project Gutenberg™ Project Gutenberg™ is synonymous with the free distribution of electronic works in formats readable by the widest variety of computers including obsolete, old, middle-aged and new computers. It exists because of the efforts of hundreds of volunteers and donations from people in all walks of life. Volunteers and financial support to provide volunteers with the assistance they need are critical to reaching Project Gutenberg™’s goals and ensuring that the Project Gutenberg™ collection will
  • 53. 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