Instant download A comprehensive introduction to object oriented programming with Java 1st Edition C. Thomas Wu pdf all chapter
Instant download A comprehensive introduction to object oriented programming with Java 1st Edition C. Thomas Wu pdf all chapter
com
https://ebookname.com/product/a-comprehensive-introduction-
to-object-oriented-programming-with-java-1st-edition-c-
thomas-wu/
OR CLICK BUTTON
DOWNLOAD EBOOK
https://ebookname.com/product/object-oriented-programming-
with-c-4th-edition-e-balagurusamy/
https://ebookname.com/product/microsoft-visual-c-2010-an-
introduction-to-object-oriented-programming-4th-edition-joyce-
farrell/
https://ebookname.com/product/introduction-to-object-oriented-
programming-an-3rd-edition-timothy-budd/
https://ebookname.com/product/software-testing-with-visual-
studio-2010-microsoft-net-development-series-1st-edition-jeff-
levinson/
Learn Go with Pocket Sized Projects 1st Edition Aliénor
Latour
https://ebookname.com/product/learn-go-with-pocket-sized-
projects-1st-edition-alienor-latour/
https://ebookname.com/product/basic-and-advanced-regulatory-
control-system-design-and-application-2nd-ed-edition-harold-l-
wade/
https://ebookname.com/product/finite-size-effects-in-correlated-
electron-models-exact-results-andrei-a-zvyagin/
https://ebookname.com/product/heroes-of-the-bible-111th-edition-
jesse-thompson/
https://ebookname.com/product/a-pictorial-record-of-the-qing-
dynasty-old-manchu-capital-1st-edition-liaoning-provincial-
library/
We ll Always Have the Movies American Cinema during
World War II First Edition Mclaughlin
https://ebookname.com/product/we-ll-always-have-the-movies-
american-cinema-during-world-war-ii-first-edition-mclaughlin/
wu23399_fm.qxd 1/10/07 11:53 Page i
A Comprehensive Introduction
to Object-Oriented Programming
TM
with Java
C.Thomas Wu
Naval Postgraduate School
wu23399_fm.qxd 1/10/07 11:53 Page ii
Published by McGraw-Hill, a business unit of The McGraw-Hill Companies, Inc., 1221 Avenue of the Americas,
New York, NY 10020. Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. No part of this
publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system,
without the prior written consent of The McGraw-Hill Companies, Inc., including, but not limited to, in any network
or other electronic storage or transmission, or broadcast for distance learning.
Some ancillaries, including electronic and print components, may not be available to customers outside
the United States.
1 2 3 4 5 6 7 8 9 0 DOC/DOC 0 9 8 7
ISBN 978–0–07–352339–2
MHID 0–07–352339–9
Wu, C. Thomas.
A comprehensive introduction to object-oriented programming with Java / C. Thomas
Wu. – 1st ed.
p. cm.
ISBN 978–0–07–352339–2 — ISBN 0–07–352339–9
1. Object-oriented programming (Computer science) 2. Java (Computer program
language) I. Title.
QA76.64.W77 2008
005.117–dc22
2006048064
www.mhhe.com
wu23399_fm.qxd 1/10/07 11:53 Page iii
To my family
wu23399_fm.qxd 1/10/07 11:53 Page iv
wu23399_fm.qxd 1/10/07 11:53 Page v
Contents
Preface xiii
Key Differences from the Standard Edition xiii
Book Organization xiv
Hallmark Features of the Text xviii
v
wu23399_fm.qxd 1/10/07 11:53 Page vi
vi Contents
3 Numerical Data 81
3.1 Variables 82
3.2 Arithmetic Expressions 90
3.3 Constants 95
3.4 Displaying Numerical Values 97
3.5 Getting Numerical Input 103
3.6 The Math Class 109
3.7 Random Number Generation 113
3.8 The GregorianCalendar Class 115
3.9 Sample Development 120
3.10 Numerical Representation (Optional) 131
Contents vii
viii Contents
Contents ix
x Contents
Contents xi
xii Contents
Appendix A 1099
Appendix B 1107
Appendix C 1133
Appendix D 1155
Index 1163
wu23399_fm.qxd 1/10/07 11:53 Page xiii
Preface
xiv Preface
Book Organization
There are 21 chapters in this book, numbered from 0 to 20. The first 11 chapters
cover the core topics that provide the fundamentals of programming. Chapters 11 to
15 cover intermediate-level topics such as sorting, searching, recursion, inheritance,
polymorphism, and file I/O. And Chapters 16 to 20 cover topics related to data
structures. There are more than enough topics for one semester. After the first
11 chapters (Ch 0 to Ch 10), instructors can mix and match materials from Chapters 11
to 20 to suit their needs. We first show the dependency relationships among the
chapters and then provide a brief summary of each chapter.
Chapter Dependency
For the most part, chapters should be read in sequence, but some variations are
possible, especially with the optional chapters. Here’s a simplified dependency
graph:
0
1
4
5
6
7
8 9 10
*Note: Some examples use arrays,
11 12 13 14* 15 16 but the use of arrays is not an
integral part of the examples.
These examples can be modified
to those that do not use arrays.
17 18 Many topics from the early part
of the chapter can be introduced
19 20 as early as after Chapter 2.
wu23399_fm.qxd 1/10/07 11:54 Page xv
Preface xv
xvi Preface
and the clever (Euclid’s) solutions. We introduce the Formatter class (new to
Java 5.0) and show how the output can be aligned nicely. The optional last sec-
tion of the chapter introduces recursion as another technique for repetition.
The recursive version of a method that finds the greatest common divisor of
two integers is given.
• Chapter 7 is the second part of creating programmer-defined classes. We
introduce new topics related to the creation of programmer-defined classes
and also repeat some of the topics covered in Chapter 4 in more depth. The
key topics covered in this chapter are method overloading, the reserved
word this, class methods and variables, returning an object from a method,
and pass-by-value parameter passing. As in Chapter 4, we provide many
lucid illustrations to make these topics accessible to beginners. We use the
Fraction class to illustrate many of these topics, such as the use of this and
class methods. The complete definition of the Fraction class is presented in
this chapter.
• Chapter 8 teaches exception handling and assertions. The focus of this chap-
ter is the construction of reliable programs. We provide a detailed coverage of
exception handling in this chapter. We introduce an assertion and show how it
can be used to improve the reliability of finished products by catching logical
errors early in the development.
• Chapter 9 covers nonnumerical data types: characters and strings. Both the
String and StringBuffer classes are explained in the chapter. Another string
class named StringBuilder (new to Java 5.) is briefly explained in this chapter.
An important application of string processing is pattern matching. We describe
pattern matching and regular expression in this chapter. We introduce the
Pattern and Matcher classes and show how they are used in pattern matching.
• Chapter 10 teaches arrays. We cover arrays of primitive data types and of ob-
jects. An array is a reference data type in Java, and we show how arrays are
passed to methods. We describe how to process two-dimensional arrays and
explain that a two-dimensional array is really an array of arrays in Java. Lists
and maps are introduced as a more general and flexible way to maintain a col-
lection of data. The use of ArrayList and HashMap classes from the java.util
package is shown in the sample programs. Also, we show how the WordList
helper class used in Chapter 9 sample development program is implemented
with another map class called TreeMap.
• Chapter 11 presents searching and sorting algorithms. Both N2 and Nlog2N
sorting algorithms are covered. The mathematical analysis of searching and
sorting algorithms can be omitted depending on the students’ background.
• Chapter 12 explains the file I/O. Standard classes such as File and JFile-
Chooser are explained. We cover all types of file I/O, from a low-level byte
I/O to a high-level object I/O. We show how the file I/O techniques are used
to implement the helper classes—Dorm and FileManager—in Chapter 8 and 9
sample development programs. The use of the Scanner class for inputting data
from a textfile is also illustrated in this chapter.
wu23399_fm.qxd 1/10/07 11:54 Page xvii
Preface xvii
• Chapter 13 discusses inheritance and polymorphism and how to use them ef-
fectively in program design. The effect of inheritance for member accessibil-
ity and constructors is explained. We also explain the purpose of abstract
classes and abstract methods.
• Chapter 14 covers GUI and event-driven programming. Only the Swing-
based GUI components are covered in this chapter. We show how to use the
JOptionPane class for a very simple GUI-based input and output. GUI com-
ponents introduced in this chapter include JButton, JLabel, ImageIcon,
JTextField, JTextArea, and menu-related classes. We describe the effective use
of nested panels and layout managers. Handling of mouse events is described
and illustrated in the sample programs. Those who do not teach GUI can skip
this chapter altogether. Those who teach GUI can introduce the beginning part
of the chapter as early as after Chapter 2.
• Chapter 15 covers recursion. Because we want to show the examples where
the use of recursion really shines, we did not include any recursive algorithm
(other than those used for explanation purposes) that really should be written
nonrecursively.
• Chapter 16 covers contiguous and noncontiguous memory allocation schemes
and introduces the concept of linked lists. Ample examples are provided to
illustrate the manipulation of linked lists of primitive data types and linked
lists of objects. This chapter lays the necessary foundation for the students to
learn different techniques for implementing the abstract data types covered in
Chapters 18 through 20.
• Chapter 17 covers new Java 5.0 generics in detail. The chapter describes how
generic classes are defined and how the type safety is supported by generics.
A concrete example of using generics is shown by defining a simple linked list
with generic nodes.
• Chapter 18 introduces the concept of abstract data types (ADT) and covers
the List ADT. Key features of the List ADT are explained and two implemen-
tations using an array and a linked list are shown. The iterator pattern to tra-
verse the elements in the List ADT is introduced.
• Chapter 19 covers the Stack ADT. Key features of the Stack ADT are ex-
plained and two implementations using an array and a linked list are shown.
Sample applications that use stacks are described.
• Chapter 20 covers the Queue ADT. Key features of the Stack ADT are ex-
plained and two implementations using an array and a linked list are shown.
A special type of queue called a priority queue is also intoduced in this
chapter.
wu23399_fm.qxd 1/10/07 11:54 Page xviii
xviii Preface
Problem Solving
Problem Statement
We start our development with a problem statement. The problem statement for our
sample programs will be short, ranging from a sentence to a paragraph, but the problem
statement for complex and advanced applications may contain many pages. Here’s the
problem statement for this sample development exercise:
Write an application that asks for the user’s first, middle, and last names and
replies with the user’s initials.
Overall Plan
Our first task is to map out the overall plan for development. We will identify classes nec-
essary for the program and the steps we will follow to implement the program.We begin
with the outline of program logic. For a simple program such as this one, it is kind of obvi-
ous; but to practice the incremental development, let’s put down the outline of program
flow explicitly. We can express the program flow as having three tasks:
Preface xix
Object-Oriented Approach
We take the object-first approach to teaching object-oriented programming with emphasis
on proper object-oriented design.The concept of objects is clearly illustrated from the very
first sample program.
/*
File: Ch2Sample1.java
*/
import javax.swing.*;
class Ch2Sample1 {
JFrame myWindow;
myWindow.setSize(300, 200);
myWindow.setTitle("My First Java Program");
myWindow.setVisible(true);
}
}
Figure 8.8 Program diagrams for the user and administrative modules. Notice the same Dorm and
Resident classes are used in both programs. User and administrative modules will include one or more
classes (at least one is programmer-defined).
wu23399_fm.qxd 1/10/07 11:55 Page xx
xx Preface
Illustrative Diagrams
Illustrative diagrams are used to explain all key concepts of programming such as the
difference between object declaration and creation, the distinction between the primitive
data type and the reference data type, the call-by-value parameter passing, inheritance, and
many others.
number1 alan
number2 turing
number2 turing
:Professor
:Professor
add(1, “gnu”)
myList
0 1 2 3 4
After “cat” “gnu” “ape” “dog” “bee”
myList
0 1 2 3
Before “cat” “ape” “dog” “bee”
throws
add(5, “gnu”) <index-out-of-bounds-exception>
myList
0 1 2 3
“cat” “ape” “dog” “bee” No structural
After
change to the list
Preface xxi
Student Pedagogy
Design Guidelines
provide tips on good
Always define a constructor and initialize data members fully in the
constructor so an object will be created in a valid state. program design.
Things to Remember
boxes provide tips for List the catch blocks in the order of specialized to more general exception classes.
students to remember key At most one catch block is executed, and all other catch blocks are ignored.
concepts.
We didn’t write
because it is not necessary. The simplify method returns a Fraction object, and in
the calling program, all we need is a name we can use to refer to this returned
Fraction object. Don’t forget that the object name (variable) and the actual object
instance are two separate things.
Quick Check
1. What will be displayed on the console window when the following code is exercises at the end of
executed and the user enters abc123 and 14? the sections allow
Scanner scanner = new Scanner(System.in);
students to test their
try { comprehension of
int num1 = scanner.nextInt(); topics.
System.out.println("Input 1 accepted");
int num2 = scanner.nextInt();
System.out.println("Input 2 accepted");
} catch (InputMismatchException e) {
System.out.println("Invalid Entry");
}
wu23399_fm.qxd 1/10/07 11:55 Page xxii
xxii Preface
For Instructors
• Complete set of PowerPoints, including lecture notes and figures.
Preface xxiii
For Students
• Compiler How Tos provide tutorials on how to get up and running on the
most popular compilers to aid students in using IDEs.
• Interactive Quizzes allow students to test what they learn and get immediate
feedback.
• Source code for all example programs in the book.
• Answers to quick check exercises.
• Glossary of key terms.
• Recent News links relevant to computer science.
• Additional Topics such as more on swing and an introduction to data structures.
Acknowledgments
First, I would like to thank the following reviewers for their comments, suggestions,
and encouragement.
xxiv Preface
Reviewers
Ajith, Abraham, Oklahoma State University
Elizabeth Adams, James Madison University
David L. Atkins, University of Oregon
GianMario Besana, DePaul University
Robert P. Burton, Brigham Young University
Michael Buckley, State University of New York, Buffalo
Rama Chakrapani, Tennessee Technological University
Teresa Cole, Boise State University
James Cross, Auburn University
Priscilla Dodds, Georgia Perimeter College
Kossi Delali Edoh, Montclair State University
Christopher Eliot, University of Massachusetts-Amherst
Michael Floeser, Rochester Institute of Technology
Joanne Houlahan, John Hopkins University
Michael N. Huhns, University of South Carolina
Eliot Jacobson, University of California, Santa Barbara
Martin Kendall, Montgomery Community College
Mike Litman, Western Illinois University
Len Myers, California Polytechnic State University, San Luis Obispo
Jun Ni, University of Iowa
Robert Noonan, College of William and Mary
Jason S. O’Neal, Mississippi College
Hal Perkins, University of Washington
Gerald Ross, Lane Community College
William Shea, Kansas State University
Jason John Schwarz, North Carolina State University
Marge Skubic, University of Missouri, Columbia
Bill Sverdlik, Eastern Michigan University
Peter Stanchev, Kettering University
Krishnaprasad Thirunarayan, Wright State University
David Vineyard, Kettering University
Suzanne Westbrook, University of Arizona
Melissa Wiggins, Mississippi College
Zhiguang Xu, Valdosta State University.
The following reviewers have provided feedback on the chapters new to this
comprehensive edition:
Preface xxv
Personal Story
In September, 2001, I changed my name for personal reasons. Prof C. Thomas
Wu is now Prof Thomas W. Otani. To maintain continuity and not to confuse peo-
ple, we continue to publish the book under my former name. For those who
care to find out a little about my personal history can do so by visiting my web-
site (www.drcaffeine.com).
wu23399_fm.qxd 1/10/07 11:56 Page xxvi
wu23392_ch00.qxd 12/12/06 17:23 Page 1
0 O b j e c t i v e s
Introduction to Computers
and Programming
Languages
After you have read and studied this chapter, you should be able to
1
wu23392_ch00.qxd 12/12/06 17:23 Page 2
I n t r o d u c t i o n
One innovation of their machine was the use of binary numbers. (We discuss binary
numbers in Sec. 0.2.) At around the same time, Howard Aiken of Harvard University
was working on the Automatic Sequence-Controlled Calculator, known more com-
MARK I monly as MARK I, with support from IBM and the U.S. Navy. MARK I was very
similar to the Analytical Engine in design and was described as “Babbage’s dream
come true.”
MARK I was an electromechanical computer based on relays. Mechanical
relays were not fast enough, and MARK I was quickly replaced by machines based
ENIAC I on electronic vacuum tubes. The first completely electronic computer, ENIAC I
(Electronic Numerical Integrator And Calculator), was built at the University of
Pennsylvania under the supervision of John W. Mauchly and J. Presper Eckert.
Their work was influenced by the work of John Atanasoff.
ENIAC I was programmed laboriously by plugging wires into a control
panel that resembled an old telephone switchboard. Programming took an enor-
mous amount of the engineers’ time, and even making a simple change to a pro-
gram was a time-consuming effort. While programming activities were going on,
the expensive computer sat idle. To improve its productivity, John von Neumann
of Princeton University proposed storing programs in the computer’s memory.
stored program This stored program scheme not only improved computation speed but also al-
lowed far more flexible ways of writing programs. For example, because a pro-
gram is stored in the memory, the computer can change the program instructions
to alter the sequence of the execution, thereby making it possible to get different
results from a single program.
generations of We characterized these early computers with vacuum tubes as first-generation
computers computers. Second-generation computers, with transistors replacing the vacuum
tubes, started appearing in the late 1950s. Improvements in memory devices also
increased processing speed further. In the early 1960s, transistors were replaced by
integrated circuits, and third-generation computers emerged. A single integrated
circuit of this period incorporated hundreds of transistors and made the construction
of minicomputers possible. Minicomputers are small enough to be placed on desk-
tops in individual offices and labs. The early computers, on the other hand, were so
huge that they easily occupied the whole basement of a large building.
Advancement of integrated circuits was phenomenal. Large-scale integrated
circuits, commonly known as computer chips or silicon chips, packed the power
equivalent to thousands of transistors and made the notion of a “computer on a sin-
gle chip” a reality. With large-scale integrated circuits, microcomputers emerged in
the mid-1970s. The machines we call personal computers today are descendants of
the microcomputers of the 1970s. The computer chips used in today’s personal
computers pack the power equivalent to several millions of transistors. Personal
computers are fourth-generation computers.
Early microcomputers were isolated, stand-alone machines. The word per-
sonal describes a machine as a personal device intended to be used by an individual.
However, it did not take long to realize there was a need to share computer resources.
For example, early microcomputers required a dedicated printer. Wouldn’t it make
more sense to have many computers share a single printer? Wouldn’t it also make
sense to share data among computers, instead of duplicating the same data on
wu23392_ch00.qxd 12/12/06 17:23 Page 4
If you want to learn more about the history of computing, there is a wealth of information
available on the Web.You can start your exploration from
www.yahoo.com/Computers_and_Internet/History
For more information on the pioneers of computers, visit
en.wikipedia.org/wiki/category:Computer_pioneers
Binary Numbers
To understand the binary number system, let’s first review the decimal number sys-
tem in which we use 10 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. To represent a number in
the decimal system, we use a sequence of one or more of these digits. The value that
each digit in the sequence represents depends on its position. For example, consider
the numbers 234 and 324. The digit 2 in the first number represents 200, whereas
the digit 2 in the second number represents 20. A position in a sequence has a
value that is an integral power of 10. The following diagram illustrates how the
wu23392_ch00.qxd 12/12/06 17:23 Page 5
Output
Devices
RAM
Communication
CPU
Devices
Storage
Devices
Input
Devices
Monitor
Printer (output device)
(output device)
Main Unit (housing
CPU, RAM, storage
devices, and
communication
devices)
Keyboard Mouse
(input device) (input device)
••• • •••
1
104 103 102 101 100 10 102 103
Position Values
The value of a decimal number (represented as a sequence of digits) is the sum
of the digits, multiplied by their position values, as illustrated:
2 4 8 • 7
2 100 4 10 8 1 7 110
base-2 In the decimal number system, we have 10 symbols, and the position values
numbers are integral powers of 10. We say that 10 is the base or radix of the decimal number
system. The binary number system works the same as the decimal number system
binary number but uses 2 as its base. The binary number system has two digits (0 and 1) called bits,
and position values are integral powers of 2. The following diagram illustrates how
bits the values of positions are determined in the binary system:
Binary
Point
••• • •••
24 23 22 21 20 21 22 23
Position Values
1 0 1 • 1
22 21 20 21
binary-to- 1 22 0 21 1 20 1 21
decimal
1 4 0 2 1 1 1 12
conversion
4 0 1 12 5.5
The binary system is more suitable for computers than the decimal system be-
cause it is far easier to design an electrical device that can distinguish two states
(bits 0 and 1) than 10 states (digits 0 through 9). For example, we can represent 1 by
turning the switch on and 0 by turning the switch off. In a real computer, 0 is repre-
sented by electrical voltage below a certain level and 1 by electrical voltage at or
above this level.
When you pay closer attention to the on/off switch on computers and other
electronic devices, you should notice an icon like this
RAM
RAM Random access memory or RAM is a repository for both program instructions and
data manipulated by the program during execution. RAM is divided into cells,
byte with each cell having a unique address. Typically, each cell consists of 4 bytes (B),
and a single byte (1 B) in turn consists of 8 bits. Each bit, which can be either on
or off, represents a single binary digit. RAM is measured by the number of bytes
it contains. For example, 128 kilobytes (KB) of RAM contains 128 1024
131,072 B because 1 KB is equal to 210 1024 B. Notice that 1 K is not equal to
103, although 103 1000 is a close approximation to 210 1024. The first IBM
PC introduced in 1981 came with 16 KB of RAM, and the first Macintosh com-
puter introduced in 1984 came with 128 KB of RAM. In contrast, a typical PC
today has anywhere from 128 MB to 512 MB of RAM. Given that 1 MB is equal
to 1024 KB, we know that 256 MB means 256 1024 KB 262,144 KB
262,144 1024 B 268,435,456 B.
wu23392_ch00.qxd 12/12/06 17:23 Page 8
CPU
CPU The central processing unit or CPU is the brain of a computer. The CPU is the com-
ponent that executes program instructions by fetching an instruction (stored in
RAM), executing it, fetching the next instruction, executing it, and so on until it en-
register counters an instruction to stop. The CPU contains a small number of registers, which
are high-speed devices for storing data or instructions temporarily. The CPU also
contains the arithmetic-logic unit (ALU), which performs arithmetic operations such
as addition and subtraction and logical operations such as comparing two numbers.
clock speed CPUs are characterized by their clock speeds. For example, in the Intel
Pentium 200, the CPU has a clock speed of 200 megahertz (MHz). The hertz is a
unit of frequency equal to 1 cycle per second. A cycle is a period of time between
two on states or off states. So 200 MHz equals 200,000,000 cycles per second. The
fastest CPU for commercially available personal computers was around 200 MHz
in 1997 when the first edition of this textbook was published. But by the beginning
of 1998, many vendors started selling 300-MHz machines. And in a mere 6 months,
by the middle of 1998, the top-of-the-line personal computers were 400-MHz ma-
chines. As of this writing in late 2002, we see computers with 2.0-GHz (2000-MHz)
CPU being advertised and sold. The increase of the CPU speed in the last two
decades is truly astonishing. The clock speed of the Intel 8080, the CPU introduced
in 1974 that started the PC revolution, was a mere 2 MHz. In contrast, the clock
speed of the Intel Pentium 4 introduced in 2001 was 2 GHz (2000 MHz). Table 0.1
lists some of the Intel processors.
I/O Devices
I/O devices Input/output or I/O devices allow communication between the user and the CPU.
Input devices such as keyboards and mice are used to enter data, programs, and
commands in the CPU. Output devices such as monitors and printers are used to
display or print information. Other I/O devices include scanners, bar code readers,
magnetic strip readers, digital video cameras, and musical instrument digital inter-
face (MIDI) devices.
Storage Devices
Storage devices such as disk and tape drives are used to store data and programs. Sec-
nonvolatile and ondary storage devices are called nonvolatile memory, while RAM is called volatile
volatile memory. Volatile means the data stored in a device will be lost when the power to the
memory
device is turned off. Being nonvolatile and much cheaper than RAM, secondary stor-
age is an ideal medium for permanent storage of large volumes of data. A secondary
storage device cannot replace RAM, though, because secondary storage is far slower
in data access (getting data out and writing data in) compared to RAM.
The most common storage device today for personal computers is a disk
drive. There are two kinds of disks: hard and floppy (also known as diskettes). Hard
disks provide much faster performance and larger capacity, but are normally not re-
movable; that is, a single hard disk is permanently attached to a disk drive. Floppy
disks, on the other hand, are removable, but their performance is far slower and
their capacity far smaller than those of hard disks. As the standard floppy disks can
wu23392_ch00.qxd 12/12/06 17:23 Page 9
A table of Intel processors. For some CPUs, several types with different
Table 0.1 clock speeds are possible. In such case, only the fastest clock speed is
shown. For more information on Intel CPUs, visit http://www.intel.com.
Table CPU
Date
Introduced
Clock Speed
(MHz)
4004 11/15/71 0.108
8008 4/1/72 0.200
1970s 8080 4/1/74 2
8088 6/1/79 8
80286 2/1/82 12
1980s 80386SX 6/16/88 16
80486DX 4/10/89 25
Pentium 3/22/93 66
Pentium Pro 11/1/95 200
1990s Pentium II 5/7/97 300
Pentium II Xeon 6/29/98 400
Pentium III 10/25/99 733
store only up to approximately 1.44 MB, they are becoming less useful in today’s
world of multimegabyte image and sound files. They are fast becoming obsolete,
and hardly anybody uses them anymore. Removable storage media with much
higher capacity such as zip disks (capable of holding 100 to 250 MB of data) re-
placed floppy disks in late 1990s. Computer technology moves so quickly that zip
disks themselves are already becoming obsolete. The most common form of
portable storage medium today (2006) is a compact USB flash drive, whose capac-
ity ranges from 125 MB to 16 GB.
Hard disks can store a huge amount of data, typically ranging from 20 GB
(gigabyte; 1 GB 1024 MB) to 80 GB for a standard desktop PC in 2002. Portable
and removable hard disk drives, with performance and capacity that rival those of
nonremovable hard disks, are also available, but their use is not widespread.
Compact disks (CDs) are very popular today for storing massive amounts of
data, approximately 700 MB. Many software packages we buy today—computer
Other documents randomly have
different content
Päästyään mäen harjalle, näki hän hevosen syövän pienessä
heinäisessä laaksossa allaan. Eläin oli kirjava, epäsäännölliset
valkoiset läikät näkyivät oikeassa kyljessä, sä'ässä ja polvien
alapuolella. Nähdessään sen, veti Brannon suunsa tiukalle.
Yksi häiritsevä epätietoisuus oli taas hävinnyt. Jos Billy olisi vain
lähtenyt tallista tuoreen heinän hakuun, niin se ei olisi tullut
tännepäin, koska idässä päin oli heinää yltäkylläisesti ja vielä
lähempänä karjataloa ja siellä oli sitäpaitsi vettäkin.
Billy oli ollut suljettuna talliin useamman päivän, jotta sitä olisi voitu
hoitaa paremmin vatsahäiriön vuoksi. Carson, hevospuoskari, oli
hoitanut sitä erikoisen huolellisesti, sukien sitä joka päivä. Brannon
oli myös usein pistäytynyt katsomassa, miten sen parantuminen
edistyi.
Callahanin murha oli nyt Brannonille yhtä selvä, kuin jos se olisi
painettu paperille. Kannettuaan Callahanin ruumiin asuntoonsa, oli
Brannon tutkinut hänen asettaan ja huomannut, että yksi panos oli
ammuttu tyhjäksi. Koska hän oli tullut siihen johtopäätökseen, että
Josephine oli ampunut Callahanin, oli hän hämmästynyt tuota tyhjää
panosta ja hän päätteli lopuksi, että Callahan oli aikaisemmin
ampunut jotakin ja sitten huolimattomasti laiminlyönyt täyttää aseen
uudelleen.
Nyt oli selvää, että Les Artwell oli saanut tuon puuttuvan panoksen
ruumiiseensa, vaikka sen oli täytynyt tapahtua sangen kaukana
karjatalolta, sillä muutoin se varmasti olisi kuulunut. Senvuoksi oli
Artwellin myös täytynyt seurata Callahanin jälkiä ja ampua Starin
omistaja hänen kääntäessään selkänsä kuistille astuessaan.
Se tosiasia, että Artwell oli piiloutunut talliin, oli syynä siihen, ettei
Brannon, juostuaan kuistille heti laukauksen jälkeen, ollut kuullut
mitään kiireellistä kavion kapsetta, joka olisi ilmoittanut salakytän
pakenevan.
Ainoa hämärä seikka oli enää se, että Brannon oli löytänyt
satuloidun hevosen, jolla oli Lattimerin polttomerkki. Vaikka eihän
sekään asia ollut erikoisen hämmästyttävä, kun otti huomioon
satulan huonon kunnon, poikkinaiset ohjat ja nimikirjaimet
partasudissa, jonka Brannon oli löytänyt matkalaukussa. Artwell oli
tietenkin ratsastanut sillä hevosella, mutta oliko hän varastanut sen
Lattimerilta vai oliko Lattimer myynyt tai lainannut sen, siinä oli
kysymys. Se seikka, että Josephine oli vienyt Artwellin Lattimerin
karjatalolle, näytti todistavan, että heidän välillään vallitsi ystävyys ja
kaikenlainen ystävyys kunniallisenkin karjamiehen ja tunnetun
hevosvarkaan välillä oli epäilyttävä asia, joka vaati ankaraa
tutkimusta.
"Mikä hätänä?"
"Eilen aamuna. Tallin ovi oli selkosen selällään. Missä tapasit sen,
Brannon?"
Yhdeksästoista luku.
Vaikka Betty oli koettanut parastaan ollakseen entiseen tapaansa
ystävällinen Josephineä kohtaan, oli Josephine kuitenkin huomannut
jäykkyyttä hänen käytöksessään sen jälkeen kun Betty oli tullut
Brannonin asunnosta.
Mutta hän muisti, että kun hän oli kertonut Bettylle olleensa
Brannonin kanssa vain kahden karjatalolla sinä iltana, oli Betty
katsonut häneen terävästi ja että Betty vielä myöhemmin oli mennyt
Brannonin asuntoon. Josephine oli pitänyt häntä silmällä ja hän
muisti nyt, että Bettyn kylmyys häntä kohtaan oli alkanut sen jälkeen
kuin hän oli palannut Brannonin asunnosta.
Hän uskoi, että Brannon oli tehnyt juuri sen ja sen vuoksi mahtoi
hänen yrityksensä antaa Starin omistajan murhalle oikeutetun
leiman, näyttää Bettyn silmissä naurettavalta.
Betty oli puhunut Mrs Whitmanin pojasta ja koska Mrs Whitman oli
pieni, hoikka ja hento, oli Josephine otaksunut, että poika olisi
samanlainen.
"Minähän kerroin sinulle, että hän teki sen, Ben", vastasi Mrs
Whitman
Josephinen puolesta.
"En saa sitä päähäni, näen mä" sanoi hän, katsoen Josephineen,
"mutta jos kerran sanotte sen, niin sen luonnollisesti täytyy olla
totta." Hän kääntyi ovelle. "Minä vien hevosenne kauemmaksi",
lopetti hän, mennessään ulos.
"En", sanoi Josephine lyhyesti. "Se on, minä — minä luulen, että
kunnioitan häntä, luonnollisesti. Mutta hän on ylpeä ja käskevä."
Hän tunsi itsekin, että se epäonnistui. Ja hän tiesi, että hän oli
oikeutettu vaatimaan oikeudenmukaista kohtelua, vaikka Josephine
olikin hänen vieraansa. Koettaen sitten tukahduttaa suuttumustaan,
hymyili hän iloisesti Mrs Whitmanille ja lausui valittelunsa hänen
sairautensa johdosta.
"Olisit sanonut minulle, minne olit menossa, Jo", sanoi hän. "Silloin
en olisi ollut huolissani. Ehkäpä olisin tullut kanssasi. Sinähän olit
täällä koko yön?"
Kun Betty syöksyi ovesta ulos, otti Josephine pari askelta hänen
perässään, mutta pysähtyi ja jäi seisomaan jäykkänä, kalpeana ja
uhmailevana kuunnellen nopeasti poistuvaa kavion kapsetta.
Nyt se oli sanottu eikä kukaan ollut "viekotellut" sitä häneltä "ulos."
Hän oli kokonaan antautunut intohimoisen suuttumuksen valtaan,
joka koko aamun oli kasvanut hänessä sen kautta, että hän oli
alituisesti ajatellut Bettyn puolelta osakseen tullutta luuloteltua
huonoa kohtelua. Mutta hän oli varma siitä, että hän ei olisi sanonut
mitään, ellei hän olisi ollut puolihulluna siitä hermojännityksestä,