100% found this document useful (1 vote)
9 views

A Guide To Programming in Java Java 2 Platform Standard Edition 5 Beth Brown download

A Guide to Programming in Java provides a comprehensive introduction to Java programming, designed for students with no prior experience. The text emphasizes fundamental programming concepts, problem-solving skills, and proper coding style, supplemented by hands-on exercises and teacher resources. It covers various topics including applets, control structures, object-oriented development, and arrays, aiming to prepare students for further studies in IT and computer science.

Uploaded by

ihirjwht0326
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
9 views

A Guide To Programming in Java Java 2 Platform Standard Edition 5 Beth Brown download

A Guide to Programming in Java provides a comprehensive introduction to Java programming, designed for students with no prior experience. The text emphasizes fundamental programming concepts, problem-solving skills, and proper coding style, supplemented by hands-on exercises and teacher resources. It covers various topics including applets, control structures, object-oriented development, and arrays, aiming to prepare students for further studies in IT and computer science.

Uploaded by

ihirjwht0326
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 78

A Guide To Programming in Java Java 2 Platform

Standard Edition 5 Beth Brown pdf download

https://ebookgate.com/product/a-guide-to-programming-in-java-
java-2-platform-standard-edition-5-beth-brown/

Get Instant Ebook Downloads – Browse at https://ebookgate.com


Get Your Digital Files Instantly: PDF, ePub, MOBI and More
Quick Digital Downloads: PDF, ePub, MOBI and Other Formats

Java 2 micro edition Java in small things James White

https://ebookgate.com/product/java-2-micro-edition-java-in-small-
things-james-white/

Programming in Java 2nd edition Edition Choudhary

https://ebookgate.com/product/programming-in-java-2nd-edition-
edition-choudhary/

Java 2 A Beginner s Guide 2nd Edition Steven Holzner

https://ebookgate.com/product/java-2-a-beginner-s-guide-2nd-
edition-steven-holzner/

Java Programming 8th Edition Joyce Farrell

https://ebookgate.com/product/java-programming-8th-edition-joyce-
farrell/
Java Programming 6th Edition Joyce Farrell

https://ebookgate.com/product/java-programming-6th-edition-joyce-
farrell/

Google Web Toolkit GWT Java AJAX Programming A


Practical Guide to Google Web Toolkit for Creating AJAX
Applications with Java 1st Ed. Edition Prabhakar
Chaganti
https://ebookgate.com/product/google-web-toolkit-gwt-java-ajax-
programming-a-practical-guide-to-google-web-toolkit-for-creating-
ajax-applications-with-java-1st-ed-edition-prabhakar-chaganti/

Functional Programming in Java Harnessing the Power Of


Java 8 Lambda Expressions 1st Edition Venkat
Subramaniam

https://ebookgate.com/product/functional-programming-in-java-
harnessing-the-power-of-java-8-lambda-expressions-1st-edition-
venkat-subramaniam/

Component Development for the Java Platform 1st Edition


Stuart Dabbs Halloway

https://ebookgate.com/product/component-development-for-the-java-
platform-1st-edition-stuart-dabbs-halloway/

Pentaho Reporting 3 5 for Java Developers Gorman

https://ebookgate.com/product/pentaho-reporting-3-5-for-java-
developers-gorman/
JAVA

A GUIDE TO
PROGRAMMING IN
Java™ 2 Platform Standard Edition 5

Beth Brown
A Guide to Programming
in Java™
Java™ 2 Platform Standard Edition 5

Beth Brown
Copyright 2005
by

First Edition

ISBN 1-58003-071-8 (softcover)


ISBN 1-58003-072-6 (hardcover)
All rights reserved. No part of this work covered by the copyright may be reproduced or used
in any form or by any means—graphic, electronic, or mechanical, including photocopying,
recording, taping, or information storage and retrieval systems—without the written permission
of the publisher, with the exception of programs, which may be entered, stored, and executed
in a computer system, but not reprinted for publication or resold in any other form.

Printed in the United States of America

All orders including educational, Canadian, foreign,


FPO, and APO may be placed by contacting:
Lawrenceville Press, Inc.
P.O. Box 704
Pennington, NJ 08534-0704
(609) 737-1148
(609) 737-8564 fax

This text is available in hardcover and softcover editions.

16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1

The text is written and published by Lawrenceville Press, Inc. and is in no way
connected with the Sun® Corporation.
Sun®, Sun® Microsystems, and Java™ are trademarks or registered trademarks of
Sun Microsystems, Inc. in the United States and other countries.
Microsoft® Microsoft® Windows®, Visual Basic®, and Microsoft® Calculator are
either registered trademarks or trademarks of Microsoft Corporation in the United
States and/or other countries. Screen Shots and Icons reprinted with permission
from Microsoft® Corporation.
Mac OS® and Tiger™ are registered trademarks of Apple Computer, Inc. in the
United States and other countries.
ExamView is a registered trademark of FSCreations, Inc.
“JUNE BUGS” poem by Avis Harley used with permission from Boyds Mills Press.
Names of all other products mentioned herein are used for identification purposes
only and may be trademarks of their respective owners.
Preface

W e have strived to make this the clearest and most comprehensive


Java text available. Our primary objective in this text is to present mate-
rial in clear language with easy to follow examples. To meet this objective,
we use our teaching experiences as well as the feedback, comments, and
suggestions from other experienced instructors to determine how best to
present programming concepts.
For the best classroom experience for both the student and the instructor,
our comprehensive text book includes hands-on reviews, critical-thinking
questions, and exercises of varying difficulty levels. Additionally, our
Teacher Resource Materials correlate directly to the text book and offer
teaching hints for explaining difficult concepts, additional lessons and
exercises, and a comprehensive question bank for creating tests, quizzes,
and reviews. The Teacher Resource Materials include the applications,
Case Studies, and vocabulary from the text book, as well as answers to
all the reviews and exercises.
It is our belief that learning to program offers the student an invaluable
opportunity to develop problem-solving skills. The process of defining a
problem, breaking it down into a series of smaller problems, and finally
writing an application to solve it exercises a student’s logical abilities.
Additionally, the student is made aware of the capabilities and limita-
tions of a computer and soon realizes that the programmer—the human
element—is more important than the machine.
A Guide to Programming in Java is written for a one-term or two-term
course. No previous programming experience is required or assumed. It
is our goal that this text provide students the best possible introduction
to programming using Java and to prepare them for further study in the
IT/programming/computer science field.

Preface iii
Design and Features
Programming Concepts This text emphasizes the fundamental concepts
of programming so that this knowledge can be applied to other program-
ming languages.
Problem Solving From the very beginning, students are taught to imple-
ment programming solutions with proper algorithm design and code
conventions.
Programming Style Throughout the text, proper programming style
is emphasized so that students can make their applications easy to read,
modify, and debug.
Demonstration Applications and Runs Many demonstration applica-
tions are included, complete with sample runs, so that students are shown
both proper programming techniques and the output actually produced
by an application.
Reviews Numerous reviews are presented throughout each chapter to
provide immediate reinforcement of newly learned concepts. Solutions to
the reviews are included on the Teacher Resource Materials CD.
Case Studies Most chapters end by stating a problem, developing an
appropriate algorithm, and then implementing the solution. The process
of specification, design, implementation, and debugging and testing is
clearly outlined.
Chapter Summaries Each chapter ends by summarizing the concepts
and statements covered in the chapter.
Vocabulary Sections Each chapter contains a vocabulary section that
defines new terms. A separate section lists Java keywords, statements,
and classes.
Critical Thinking Written response questions that require critical think-
ing from the student are included at the end of each chapter.
Exercises Each chapter includes a large set of exercises of varying diffi-
culty, making them appropriate for students with a range of abilities. Most
exercises include a demonstration run to help make clear what output is
expected from the student’s application. Exercises based on previous work
are marked with a ö symbol. Answers to the exercises are included on
the Teacher Resource Materials CD.
Indexes In addition to a standard index, an index of the applications
presented in the text is also included.
Appendix A chart of Unicode symbols is included.
Online Resources Materials that complement and extend this text are free
for download and distribution in your class. Information about various
Java compilers is available. Supplemental chapters cover operating systems,
personal finances, introduction to computers, and keyboarding skills are
also provided. Students can download all the files needed to complete the
reviews and exercises from www.lpdatafiles.com.

iv A Guide to Programming in Java


Teacher Resource Materials
Our Teacher Resource Materials correlate directly to the text book and
provide all the additional materials required to offer students an excellent
computer applications course. The Teacher Resource Materials feature:
• START_HERE.htm Help files and a guide for using the text and
resource materials.
• Lesson Plans Lessons in PDF format keyed to the chapters in the
text. Each lesson includes assignments, teaching notes, worksheets,
and additional topics.
• Tutorials Flash movie files that provide animations to illustrate
searching and sorting concepts. Each movie is keyed to the text.
• PowerPoint Presentations Topics keyed to the text are in
PowerPoint files for presentation.
• Vocabulary Word files of the vocabulary presented in the text.
• Rubrics Rubrics keyed to exercises in the text for assessment.
• Worksheets Programming assignments that supplement the exer-
cises in the text provide additional reinforcement of concepts.
• Critical Thinking Answers Answers for the critical thinking
questions presented in the text.
• Data files All the files the student needs to complete the reviews
and exercises in the text, as well as the files needed to complete
the worksheets and tests.
• ExamView® Software Question banks keyed to the text and the
popular ExamView® software are included to create tests, quizzes,
and additional assessment materials.
• Answer files Answers to the reviews, exercises, worksheets, and
tests.

Acknowledgments
Special thanks to the many instructors who used this text in their
classroom as it was being written. I would especially like to thank the
following instructors for their many comments and suggestions:
Paul Massey Hanna-Westside Extension Campus
Edward Sapienza Peabody Veterans Memorial High School
Timothy Strohm Churchville-Chili Senior High School
Jackie Kyger Marine Military Academy
Jan Marrelli, a Lawrenceville Press author and editor, has contributed
much to this text. She has used this text as it was being written in her
classroom. The many comments and suggestions from her and her stu-
dents have helped to make this text so clearly written. Jan, an experienced
instructor, has also written many of the critical thinking questions, exer-
cises, and reviews.

Preface v
Elaine Malfas, senior technical editor at Lawrenceville Press, has pro-
duced the format and layout for this text. The many illustrations have been
created by Elaine as well.
Thanks also to Joseph Dupree in our Customer Relations Department
for some of the original drawings included in this text.
The success of this and all of our texts is due to the efforts of Heidi Crane,
Vice President of Marketing at Lawrenceville Press. Joseph Dupree and
Christina Albanesius run our Customer Relations Department and handle
the thousands of orders we receive in a friendly and efficient manner.
Michael Porter is responsible for the excellent service Lawrenceville Press
offers in the shipping of orders.

About the Author


Beth A. Brown, a Computer Science graduate of Florida Atlantic
University, is director of development at Lawrenceville Press where she
has coauthored a number of programming and applications texts and
their accompanying Teacher Resource Materials. She has taught computer
applications and programming at the high school level.

vi A Guide to Programming in Java


Chapter Expectations

Chapter 1 – An Introduction to Chapter 3 – Introducing Java


Computers After completing Chapter 3, students
After completing Chapter 1, students will be able to:
will be able to: 1. Define terminology associated with object-
1. Compare and contrast various input, output, oriented programming.
and storage devices. 2. Explain why Java is a widely used
2. Identify hardware components and explain programming language.
their function. 3. Create Java applications.
3. Demonstrate knowledge of operating systems. 4. Describe the process involved in executing a
4. Discuss different computer classifications and Java application.
compatibility issues. 5. Display and format program output.
5. Differentiate among the levels of programming 6. Annotate code properly with comments,
languages. formatting, and indentation.
6. Describe communication and networking 7. Explain the importance of using code
components. conventions.
7. Understand the binary number system. 8. Demonstrate algorithm design as a problem-
8. Describe how data is stored in memory and in solving strategy.
files. 9. Use visual organizers to design solutions.
9. Use Internet services to access information and
share resources. Chapter 4 – Variables and Constants
10. Demonstrate proper etiquette and knowledge After completing Chapter 4, students
of acceptable use policies when using a will be able to:
network. 1. Declare and initialize variables and constants
11. Discuss social and ethical issues associated using the appropriate data type.
with computer use. 2. Choose legal identifiers that follow good
programming style.
Chapter 2 – Applets and Web 3. Differentiate between primitive and abstract
Programming data types.
After completing Chapter 2, students 4. Explain how to access Java packages.
will be able to: 5. Demonstrate how to read data from an input
1. Define terminology associated with the World stream.
Wide Web. 6. Write numeric expressions.
2. Discuss the impact of programming on the 7. Apply type casting.
World Wide Web community. 8. Format numeric output.
3. Create HTML documents. 9. Identify Java keywords.
4. Explain how a web browser interprets an 10. Differentiate between syntax and logic errors.
HTML document. 11. Understand run-time exceptions.
5. Use JavaScript to demonstrate how scripts can 12. Read and understand a problem description,
enhance a website. purpose, and goals.
6. Create simple Java applets.
7. Specify custom values for a Java applet that has
been placed in an HTML document.
8. Apply a style sheet to an HTML document.

Preface vii
Chapter 5 – Conditional Control Chapter 8 – Classes and Object-
Structures Oriented Development
After completing Chapter 5, students After completing Chapter 8, students
will be able to: will be able to:
1. Demonstrate the use of decision structures to 1. Understand and instantiate objects.
control the flow of a program. 2. Design and implement a class.
2. Describe how a roundoff error can occur. 3. Apply functional decomposition.
3. Generate random numbers. 4. Apply appropriate naming conventions to a
4. Write compound Boolean expressions. class.
5. Access methods in the Math class. 5. Explain the difference between accessor,
6. Modify existing code. modifier, and helper methods.
7. Develop code with correct and efficient use of 6. Write constructors.
conditional control structures. 7. Compare and contrast instance and class
8. Select appropriate test data. members.
9. Create and modify solutions to problems. 8. Understand class specifications and the
relationships among the classes.
Chapter 6 – Loop Structures and 9. Understand and implement a given class
hierarchy.
Strings 10. Apply encapsulation.
After completing Chapter 6, students
11. Identify reusable code from existing code.
will be able to:
1. Demonstrate the use of repetition control
structures. Chapter 9 – Inheritance and
2. Explain how infinite loops can occur. Polymorphism
3. Differentiate between counters and After completing Chapter 9, students
accumulators. will be able to:
4. Use various tools and techniques to debug an 1. Extend a class using inheritance.
application. 2. Explain an is-a relationship.
5. Manipulate and compare strings using the 3. Implement a subclass.
String class and its methods. 4. Define and demonstrate polymorphism.
6. Develop code with correct and efficient use of 5. Understand abstract classes.
repetitive control structures. 6. Declare and implement an interface.
7. Apply problem solving strategies. 7. Extend existing code using inheritance.

Chapter 7 – Chapter Methods Chapter 10 – Arrays


After completing Chapter 7, students After completing Chapter 10, students
will be able to: will be able to:
1. Use top-down development and procedural 1. Describe types of problems that benefit from
abstraction to develop problem solutions. the use of arrays.
2. Write methods. 2. Create one and two dimensional arrays.
3. Use method parameters. 3. Include array parameters in a method
4. Demonstrate the use of method overloading. declaration.
5. Return values from a method. 4. Understand how to implement arrays with
6. Write appropriate method documentation, meaningful indexes.
including pre- and post-conditions. 5. Apply offset array indexes.
7. Identify boundary cases and generate 6. Manipulate characters in a string.
appropriate test data. 7. Understand the digital code, Unicode.
8. Describe code conventions that apply to 8. Apply search algorithms to an array.
methods. 9. Use methods in the ArrayList class.
10. Demonstrate the use of the Wrapper classes.

viii A Guide to Programming in Java


Chapter 11 – GUIS and Event-Driven Chapter 14 – Data Structures
Programming After completing Chapter 14, students
After completing Chapter 11, students will be able to:
will be able to: 1. Explain how data structures, such as stacks
1. Design graphical user interfaces. and queues, can be used to organize data.
2. Use component classes in the Java swing 2. Use and implement well known data
package. structures.
3. Create event-driven applications. 3. Describe standard operations associated with
data structures.
4. Control the layout of an interface using layout
managers. 4. Choose appropriate data structures.
5. Use text fields and combo boxes to obtain user 5. Differentiate between a LIFO and FIFO
input. structure.
6. Apply color and add images to an interface.

Chapter 12 – Files and Exception


Handling
After completing Chapter 12, students
will be able to:
1. Use the File class to create objects that
represent a file.
2. Write exception handlers.
3. Understand file streams.
4. Read the contents of an existing file.
5. Process numeric data.
6. Create an output file stream.
7. Explain the object serialization and
deserialization processes.

Chapter 13 – Recursion and


Advanced Algorithms
After completing Chapter 13, students
will be able to:
1. Implement the selection sort algorithms.
2. Sort objects using the Comparable interface.
3. Implement the insertion sort algorithm.
4. Define and demonstrate recursion.
5. Implement the mergesort algorithm.
6. Implement the binary search algorithm.
7. Explain the recursive technique, depth-first
searching.
8. Analyze algorithms for efficiency.
9. Design and document sequential search
algorithms.

Preface ix
x A Guide to Programming in Java
Table of Contents

Chapter 1 – An Introduction to Chapter 2 – Applets and Web


Computers Programming
Desktop Computing .................................................1 The World Wide Web.............................................. 35
Operating Systems and Environment ....................2 HTML ...................................................................... 36
Mobile Computing ....................................................4 Creating an HTML Document .............................. 37
Programming Languages ........................................5 Review: hello_world.htm .................................. 38
Networks .................................................................... 6 Review: Computer Viruses Website –
Number Systems .......................................................9 part 1 of 6 ............................................................. 38
Storing Data in Memory ........................................ 10 JavaScript .................................................................. 38
What is a File? ......................................................... 11 Review: welcome.htm........................................ 39
Storage Devices........................................................ 12 Review: Computer Viruses Website –
Intranet, Extranet, Internet .................................... 13 part 2 of 6 ............................................................. 39
Telecommunications ............................................... 14 Using Scripts to Enhance a Website ..................... 40
Internet Services: Web, E-mail, and Review: Computer Viruses Website –
Mailing Lists ............................................................ 15 part 3 of 6 ............................................................. 41
Finding Information on the Web and Review: System Check – part 1 of 2 ................. 41
Downloading Files .................................................. 16 Java Applets ............................................................. 41
Internet Privacy Issues ........................................... 18 Creating Java Applets ............................................. 41
Internet Acceptable Use Policy ............................. 19 Drawing Shapes and Adding Color .....................43
The Social and Ethical Implications of Review: Hot Air Balloon ...................................44
Computer Use .......................................................... 19 Placing an Applet in an HTML Document ........44
Protecting Computer Software and Data ............ 20 Applet Parameters ..................................................44
The Ethical Responsibilities of an IT Review: System Check – part 2 of 2 ................. 45
Professional ..............................................................22 HTML Tags .............................................................. 45
Chapter Summary ..................................................22 Review: Computer Viruses Website –
Vocabulary ............................................................... 25 part 4 of 6 ............................................................. 47
Review Questions ................................................... 29 Hyperlinks, Tables, and Images ............................ 47
Exercises ................................................................... 32 Review: Computer Viruses Website –
part 5 of 6 ............................................................. 49
Style Sheets .............................................................. 49
Review: Computer Viruses Website –
part 6 of 6 ............................................................. 51
Chapter Summary .................................................. 51
Vocabulary ............................................................... 53
HTML Tags ..............................................................54
Critical Thinking ..................................................... 55
Exercises ................................................................... 56

Table of Contents xi
Chapter 3 – Introducing Java Chapter 5 – Conditional Control
Why Program in Java? ............................................ 59 Structures
Objects, Classes, and Packages ............................. 59
The if Statement ..................................................... 105
A Java Application .................................................. 61
Roundoff Error ...................................................... 106
Executing a Java Application ................................. 62
Review: SurfsUp – part 1 of 3 ......................... 106
Review: Greeting................................................ 62
The if-else Statement............................................. 106
Displaying Output ..................................................63
Review: SurfsUp – part 2 of 3 ......................... 107
Review: AboutMe – part 1 of 2 .........................64
Review: CircleCircumference – part 2 of 2... 107
Formatting Output..................................................64
Nested Statements ................................................. 107
Review: AboutMe – part 2 of 2 .........................65
Review: Stages .................................................. 107
Code Conventions ...................................................65
The if-else if Statement ......................................... 108
Algorithm Design ................................................... 66
Review: SurfsUp – part 3 of 3 ......................... 108
Chapter Summary .................................................. 67
Review: Discriminant...................................... 108
Vocabulary ............................................................... 69
The switch Statement............................................ 109
Java ............................................................................ 70
Review: Hurricane ........................................... 110
Critical Thinking ..................................................... 71
Generating Random Numbers ............................ 110
Exercises ................................................................... 72
Review: RandomNum ..................................... 111
Compound Boolean Expressions ........................ 112
Review: Delivery .............................................. 113
Chapter 4 – Variables and The Math Class ...................................................... 113
Review: PerfectSquare ..................................... 114
Constants Chapter 5 Case Study ........................................... 114
Declaring Variables.................................................77 Review: RPS – part 1 of 2 ................................ 118
Using Variables ........................................................ 78 Review: RPS – part 2 of 2 ................................ 118
Review: RectanglePerimeter............................. 79 Chapter Summary ................................................ 119
Primitive Data Types .............................................. 79 Vocabulary ............................................................. 120
Review: Distance – part 1 of 2 .......................... 79 Java .......................................................................... 121
Abstract Data Types ................................................80 Critical Thinking ................................................... 122
Java Packages ...........................................................80 Exercises ................................................................. 123
Obtaining a Value from the User .......................... 81
Review: Distance – part 2 of 2 .......................... 82
Numeric Expressions..............................................83
Review: Digits.....................................................84
Chapter 6 – Loop Structures and
Type Casting ............................................................84 Strings
Review: GradeAvg – part 1 of 2 .......................85
The while Statement ............................................. 131
Review: TempConverter ....................................85
The do-while Statement ....................................... 131
Formatting Numeric Output ................................. 86
Infinite Loops ........................................................ 132
Assignment Operators ........................................... 86
Review: Prompter ............................................ 133
Review: GradeAvg – part 2 of 2 ....................... 87
Counters and Accumulators................................ 133
Using Named Constants ........................................ 87
Review: Evens ................................................... 134
Identifiers and Keywords ...................................... 88
Review: NumbersSum .................................... 134
Review: CircleCircumference – part 1 of 2..... 88
Review: PercentPassing ................................... 134
Programming Errors .............................................. 88
The for Statement .................................................. 135
Chapter 4 Case Study .............................................90
Review: Factorial .............................................. 136
Chapter Summary .................................................. 93
Review: OddSum ............................................. 136
Vocabulary ............................................................... 95
Debugging Techniques ........................................ 136
Java ............................................................................ 96
Review: Variable Trace .................................... 137
Critical Thinking ..................................................... 97
The String Class .................................................... 138
Exercises ................................................................... 99
Review: AccountSetup .................................... 139
Comparing Strings................................................ 140
Review: FormalGreeting ................................. 141

xii Table of Contents


Chapter 6 Case Study ........................................... 141 Chapter 8 Case Study ........................................... 196
Review: WordGuess ......................................... 146 Review: RPS2 – part 1 of 2 .............................. 202
Chapter Summary ................................................ 146 Review: RPS2 – part 2 of 2 .............................. 202
Vocabulary ............................................................. 148 Chapter Summary ................................................ 202
Java .......................................................................... 148 Vocabulary ............................................................. 204
Critical Thinking ................................................... 149 Java .......................................................................... 205
Exercises ................................................................. 150 Critical Thinking ................................................... 206
Exercises ................................................................. 208

Chapter 7 – Methods
Program Development Using Methods ............. 157
Chapter 9 – Inheritance and
Writing Methods ................................................... 159 Polymorphism
Review: TimeConverter................................... 160
Extending a Class .................................................. 213
Method Parameters............................................... 160
Implementing a Subclass ..................................... 214
Review: SpanishNumbers .............................. 161
Review: Puck – part 1 of 2 ............................... 216
Review: DisplayBox – part 1 of 2 ................... 162
Polymorphism ....................................................... 217
Method Overloading ............................................ 162
Review: Music – part 1 of 2 ............................. 221
Review: DisplayBox – part 2 of 2 ................... 163
Abstract Classes ....................................................222
The return Statement ............................................ 163
Review: Music – part 2 of 2 .............................225
Review: Exponentiation .................................. 164
Interfaces ................................................................225
Documenting Methods ........................................ 164
Review: Disk ..................................................... 227
Review ............................................................... 165
Review: Puck – part 2 of 2 ............................... 227
Chapter 7 Case Study ........................................... 165
Review: Rectangle – part 4 of 4 ...................... 227
Review: GradeConverter ................................. 171
Review: Rectangle – part 4 of 5 ...................... 227
Chapter Summary ................................................ 171
Chapter 9 Case Study ........................................... 227
Vocabulary ............................................................. 173
Review: SalesCenter.........................................234
Java .......................................................................... 173
Chapter Summary ................................................234
Critical Thinking ................................................... 174
Vocabulary ............................................................. 236
Exercises ................................................................. 175
Java .......................................................................... 236
Critical Thinking ................................................... 237
Exercises ................................................................. 238
Chapter 8 – Classes and Object-
Oriented Development
What is an Object? ................................................ 179
Chapter 10 – Arrays
Designing and Writing a Class ........................... 180 Declaring Arrays ................................................... 239
Review: Circle – part 1 of 4 ............................. 182 Using Arrays .......................................................... 240
Review: Coin – part 1 of 2 ............................... 182 Review: StudentRoster .................................... 241
Writing Constructors ............................................ 183 Review: Squares ............................................... 241
Review: Circle – part 2 of 4 ............................. 184 Review: Reverse ............................................... 241
Review: Rectangle – part 1 of 5 ...................... 184 Array Parameters .................................................. 241
Instance and Class Members............................... 184 Arrays with Meaningful Indexes ....................... 242
Review: Circle – part 3 of 4 ............................. 185 Review: DiceRolls – part 1 of 2 ....................... 243
Review: Rectangle – part 2 of 5 ...................... 185 Review: DiceRolls – part 2 of 2 ....................... 243
The Object Class .................................................... 185 Review: NumberCounts.................................. 243
Review: Circle – part 4 of 4 ............................. 187 Characters and Arrays ......................................... 244
Review: Rectangle – part 3 of 5 ...................... 187 Review: CountLetters ...................................... 246
Review: Coin – part 2 of 2 ............................... 187 Review: NameBackwards ............................... 246
Classes Using Classes ........................................... 187 Searching an Array ............................................... 246
Review: Bank .................................................... 191 Review: FindName .......................................... 247
Object-Oriented Development ............................ 191 Two-Dimensional Arrays ..................................... 247
Review: Carnival .............................................. 195 The ArrayList Class .............................................. 252

Table of Contents xiii


Wrapper Classes .................................................... 253 Processing Numeric Data .................................... 316
Review: HighestGrade .................................... 255 Review: Stats – part 1 of 2 ............................... 317
Chapter 10 Case Study ......................................... 255 The FileWriter and BufferedWriter Classes ...... 317
Review: LocalBank .......................................... 264 Review: Stats – part 2 of 2 ............................... 319
Chapter Summary ................................................ 264 Object Serialization ............................................... 319
Vocabulary ............................................................. 265 Review: Roster .................................................. 322
Java .......................................................................... 265 Chapter 12 Case Study ......................................... 323
Critical Thinking ................................................... 266 Review: LocalBank2 ........................................ 328
Exercises ................................................................. 267 Chapter Summary ................................................ 329
Vocabulary .............................................................330
Java ..........................................................................330
Critical Thinking ................................................... 331
Chapter 11 – GUIs and Exercises ................................................................. 332
Event-Driven Programming
What is a GUI? ....................................................... 275
The Swing Package ............................................... 275 Chapter 13 – Recursion and
Review: Name – part 1 of 2 ............................. 278
The JButton Class .................................................. 278
Advanced Algorithms
Handling Events.................................................... 279 Selection Sort ......................................................... 337
Review: Name – part 2 of 2 ............................. 281 Sorting Objects ...................................................... 339
Review: NumClicks ......................................... 281 Review: ArrayListSort ..................................... 341
Controlling Layout ................................................ 281 Insertion Sort ......................................................... 341
Review: Sunflower ...........................................284 Review: ObjectsInsertionSort .........................343
Review: Riddle..................................................284 Recursion ................................................................343
Getting Input from the User ................................ 285 Review: RecursiveFactorial.............................345
Review: DivisibleBy3 ....................................... 287 Mergesort ...............................................................345
Combo Boxes ......................................................... 288 Review: ObjectsMergesort ..............................348
Review: MetricConversion.............................. 290 Binary Search ......................................................... 349
Changing Colors ................................................... 291 Review: SearchLocations ................................ 351
Adding Images ...................................................... 292 Review: ObjectsBinarySearch ........................ 352
Review: Roll ...................................................... 294 Review: BinarySearch2 ................................... 352
Using Nested Classes to Handle Events ............ 295 Depth-First Searching .......................................... 352
Chapter 11 Case Study ......................................... 298 Review: DetectColonies – part 1 of 3............. 356
Review: BreakAPlate .......................................303 Review: DetectColonies – part 2 of 3............. 356
Chapter Summary ................................................304 Review: DetectColonies – part 3 of 3............. 356
Vocabulary .............................................................305 Algorithm Analysis .............................................. 356
Java ..........................................................................306 Chapter Summary ................................................ 357
Critical Thinking ................................................... 307 Vocabulary ............................................................. 358
Exercises .................................................................309 Java .......................................................................... 358
Critical Thinking ................................................... 359
Exercises ................................................................. 361

Chapter 12 – Files and Exception


Handling Chapter 14 – Data Structures
What is a File? ........................................................ 311
The Stack Data Structure ..................................... 365
The File Classes ..................................................... 311
The Stack Class ...................................................... 366
Review: MyFile – part 1 of 2 ........................... 312
Review: Stack2 .................................................. 368
Handling Exceptions ............................................ 312
Review: Stack3 .................................................. 369
Review: MyFile – part 2 of 2 ........................... 313
The Queue Data Structure ................................... 369
The File Streams .................................................... 313
The Queue Class ................................................... 370
The FileReader and BufferedReader Classes .... 314
Review: Queue2................................................ 372
Review: Assignment ........................................ 315
Review: Queue3................................................ 372

xiv Table of Contents


The Linked List Data Structure .......................... 373
The LinkedList Class ............................................ 374
Review: LinkedList – part 1 of 3 .................... 376
Review: LinkedList – part 2 of 3 .................... 376
Review: LinkedList – part 3 of 3 .................... 376
Chapter Summary ................................................ 377
Vocabulary ............................................................. 377
Critical Thinking ................................................... 378
Exercises ................................................................. 379

Appendix A – Unicode
Unicode ................................................................... 381

Index
Index ....................................................................... 383

Table of Contents xv
xvi Table of Contents
Chapter 1
An Introduction to Computers

T his chapter discusses current computing technologies, networks, the


Internet, and the World Wide Web. Issues related to computers, including
privacy, viruses, and copyright are also discussed.

e
Desktop Computing

pl
TIP Desktop computers are
referred to as either PCs or
MACS.
A desktop computer and its components are designed to fit on or under
a desk:

�������
���������
���������������
����������
�������
m
��������
�����

• The physical components of the computer, such as the monitor and


sa

Scanner system unit, are called hardware.


A scanner is an input device • Data and instructions are entered into the computer using input
that uses a laser to create a devices, such as a keyboard, mouse, scanner, microphone, digital
digital image from artwork camera, CD-RW/DVD drive, and disk drive.
such as photos and drawings.
The digitized image can then • A PC becomes much more versatile when peripheral devices, such as
be incorporated into an elec- printers and scanners, are added. A peripheral device is attached
tronic document. to a port on the computer. There are different types of ports, such
as serial, parallel, FireWire, USB, and Bluetooth ports.
• Computers process data into meaningful, useful information.
Processed data is conveyed using output devices. Monitors and
Printers printers display data, CD-RWs, disk drives, and memory keys store
data, and speakers communicate audio output.
A laser printer uses a laser and
toner to generate characters
and graphics on paper. An ink The base unit also contains the motherboard, which is the main circuit
jet printer uses an ink cartridge board. The motherboard contains several components:
to place very small dots of ink
onto paper to create characters
• Expansion boards are circuit boards that connect to the motherboard
and graphics. to add functionality to the computer. Examples include sound
cards and video adapters.

Chapter 1 An Introduction to Computers 1


• The CPU (Central Processing Unit) or processor processes data
Real-time Clock and controls the flow of data between the computer’s other units.
Within the CPU is the ALU (Arithmetic Logic Unit), which can
A battery chip called a real- perform arithmetic and logic operations. It can also make com-
time clock keeps track of the
parisons, which is the basis of the computer’s decision-making
date and time in a computer
even when the computer is power. The ALU is so fast that the time needed to carry out a single
off. addition is measured in nanoseconds (billionths of a second). The
speed at which a CPU can execute instructions is determined by
the computer’s clock rate. The clock rate is measured in megahertz
(MHz, million of cycles per second) or gigahertz (GHz, billion of
cycles per second).
CPU Manufacturers • A bus is a set of circuits that connect the CPU to other components.
Intel and AMD are two proces- The data bus transfers data between the CPU, memory, and other
sor manufacturers. Processors hardware devices on the motherboard. The address bus carries
are identified by a model name memory addresses that indicate where the data is located and
or number, such as Pentium® where the data should go. A control bus carries control signals. All
4, Itanium® 2, and Opteron™. data flows through the CPU:

e
The Intel Pentium 4 (P4) CPU
has a clock rate of 3.06 GHz.
The AMD Opteron CPU has a ����� ������ ������
clock rate of 2.4 GHz. These
CPUs contain more than 40
pl
million transistors on a single
chip.
���

• Memory in the form of integrated circuits (ICs) stores data


electronically. ROM (Read Only Memory) contains the most basic
operating instructions for the computer. The data in ROM is a
m
permanent part of the computer and cannot be changed. RAM
Integrated Circuits (Random Access Memory), also called primary or main memory,
Integrated circuits, also called is memory where data and instructions are stored temporarily.
chips, are created from silicon Data stored in RAM can be written to secondary memory, which
wafers which are etched with includes any type of storage media, such as a floppy disk, hard
intricate circuits and coated disk, memory key, or CD-RW. Secondary memory must be copied
sa

with a metallic oxide to allow


the circuits to conduct elec-
into primary memory before it is processed by the CPU. SRAM
tricity. The silicon wafers are (Static Random Access Memory) is high-speed memory referred
housed in special plastic cases to as cache (pronounced “cash”). This memory is used to store
that have metal pins. The pins frequently used data so that it can be quickly retrieved by an
allow the integrated circuits application.
to be plugged into circuit
boards.
Operating Systems and Environment
A desktop computer also contains programs, or software. Operating
system (OS) software is run automatically when the computer is turned on
and is used to control processing and peripherals, run application soft-
BIOS ware, and control input and output, among other tasks. Desktop operating
system software includes Windows, Mac OS X Tiger, Unix, and Linux.
BIOS (basic input/output sys-
tem) is firmware that contains
Each of these operating systems have different features and functions.
the computer’s start-up instruc- Applications software is written by programmers to perform a specific task,
tions. Firmware is instructions such as a word processor.
or data that is written onto
ROM. The type of OS a computer can run depends on the computer hardware,
and can be multiuser, multiprocessing, multitasking, multithreading, or

2 Chapter 1 An Introduction to Computers


real time. A multiuser OS is supported by mainframes and minicomputers
Mainframes and and allows for two or more users at the same time. The terms multiprocessing
Supercomputers and multitasking are often used interchangeably when referring to an
OS that allows for multiple applications (“processes” or “tasks”) to run
A mainframe is a large
at the same time. This type of OS determines how to divide processor
computer system that supports
multi-user applications and time between running applications. A multiprocessing OS should not be
tasks that require the storage confused with a multiprocessing computer system, which has more than
a n d p r o c e s sin g o f h u g e one processor and performs parallel processing because the processors are
amounts of information. Large used simultaneously for multiprocessing. Multithreading refers to an OS
corporations, airlines, banks, that can execute different parts of a single program, called threads, at the
government agencies, and same time. A real-time OS responds to input immediately. This type of
universities use mainframes.
OS is used in situations where immediate feedback is required, such as
A supercomputer is the fastest navigation systems or medical monitoring equipment.
and most powerful type of
computer. Supercomputers Environment refers to a computer’s hardware and software configura-
focus on executing a few tion. For example, a Windows XP environment means that the computer is
programs as fast as possible running the Windows XP Professional OS software and hardware includes
and are used for weather a 300MHz processor or better, 128MB of RAM or more, and at least 1.5GB

e
forecasting and nuclear energy of hard disk space. The hardware requirements are based on what will
research.
be needed to allow the OS software to properly manage the computer’s
tasks. The term platform is sometimes synonymous with environment.

pl Environment types vary widely and can refer to the computer type or
the way the user interacts with the computer as well as the software/hard-
ware configuration. A desktop environment refers to a desktop or notebook
computer running an OS designed for the typical hardware found in a
desktop or notebook computer. A multiuser environment is sometimes called
time sharing because each user gets a portion of the processor’s “time.”
A distributed environment shares the load of processing among several
computers. When discussing environments, a distinction is usually made
m
between multiprocessing and multitasking. A multiprocessing environment
means that more than one processor is being used for executing an appli-
cation, and a multitasking environment is one in which processing time for
TIP For information on a multiple applications is divided among one processor. Most environments
specific operating system, refer
run an OS with a graphical user interface (GUI):
to the appropriate chapter at
sa

Lvp.com.

Windows XP Operating System

Chapter 1 An Introduction to Computers 3


The functions of an OS are based on the intended OS platform.
Functionality is implemented through utility programs that are written
utility program as part of the OS. A utility program has one clearly defined task, unlike
an application which can usually perform many different tasks. Utility
programs are run by the OS to manage input and output, read and write
to memory, manage the processor, maintain system security, and manage
files and disks. One type of utility program, called a device driver, is needed
for printing, viewing graphics, using a CD/DVD drive, and using periph-
erals in general. Some utility programs load when the computer starts and
memory-resident are called memory-resident because they are always in memory.
Features are added to an OS by incorporating utility programs to per-
form tasks that are in addition to the tasks required to run the computer.
For example, an OS intended for a desktop or notebook environment will
often include utilities for disk defragmentation, text narration and other
accessibility tools, and system restore and backup tools. For example:

e
pl
m
sa

Windows XP Utilities

Mobile Computing
Improved technology has allowed the miniaturization of computer
components and special long-lasting batteries. Computers now come
in many shapes, sizes, and with many levels of features. Among these
Bluetooth computers are notebooks, tablets, handhelds, smart phones, and wearables.
Blueto oth is a wireless Because of their portability, these types of computers are classified as
technology used to allow mobile computing devices:
mobile computing devices to
communicate. • A notebook computer is a portable, lightweight computer with a
CPU, memory, and hard disk space comparable to that of a typical
desktop computer.
• A tablet PC is a computer designed similar to a pad of paper and
a pencil. Users simply “write” on a screen with a device called a
stylus that is shaped like a thin pencil. Handwriting recognition
software is used to interpret a user’s handwriting. A keyboard can
also be attached.

4 Chapter 1 An Introduction to Computers


• Handheld computers, also called PDAs, are palm-sized and contain
Handheld Computers applications for storing contact information, schedules, lists, and
games. Handhelds come with a stylus for input and have a screen
Handheld computer s are that is several inches vertically. Many types of application software
widely used in occupations
have been written for handhelds, including spreadsheets and word
that require constant travel,
such as parcel delivery, meter processors. Some handhelds recognize handwriting, have a built-in
reading, and sales. keyboard, include a cellular phone, and provide Internet access.
• Smartphones are cellular phones that are able to send and receive
e-mail messages and access the Internet. Some smartphones have
digital camera, MP3 player, and color display capabilities.
• Wearable computers vary greatly in size and application. MP3 play-
ers have been incorporated into clothing, and one type of wearable
computer includes voice recognition. Wearable computers are also
in the form of goggles, which incorporate a monitor, digital camera,
ear bud, and microphone. Wrist-top computers are worn like a tra-
ditional wrist watch and work as a pager, provide Internet access,

e
and contain other features usually found in a handheld PC.

cross-platform connectivity One issue involved with using so many types of PCs is cross-platform
connectivity, which is the ability for one type of PC to link to and share
data with a different type of PC. Notebook and desktop PCs typically have

pl good cross-platform connectivity because their file formats can be used on


either computer. Tablets and handhelds use a different OS and generate
different file formats, requiring special hardware and software to use their
files on a desktop or notebook PC. Wearable computers typically have a
cable that allow a connection to other types of PCs, but special software
must be used to communicate between the devices.
m
Programming Languages
A programming language is a set of words, codes, and symbols that allow
a programmer to give instructions to the computer. Many programming
languages exist, each with their own rules, or syntax, for writing these
sa

instructions.
Programming languages can be classified as low-level and high-level
languages. Low-level programming languages include machine language
and assembly language. Machine language, which is referred to as a first
generation programming language, can be used to communicate directly
with the computer. However, it is difficult to program in machine language
because the language consists of 0s and 1s to represent the status of a
switch (0 for off and 1 for on). Assembly language uses the same instruc-
tions and structure as machine language but the programmer is able to
Fourth and Fifth use meaningful names or abbreviations instead of numbers. Assembly
Generation Languages language is referred to as a second generation programming language.
Fourth generation languages
(4GL), such as SQL, have High-level programming languages, which are often referred to as third
higher English-like instructions generation programming languages (3GL), were first developed in the late
than most high-level languages 1950s. High-level programming languages have English-like instructions
and are typically used to access and are easier to use than machine language. High-level programming
databases. Fifth generation languages include Fortran, C, Basic, COBOL, and Pascal. In order for the
languages are used for artificial
computer to understand a program written in a high-level language, pro-
intelligence.
grammers convert the source code into machine language using a compiler
or an interpreter. A compiler is a program that converts an entire program

Chapter 1 An Introduction to Computers 5


interpreter into machine code before the program is executed. An interpreter translates
and executes an instruction before moving on to the next instruction in
the program.
object-oriented programming In the 1980s, object-oriented programming (OOP) evolved out of the need to
better develop complex programs in a systematic, organized approach. The
OOP approach allows programmers to create modules that can be used
over and over again in a variety of programs. These modules contain code
called classes, which group related data and actions. Properly designed
classes encapsulate data to hide the implementation details, are versatile
enough to be extended through inheritance, and give the programmer
options through polymorphism. Object-oriented languages include Java,
C++ and Visual Basic .NET.

Networks
A network is a combination of hardware and software that allows

e
computers to exchange data and share software and devices, such as
printers. Networks are widely used by businesses, universities, and other
organizations because a network:

pl • allows users to reliably share and exchange data


• can reduce costs by sharing devices such as printers
• offers security options including password protection to restrict
access to certain files
• simplifies file management through centralized software updates
and file backups
• provides e-mail for network users
m
Networks are classified by their size, architecture, and topology. A
MAN and HAN common size classifications is LAN (Local-Area Network), which is a
network used to connect devices within a small area such as a building or
A MAN (Metropolitan Area
a campus. A WAN (Wide-Area Network) is used to connect devices over
Network) and a HAN (Home
sa

Area Network) are network large geographical distances. A WAN can be one widespread network or
technologies classified by the it can be a number of LANs linked together.
size of a network. A MAN is a
high-speed network that typi- The computers and other devices in a LAN each contain an expansion
cally connects LANs within a card called a network interface card:
city or town. A HAN is used
to connect personal devices
within the home.

Network interface card

6 Chapter 1 An Introduction to Computers


A cable plugs into the adapter card to connect one device to another to
Transmission Media form a LAN. Cables are not required for network cards that have wireless
capabilities. Network interface cards are available for desktop and mobile
Computers must be con- computers and take various other forms including an adapter card, a PC
nected in order to transmit
card, or a Flash memory card
data between the nodes. Cable
transmission media includes Along with the physical, or hardware, aspects of setting up a network,
twisted-pair wiring, coaxial
there is also the software aspect. A network operating system is software that
cable, and fiber optic cable.
allow users and devices to communicate over the network. A networked
Wireless transmission media environment refers to a set of networked computers running an OS that can
includes infrared signals, handle the communication between the computers. The operating system
broadcast radio, cellular radio,
installed must be capable of supporting networking functions, such as
microwaves, and communica-
tions satellites.
security access features and support for multiple users. Operating systems
capable of network functions are available for Linux, Windows, Unix, and
The amount of data and the Mac. The network architecture, discussed next, must also be considered
speed at which data can travel when choosing a network OS.
over a media is called band-
width, which is measured in Network architecture includes the type of computers on the network and

e
bits per second (bps). Each determines how network resources are handled. Two common models are
transmission media has a spe-
peer-to-peer and client/server. In a peer-to-peer network, each computer on
cific length or range restric-
tion, data transmission rate,
the network is considered equal in terms of responsibilities and resource
and cost. sharing. A client/server network consists of a group of computers, called

pl Ethernet
clients, connected to a server. A server is a computer with more RAM, a
larger hard disk, and sometimes multiple CPUs that is used to manage
network functions.
Physical topology refers to the arrangement of the nodes on a network.
A node is a location on the network with a device capable of processing
information, such as a computer or a printer. There are three common
physical topologies:
m
The Ethernet LAN protocol was
• The bus topology is a physical LAN topology that uses a single cen-
developed by Bob Metcalfe in
1976. Ethernet uses a bus or tral cable, called the bus or backbone to attach each node directly:
star topology with twisted-
pair wiring, coaxial cable,
or fiber optic cable transmis-
sion media. Newer protocols
sa

include Fast Ethernet, which


operates at 100 Mbps, Gigabit
Ethernet which operates at
1 Gbps, and 10G Ethernet,
which operates at 10 Gbps.

LAN using a bus topology

Chapter 1 An Introduction to Computers 7


• In a star topology, each node is attached to a hub, which is a device that
joins communication lines at a central location on the network:

Baseband and
Broadband Technology
Most LANs use baseband
technology which means the

e
transmission media carries one LAN using a star topology
signal at a time. Broadband
technology allows for data • In a ring topology, each node is connected to form a closed loop.
transmission of more than one A LAN with a ring topology can usually cover a greater distance
pl
signal at a time and is found in
cable television transmission.
than a bus or star topology:
m
Wi-Fi
sa

Wi-Fi (Wireless Fidelity) is


a term used to describe an
802.11 network, which is a LAN using a ring topology
specification or protocol for
wireless networks. • Wireless networks use high frequency radio waves or infrared sig-
nals instead of cables to transmit data. A router/wireless access
point device is used to allow nodes to transfer data wirelessly.

logical topology Another type of topology is logical topology, which refers to the way data
is passed between the nodes on a network. A LAN’s logical topology is
not always the same as its physical topology.

8 Chapter 1 An Introduction to Computers


Network users are given a user name and password to log on to a
network through a computer connected to the network. Users are also
assigned a level of access to maintain security. Network users should
netiquette follow a certain etiquette referred to as netiquette:
• Do not attempt to access the account of another user without
authorization.
• Do not share your password, and change it periodically.
• Use appropriate subject matter and language, and be considerate
of other people’s beliefs and opinions.

Number Systems
The electrical circuits on an IC have one of two states, off or on. Therefore,
binary number system the binary number system (base 2), which uses only two digits (0 and 1), was
adopted for use in computers. To represent numbers and letters, a code

e
was developed with eight binary digits grouped together to represent a
bit single number or letter. Each 0 or 1 in the binary code is called a bit (BInary
byte digiT) and an 8-bit unit is called a byte.
base 10 Our most familiar number system is the decimal, or base 10, system. It

pl uses ten digits: 0 through 9. Each place represents a power of ten, with
the first place to the left of the decimal point representing 100, the next
place representing 101, the next 102, and so on (remember that any number
raised to the zero power is 1). In the decimal number 485, the 4 represents
4×102, the 8 represents 8×101, and the 5 represents 5×100. The number 485
represents the sum 4×100 + 8×10 + 5×1 (400 + 80 + 5):
Decimal Base 10 Equivalent
m
485 4×102 + 8×101 + 5×100 = 400 + 80 + 5

base 2 The binary, or base 2, system works identically except that each place
represents a power of two instead of a power of ten. For example, the
binary number 101 represents the sum 1×22 + 0×21 + 1×20 or 5 in base ten.
Some decimal numbers and their binary equivalents are:
sa

Decimal Binary Base 2 Equivalent


0 0 = 0×21 + 0×20 = 0×2 + 0×1 =0+0
1 1 = 0×21 + 1×20 = 0×2 + 1×1 =0+1
2 10 = 1×21 + 0×20 = 1×2 + 0×1 =2+0
3 11 = 1×21 + 1×20 = 1×2 + 1×1 =2+1
4 100 = 1×22 + 0×21 + 0×20 = 1×4 + 0×2 + 0×1 =4+0+0

The hexadecimal system is used to represent groups of four binary


base 16 digits. The hexadecimal, or base 16, system is based on 16 digits: 0 through
9, and the letters A through F representing 10 through 15 respectively.
Each place represents a power of sixteen. For example, the hexadecimal
number 1F represents the sum 1×161 + 15×160. Some decimal numbers and
their hexadecimal equivalents are:
Decimal Binary Hexadecimal Base 16 Equivalent
0 0000 0000 0 = 0×160 = 0×1 =0
10 0000 1010 A = 10×160 = 10×1 = 10
25 0001 1001 19 = 1×161 + 9×160 = 1×16 + 9×1 = 16 + 9
30 0001 1110 1E = 1×161 + 14×160 = 1×16 + 14×1 = 16 + 14

Chapter 1 An Introduction to Computers 9


For clarity, a non-base 10 number should have the base subscripted after
ASCII and EBCDIC the number. For example, to show the difference between 100 in base 10
and 100 in base 2 (which represents 4), the base 2 number should be writ-
ASCII (American Standard ten as 1002.
Code for Information
Interchange) and EBCDIC Every letter of an alphabet (Latin, Japanese, Cherokee, and so on) and
( E x tend e d Binar y Co d e d symbols of every culture (=, @, ½, and so on) have been given a representa-
Decimal Interchange Code)
tion in a digital code called Unicode. Unicode uses a set of sixteen 1s and 0s
are two other digital coding
schemes. Unlike Unicode, to form a 16-bit binary code for each symbol. For example, the uppercase
ASCII and EBCDIC are not letter V is Unicode 00000000 01010110, which can be thought of as the base
large enough to support Asian 10 number 86 (8610). Lowercase v has a separate code of 00000000 01110110,
and other languages that use a or 11810.
different alphabet.

Storing Data in Memory


Computer memory is measured in bytes. For example, a computer might
have 512MB of RAM. In computers and electronics MB stands for megabytes

e
where mega represents 220 or 1,048,576 bytes and GB stands for gigabytes,
which is 230 or 1,073,741,820 bytes.
Data stored in memory is referred to by an address. An address is a
pl unique binary representation of a location in memory. Therefore, data
can be stored, accessed, and retrieved from memory by its address. For
data to be addressable in memory, it must usually be at least one byte in
length. For example, to store JIM in memory each character is converted
to Unicode and stored in two bytes of memory with each memory location
designated by its address:
m
Because JIM is a character string, it will probably be stored in adjacent
memory addresses.

words Bits grouped in units of 16 to 64 (2 to 8 bytes) are called words. Data


sa

stored in a word is also located by an address. The size of a word depends


on the computer system.
The binary representation of an integer number is usually stored in four
bytes of memory. Because an integer is stored in four bytes, the range of
overflow error integers that can be stored is –2,147,483,648 to 2,147,483,647. An overflow error
occurs when the number of bits that are needed to represent the integer is
greater than the size of four bytes.
real numbers Real numbers, also called floating point numbers, are numbers that contain
decimal points. The binary representation of a real number is usually 4 to
8 bytes of memory. The binary number 111.10 is equivalent to the real deci-
mal number 7.5 and is stored in memory as the binary number 0.11110×23.
mantissa In this form, the bits that represent the mantissa (fractional part) are stored
exponent in one section of a word and the exponent, in this example 3 (112), is stored
in another section of the word:

10 Chapter 1 An Introduction to Computers


The overflow problem discussed for integers can also occur in real
numbers if the part of the word storing the exponent is not large enough.
roundoff error A roundoff error occurs when there are not enough bits to store the
mantissa.

What is a File?
A file is related data stored on a persistent media. A file can be an appli-
cation (program) or the product of an application. For example, a word
File Size Limitations processor application is used to create document files. As another example,
File size can be decreased a digital camera is used to create photo files. A file is stored on a persistent
or compressed using a media so that it is retained even after the computer or computerized device

e
compression program, such
is turned off. A file can be used over and over again whenever the data it
as WinZip. This technique is
often used to accommodate
stores is needed.
storage device and e-mail A file is really just 1s and 0s because it is stored in binary code. Computers
account limitations.

pl are programmed to translate bytes and words into symbols. Depending


on the file type, these symbols are either human-readable or computer-
readable after translation. Human-readable files are called text files, and
computer-readable files are called binary files. Simple files, such as a text
document, can be measured kilobytes, for example 64K. The K comes from
the word kilo and represents 210 or 1,024. Therefore, a 64K file uses 65,536
bytes (64×210) of storage.
File types are distinguished by the extension that comes after the file
m
name. An application adds a unique extension to the files it creates. For
Extensions example, MyResume.doc is a document file type. A DOC file is a binary file
Common extensions include: created by Microsoft Word. Executables are EXE files and are also binary
.xls - Excel file files. A file named TestData.txt is a plain text file. A TXT file contains
.class - Compiled Java file only letters, numbers, and common symbols readable by humans. Folders
sa

.java - Java file are used to organize commonly related files.


.zip - compressed file
.gif - GIF image file Binary files are more complex than text files and often contain data for
.bmp - Bitmap graphic photos, formatted text, spreadsheets, sound, and so on. The disadvantage
of binary files is that they require another application to interpret the
contents. A binary file may have content similar to:
TIP The original form the file ÿÿñU_ÿÿþ}9UTýÿ–÷}]Ï_ñÿÑßÿÿý�ÿ×_ÿ÷Äõÿ
is saved in is referred to as the ÿ ÿ ð – U _ÿ ÿ w u s U U ü w] U/ U _ ñ ÿ U W w w t w w U W w wD õ ÿ
native format. þ»ÿÿúªî¿þÿþûïûüÿ¾þïìÿ
þÿÿï¿¿ÿïìôÿ UÿÿüET_ÿÿ÷wìÿ–þ»ÿÞþïýÿþøÿ¯ÿëÿúþÿ«ºòÿþýÿûÿûèôÿ
ÿÝþ_ÿÿ�ÿwþuUuWýw÷÷ÿ{þÿß¿ß÷ÿuWwwu÷uuUUwwDõÿþ»ÿÌ®è�lïÿþ
>«~﮿þÿ
ýUÝUUÕ]UU]UÕ]Õ]æÝDôÿ¿Îÿàôÿøÿ
ßýÕW_ý_õW_ÕÕ]uåÿDõÿþ¿óÿïþÿÿþáÿèôÿøwÿuþWuWUUwWþUåwDõ
ÿþ
A binary file is computer-readable

Chapter 1 An Introduction to Computers 11


Storage Devices
Storage devices use a persistent media to maintain files. These devices,
which are also referred to as drives, mass storage, and auxiliary storage, can
be categorized in three ways:
• internal or external
• removable or permanent media
• magnetic, optical, or solid state technology

Internal devices are drives mounted inside the PC case. These devices
can include hard disk, CD/DVD, disk, tape, Zip, and Jaz drives. Except for
the Iomega® RRD (Removable Rigid Disk) system, which uses a removable
media, hard drives typically have permanently installed disks that are not
accessible from outside the PC case. Other devices have an external slot
for removable storage media.

e
External devices have a stand-alone drive housing and connect to a
computer’s USB port with a cable. USB (Universal Serial Bus) is a standard-
ized technology with data transfer rates up to 480 Mbs. As many as 127
devices can be connected to a single port with USB hubs.
pl External drives offer the advantage of portability because they can be
easily moved to other computers that support the technology. External
devices include hard disk, RRD, CD/DVD, diskette, tape, Zip, and Jaz
drives. Except for the hard disk drive, these drives have removable
media.
Ultra-portable devices include keychain, watch, mini drive, and mouse
storage to name just a few. These external devices are small and easy-to-
m
use, but currently more expensive than comparable storage devices that
are larger in size. Most ultra-portable devices, including the keychain and
mini drive, have storage media attached directly to a USB plug that is con-
nected to a USB port. The watch and mouse storage devices use a cable
with a USB plug to connect to a USB port. The watch has a short cable and
USB plug hidden in the band. The mouse storage device requires a longer
sa

cable so that it can also function as a pointing device.


Firewire Storage device technologies determine the media, size, and portabil-
Using the IEEE 1394 standard, ity of a device. Magnetic technology uses a mechanical drive with tiny
a FireWire port allows devices electromagnetic heads for reading and writing data to media. The media
to quickly t rans fe r lar ge required with magnetic technology is a disk, usually made of aluminum or
amounts of data (greater than
Mylar®, coated with iron oxide. The disk is either encased in hard plastic
400Mbs). FireWire is often
used for digital video cameras
(floppy diskette and Zip) or several disks, called platters, are sealed in a
and sometimes external hard case (Jaz, RRD, and hard disk). A data signal sent through the heads in
drives because of the amount the drive magnetize a bit of the media in one direction to store a 1 and in
of data associated with these the other direction to store a 0.
devices. FireWire devices can
be daisy-chained together, Optical technology uses a drive with a laser and an optoelectronic sen-
which means one device sor. The media required with optical technology is a compact disc made
is connected to another’s of polycarbonate plastic. A CD-R (CD-Recordable) disc is used for stor-
FireWire port and that device ing files. CD-Rs are coated with a reflective organic compound and then
is connected to another and so sealed with a plastic layer to protect the reflective layer from scratches.
on. FireWire also supports iso-
The laser in the drive is focused on a bit of the CD-R to darken, or “burn,”
chronous mode for real-time
data transfer. the organic compound to store a 1. The areas of the CD-R left unburned
are read as bits storing a 0.

12 Chapter 1 An Introduction to Computers


Another application of optical technology is the DVD drive, which
Tera, Peta, Exa uses a DVD-R disc, similar to a CD-R. The DVD-R (Digital Video Disc-
Recordable) can store much more data than a CD-R because of the preci-
As more and more data is sion used in manufacturing the drive and the DVD-R itself. Bits are much
stored electronically, file sizes
smaller and stored much more closely together on the DVD-R.
become very large and require
storage devices with very large Solid state technology allows for the smallest, most portable storage
capacities. TB (terabyte) is 240
devices because the technology requires no moving parts. The media is
bytes or 1 trillion bytes, pet-
abyte (PB) is 250 bytes or 1,024 Flash memory, which consists of a grid with two tiny transistors at each
terabytes, and EB (exabyte) is cell. Each cell corresponds to a bit. Applying a charge to a cell stores a
260 bytes or 1,024 petabytes. 0, while applying a stronger charge stores a 1. The grid of transistors is
Device s wit h TB storage encased in hard plastic and is very small. Some devices can store 2MB or
capacities are gradually com- more within a package thinner and smaller than a quarter. Slightly larger
ing into use, especially for media can store gigabytes of data. Encased media is often directly attached
database files.
to a USB plug for use with a computer, or simply has conductive material
imprinted so the media can slide into a digital camera slot.
Magnetic technology allows for storage devices that range in capacity from

e
1.44MB (a floppy diskette) to many gigabytes (hard disk drives with many
platters). Optical technology includes CDs that can store about 700MB of
data, while DVDs can store at least 4GB of data. Solid-state devices store
from 64KB of data to many gigabytes.

pl storage media care

Storage Media
The capacity of storage media
varies. For example, a disk has
Storage media can be very sensitive. Care should be taken to avoid
damaging files:
• Never attempt to open a case containing a disk.
• Keep magnetic media away from magnets.
• Handle CD/DVDs by the center hole or by the edges.
• Never bend CD/DVDs or other flexible media.
a storage capacity of 1.44 MB,
m
a CD has a storage capacity • Store CD/DVDs in a jewel case or sleeve to prevent scratches.
of 650 MB, and a DVD has a
storage capacity of over 4GB. • Keep media away from moisture and extreme temperatures.

Intranet, Extranet, Internet


sa

An intranet is a network that is used by a single organization, such as


a corporation or school, and is only accessible by authorized users. The
purpose of an intranet is to share information. However, a firewall is also
firewall used to lock out unauthorized users. A firewall is a network security system
that prevents unauthorized network access.
An extranet extends an intranet by providing various levels of acces-
sibility to authorized members of the public. For example, a corporation
may extend their intranet to provide access to specific information, such
as their ordering system, to registered customers.
History of the Internet
The Internet evolved from
The largest and most widely accessed network is the Internet, a world-
ARPANET, a network cre- wide network of computers that is not controlled by any one organization.
ated in the late 1960s by the The Internet has had an undeniable impact on modern society because it
Depar tment of Defense’s allows users worldwide to communicate in a matter of seconds.
ARPA (Advanced Research
Projects Agency), and the
theory of open architecture
networking.

Chapter 1 An Introduction to Computers 13


The Internet is actually numerous networks all linked together through
routers. A router is a device that connects different network technolo-
gies. Networks connected to routers use TCP/IP (Transmission Control
Protocol/Internet Protocol) software to communicate.
Computers on the Internet are either servers or clients. The client is sent
information from a server. The client/server structure of the Internet is
called interactive because the information accessed is a result of selections
made by the user. For example, a computer with just minimal software
for accessing the Internet is a client. The client user selecting options from
the Internet is receiving the information from a server, a computer with
additional software and files that is also connected to the Internet.

Telecommunications
Telecommunications is the transmitting and receiving of data. Data can be
in various forms including voice and video. Telecommunications requires

e
TIP Access to the Internet a modem or adapter and a line or cable. The speed of data transmission
requires telecommunications
and the use of an Internet
(sending) and receipt (receiving) is measured in Kbps (thousands of bits
Service Provider (ISP). per second) or Mbps (millions of bits per second). Numerous telecommu-
nications options are available, which vary in speed and cost:
pl • A conventional modem uses standard telephone lines to convert
analog signals to digital data. A conventional modem is a 56 Kbps
modem, which transmits data at 28.8 Kbps and 36.6 Kbps, and
receives data at 56 Kbps. Home computers sometimes use a con-
ventional modem.
• A DSL (Digital Subscriber Line) modem uses standard telephone
TIP In a wireless network, a
router/wireless access point is lines with data transmission up to 640 Kbps. Data receipt is from
m
typically connected by a cable 1.5 Mbps to 9 Mbps. A DSL (Asymmetric DSL) is the most common
to a cable or DSL modem. form used.
• A cable modem transmits data through a coaxial cable television
network. Data transmission is from 2 Mbps to 10 Mbps and data
receipt is from 10 Mbps to 36 Mbps.
sa

• Leased/Dedicated lines are used by many businesses and schools


for Internet access. They allow for a permanent connection to the
Internet that is always active. The cost of a leased line is usually a
fixed monthly fee. A T-1 carrier is a type of leased line that trans-
mits data at 1.544 Mbps.
• ISDN (Integrated Services Digital Network) is a digital telephone
network provided by a local phone company. ISDN is capable of
transmitting and receiving data at up to 64 Kbps. ISDN requires
the use of an ISDN terminal adapter instead of a modem.

14 Chapter 1 An Introduction to Computers


Internet Services: Web, E-mail, and
Mailing Lists
Internet services include the World Wide Web, e-mail, and mailing lists.
World Wide Web The World Wide Web (WWW), also called the Web is the most widely used
Internet service. The Web can be used to search and access information
web browser available on the Internet. A web browser application, such as Microsoft
Internet Explorer, provides a graphical interface to present information
in the form of a website:

Blog

e
Blog is short for weblog and is
a type of website where users
can post entries in a journal
format.

pl
m
A web page that is part of the New York Times website
Another widely used Internet service is e-mail or electronic mail, which
is the sending and receiving of messages and computer files over a com-
munications network, such as a LAN (Local Area Network) or the Internet.
sa

E-mail can be received in a matter of seconds, even if the recipient is


Digital Signature located half way around the world.
A digit al signature is a An e-mail address is required in order to send and receive e-mail mes-
code that is attached to an
sages. E-mail addresses are provided when you sign up with an ISP or an
electronic message to verify
the authenticity of a website online service. A typical e-mail address is similar to:
or e-mail message.

E-mail software is also required for sending and receiving e-mail mes-
sages. Examples of e-mail software include Outlook, Outlook Express,
Instant Messaging and Eudora. Browser-based e-mail only requires a web browser and is
Instant messaging is a com- available through sites such as Yahoo! and Hotmail.
munication tool that allows
for real time or immediate text-
based communication.

Chapter 1 An Introduction to Computers 15


Certain rules should be followed when composing e-mail messages
E-mail Protocols • Use manners. Include “please” and “thank you” and also properly
POP3 is an e-mail protocol address people you do not know as Mr., Ms., Mrs., Dr., and so on.
that connects to an e-mail
• Be concise.
server to download messages
to a local computer. • Be professional, which includes using the proper spelling and
IMAP is an e-mail protocol that grammar.
connects to an e-mail server • Re-read a message before it is sent. Always fill in the To box last to
to read message headers and avoid sending a message before it is complete.
then the user selects which
e-mail messages to download
E-mail messages are not private. An e-mail message goes through sev-
to a local computer.
eral mail servers before it reaches the recipient, making it easily accessible
HTTP is used as an e-mail pro- for others to read. Therefore, sending e-mail messages requires following
tocol when a web page is used a certain etiquette:
to access an e-mail account.
• Send messages through your account only.
• Use appropriate subject matter and language.

e
• Be considerate of other people’s beliefs and opinions.
Spam
When sending e-mail at work or school, it is important to remember
Along with personal and
that employers and school administrators have the right to read any e-mail
pl
busine ss me ssage s, most
people also receive a lot of
“junk e-mail” or spam. Most
e -mail sof t ware includes
features to filter and block
messages from spe cif ic
senders.
messages sent over the corporate or school network, as well as the right to
track online activity.
A mailing list server is a server that manages mailing lists for groups of
users. Two mailing list servers are Listserv and Majordomo. Often users
subscribe to mailing lists for discussion purposes. When a subscriber posts
a message to a mailing list server, every subscriber receives a copy of the
message. Subscribers are identified by a single name or e-mail address.
m
Finding Information on the Web and
Downloading Files
sa

A search engine is a program that searches a database of web pages for


keywords and then lists hyperlinks to pages that contain those keywords.
Search Engines Commonly used search engines include:
A search engine usually works Yahoo! (www.yahoo.com)
by sending out an agent,
Google (www.google.com)
such as spider. A spider is an
application that gathers a list MSN (www.msn.com)
of available web page docu- AOL (www.aol.com)
ments and stores this list in a Excite (www.excite.com)
database that users can search
Ask Jeeves (www.ask.com)
by keywords.
Overture (www.overture.com)
When displaying information,
Lycos (www.lycos.com)
search engines often show
“Sponsored Sites Results” first. WebCrawler (www.webcrawler.com)
These are sites that contain the FAST Search (www.alltheweb.com)
information being searched About.com (www.about.com)
for but have paid the search
AltaVista (www.altavista.com)
engine to list their sites at the
top of the list. Looksmart (www.looksmart.com)

16 Chapter 1 An Introduction to Computers


A search engine can be queried to display specific web pages. Search criteria
can include single words or phrases that are then used by the engine to
determine a match. A match is a web page that contains the search criteria.
Surrounding phrases with quotation marks finds web pages that contain
the entire phrase. The more specific the search criteria, the better the
chance the information will be found.
Most searches yield far too many matches to be useful. Limiting the
number of matches to a reasonable number can usually be accomplished
by using Boolean logic in the search criteria:
• The + (plus sign) is used in search criteria to limit a search to only
Boolean Logic
Web pages that contain all of the specified words. For example, a
Boolean logic uses three search for florida +hotel or florida hotel returns only links to pages
logical operators: containing both words. AND can be used in place of + in most
AND locates pages that search engines.
include both words
• OR can be used in most search engines to find Web pages that
OR locates pages that include contain any one of the words in the criteria. For example, the cri-

e
one word or the other or both teria florida OR hotel returns links to pages containing either of
NOT locates pages that
the words.
include the first word, but not • The – (minus sign) is used to exclude unwanted Web pages. For
the second word

pl
A boolean expression always
evaluates to TRUE or FALSE
with pages that match the
search condition evaluating to
TRUE.
example, the search for shakespeare –play returns hyperlinks to
pages containing the word shakespeare, but eliminates pages that
also contain the word play. NOT can be used in place of – in most
search engines.
Some search engines provide a subject tree, or web directory, which is a
list of sites separated into categories. The term subject tree is used because
many of the categories “branch” off into subcategories. These subcategories
allow the user to narrow down the subject and display a list of appropriate
m
hyperlinks, which are at the lowest level of the tree.

TIP Just because a file is Information on a website is sometimes in the form of a downloadable
available on a website for file. Downloading is the process of copying a file from a website to the
download does not mean that user’s computer. For example, virus definitions can be downloaded from a
it is legal to download the file. antivirus software company’s website and software updates can be down-
sa

Downloading copyrighted loaded from the software company’s website. When a file is downloaded,
files that have not been made
the user specifies where the file should be saved on the local computer.
freely available is a violation of
copyright law.
Files should only be downloaded from known, authentic websites since
downloadable files are often associated with viruses.
If information from a website is to be referenced or quoted in a report,
essay, or other document, a citation must be used to give credit to the
original author and allow the reader to locate the cited information. A
widely accepted form for citation is published by the Modern Language
MLA Association (MLA) in its publication MLA Handbook for Writers of Research
Papers, Fourth Edition.
In general, a citation for material located at a website should look similar
to:
Author's Last Name, First Name MI. Site Title. Access date.
Organization name. <URL>.

A citation of a personal website could look similar to:


Rawlings, Julie. Home page. 23 Dec. 2006. <http://www.
lpdatafiles.com/jrawlings/index.htm>.

Chapter 1 An Introduction to Computers 17


A citation of an article in an online magazine could look similar to:
Schiffman, Paula. "Making Vinegar at Home." Vinegar
Monthly. 4 May 2006. <http://www.lpdatafiles.com/
vinegarassoc/journal.asp>.

A citation of a posting to a discussion list could look similar to:


Cruz, Anthony. "Are Orchestras Going Downhill?" online
posting. 10 Oct. 2006. Tuscon Annual Ballet Conf.
<http://www.lpdatafiles.com/tuscontoes/downhill.txt>.

Internet Privacy Issues


The growth of the Internet has caused additional concerns about
personal privacy. Searching for information on the Internet is not as
anonymous as it might seem.
The collection of data about consumers visiting a website is a marketing

e
Spyware technique known as online profiling. When a commercial website is visited,
Spy ware is sof t ware that information about the user may be collected using various methods such
uses the Internet to gather as cookies or web beacons.
personal information from an
pl
unsuspecting user. Spyware
is unknowingly downloaded
and installed with another file,
such as freeware or shareware
programs.
A cookie is a text file created by the server computer when a user enters
information into a website. The cookie file is then stored on the user’s
computer and accessed each time the user visits that website. Cookies
are often created when online purchases are made. Although cookies can
only store information that the user has selected or entered, their use has
raised concerns over privacy issues.
Web beacons, also called web bugs or pixel tags, are tiny, transparent
IP Address graphics located on web pages or in e-mail messages that are used in
m
combination with cookies to collect data about web page users or e-mail
An IP address is an identifier
for a computer or device on a senders. Usually the monitoring is done by an outside advertising company.
TCP/IP network. The information a web beacon collects includes the IP address of the
computer, the URL being visited, the time the web page was viewed, the
type of browser being used, and the cookie file.
sa

TIP A website’s privacy policy Before providing a company with personal information through a
is typically found as a link at website, check the site’s privacy policy. A privacy policy is a legally binding
the bottom of the home page document that explains how any personal information will be used.
of a website.
The Internet has opened up access to many files that were previously
inaccessible. To protect both the privacy of an individual and the accuracy
of data stored about individuals, several laws have been passed:
• The Electronic Communications Privacy Act of 1986 (ECPA)
makes it a crime to access electronic data without authorization.
It also prohibits unauthorized release of such data.
• The Electronic Freedom of Information Act of 1996 (E-FOIA)
NET Act requires federal government agencies to make certain agency
information available for public inspection and is designed to
The NET (No Electronic Theft)
Act of 1997 closed a loophole improve public access to agency records by making more informa-
in the law which allowed copy- tion available online.
righted material to be given • The Children’s Online Privacy Protection Act of 1998 (COPPA)
away on the Internet without
requires commercial websites that collect personal information
any legal penalty.
from children under the age of 13 to obtain parental consent.

18 Chapter 1 An Introduction to Computers


• The Safety and Freedom through Encryption Act of 1999 (SAFE)
Encryption gives Americans the freedom to use any type of encryption to
protect their confidential information.
Encryption is the process of
translating data into a code that Other laws have been passed that may invade the privacy of some to
is not readable without the key
protect the safety of others. For example, the Provide Appropriate Tools
to the code. Encryption pre-
vents unauthorized access to Required to Intercept and Obstruct Terrorism (PATRIOT) Act of 2001
the data. Data that is encrypted gives law enforcement the ability to monitor individual’s e-mail and web
is referred to as cipher text. activity.

Internet Acceptable Use Policy


Internet content, unproductive use, and copyright have prompted many
schools and businesses to develop an Acceptable Use Policy or Internet
Use Agreement. Acceptable Use Policies typically contain rules similar
to:

e
Internet Filtering • Use appropriate language.
Software
• Do not reveal personal address or phone numbers.
Many schools and organiza-
tions install Internet filtering • Do not access, upload, download, or distribute inappropriate

pl
software to block offensive
material.
materials.
• Do not access another user’s account.
• Use of the network for private business is prohibited.
• Only administrator installed software may be used on the com-
puters. Adding, deleting, or modifying installed software is not
permitted.
m
The Social and Ethical Implications of
Computer Use
The society in which we live has been so profoundly affected by
sa

information age computers that historians refer to the present time as the information age.
This is due to the our ability to store and manipulate large amounts of
information (data) using computers. As an information society, we must
consider both the social and ethical implications of our use of computers.
By ethical questions we mean asking what are the morally right and wrong
ways to use computers.
ergonomics Ergonomics is the science that studies safe work environments. Many
health-related issues, such as carpal tunnel syndrome and computer vision
syndrome (CVS) are related to prolonged computer use.
Power and paper waste are environmental concerns associated with
computer use. Suggestions for eliminating these concerns include recycling
paper and printer toner cartridges and turning off monitors and printers
when not in use.
Employee monitoring is an issue associated with computers in the work-
place. It is legal for employers to install software programs that monitor
employee computer use. As well, e-mail messages can be read without
employee notification.

Chapter 1 An Introduction to Computers 19


As discussed in a previous section in the chapter, the invasion of privacy
Identity Theft is a serious problem associated with computers. Because computers can
store vast amounts of data we must decide what information is proper to
Identity theft is a growing crime store, what is improper, and who should have access to the information.
where personal information is
Every time you use a credit card, make a phone call, withdraw money,
stolen electronically in order
to make fraudulent purchases reserve a flight, or register at school, a computer records the transaction.
or loans. These records can be used to learn a great deal about you—where you have
been, when you were there, and how much money was spent. Should this
information be available to everyone?
Computers are also used to store information about your credit rating,
which determines your ability to borrow money. If you want to buy a car
and finance it at a bank, the bank first checks your credit records on a
computer to determine if you have a good credit rating. If you purchase
the car and then apply for automobile insurance, another computer will
check to determine if you have traffic violations. How do you know if
the information being used is accurate? The laws listed below have been
passed to help ensure that the right to privacy is not infringed by the

e
improper use of data stored in computer files:
• The Fair Credit Reporting Act of 1970 gives individuals the right
to see information collected about them for use by credit, insur-
pl ance, and employment agencies. If a person is denied credit they
are allowed to see the files used to make the credit determination.
If any of the information is incorrect, the person has the right to
have it changed. The act also restricts who may access credit files
to only those with a court order or the written permission of the
individual whose credit is being checked.
• The Privacy Act of 1974 restricts the way in which personal data
can be used by federal agencies. Individuals must be permitted
m
access to information stored about them and may correct any infor-
mation that is incorrect. Agencies must insure both the security
and confidentiality of any sensitive information. Although this law
applies only to federal agencies, many states have adopted similar
laws.
sa

• The Financial Privacy Act of 1978 requires that a government


authority have a subpoena, summons, or search warrant to access
an individual’s financial records. When such records are released,
the financial institution must notify the individual of who has had
access to them.

Protecting Computer Software and


Data
As society becomes more and more reliant on digital information,
copyright and exposure to malicious code have become two important
copyright issues among computer users. Copyright is protection of digital informa-
tion. Copyright infringement is the illegal use or reproduction of data
(text, pictures, music, video, and so on). Laws, such as the NET Act (No
Electronic Theft Act) of 1997, protect against copyright infringement. There
have been several well-known cases of high penalties for individuals guilty
of copyright infringement.

20 Chapter 1 An Introduction to Computers


Copyright infringement includes duplication of computer software
TIP It is usually legal to make when copies are being used by individuals who have not paid for the
one backup copy of a pur-
software. This practice is called piracy when illegal copies are distributed.
chased software program.
Developing, testing, marketing, and supporting software is an expensive
process. If the software developer is then denied rightful compensation,
the future development of all software is jeopardized. Therefore, it is
important to use only legally acquired copies of software, and to not make
illegal copies for others.
Malicious code comes in many forms and is delivered in many ways. A
virus, a Trojan horse, and an Internet worm are three forms of malicious
code. They can appear on a system through executable programs, scripts,
macros, e-mails, and some Internet connections. One devastating effect
of malicious code is the destruction of data.
virus A virus is a program or series of instructions that can replicate without
the user’s knowledge. Often a virus is triggered to run when given a cer-
tain signal. For example, a virus might check the computer’s clock and then

e
destroy data when a certain time is reached. A virus is easily duplicated
when the file is copied, which spreads it to other computers.

Trojan horse A Trojan horse program appears as something else, usually a program
that looks trustworthy. Running the program runs the malicious code

pl antivirus programs
and damages files on the computer. A worm is a program that is able to
reproduce itself over a network. Worms are a threat because of the way
they replicate and use system resources, sometimes causing the system
to shut down.
Malicious code has become so widespread that software called antivirus
programs must be installed on computers and networks to detect and
remove the code before it can replicate or damage data. Precautions can
m
also be taken to prevent damage from malicious code:
• Update antivirus software. An antivirus program can only detect
the viruses, Trojan horses, and worms it is aware of. Antivirus
programs have a web link for updating the virus definitions on
the computer containing the antivirus program.
sa

• Do not open e-mail attachments without scanning for malicious


code. One estimate states that 80% of virus infection is through
e-mail.

crackers, hackers Newspapers have carried numerous reports of crackers, or hackers, gain-
ing access to large computer systems to perform acts of vandalism. This
malicious act is illegal and can cause expensive damage. The Electronic
Communications Privacy Act of 1986 specifically makes it a federal offense
to access electronic data without authorization. Networks usually include a
firewall, which is a combination of hardware and software, to help prevent
unauthorized access.
The willful destruction of computer data is no different than any other
vandalizing of property. Since the damage is done electronically the
result is often not as obvious as destroying physical property, but the
consequences are much the same. It is estimated that computer crimes
cost billions of dollars each year.

Chapter 1 An Introduction to Computers 21


phishing Phishing is the act of sending an e-mail to a user falsely claiming to
be a legitimate business in an attempt to trick the user into revealing
personal information that could be used for crimes such as identity theft.
The Communications Privacy Act of 1986 specifically makes it a federal
offense to access electronic data without authorization. Networks usually
include a firewall, which is a combination of hardware and software, to
help prevent unauthorized access.

The Ethical Responsibilities of an IT


Professional
An IT (information technology) professional has responsibilities that
relate to system reliability. System reliability involves installing and updat-
IT Careers
ing appropriate software, keeping hardware working and up-to-date, and
The growth of computers, maintaining databases and other forms of data. Governments, schools, and
the Internet, and the Web
employers rely on IT professionals to maintain their computer systems.

e
have created many new job
opportunities in the IT field. In addition to ensuring system reliability, an IT professional must take
IT careers include data-entry responsibility for the ethical aspects of the career choice. For example,
operator, systems analyst,
IT professionals involved in creating software must ensure, as best he or
p r o g r a m m e r, c o m p u t e r
pl
e n g in e e r, a n d t e c h ni c al
support technician.
she can, the reliability of the computer software. This means the ethical
responsibility of the IT professional includes using the appropriate tools
and methods to test and evaluate programs before distribution. A special
cause for concern is the increased use of computers to control potentially
dangerous devices such as aircraft, nuclear reactors, or sensitive medical
equipment.
IT professionals must also consider the impact they have on computer
users. Web users for example often rely on data from websites providing
m
real-time information. The information displayed is determined with a
program written using a 4GL or other language that accesses a database.
The IT professionals involved in such a project have the ethical respon-
sibility to possibly millions of individuals for ensuring, as best they can,
accurate data retrieval.
sa

As capable as computers have proven to be, we must be cautious when


allowing them to replace human beings in areas where judgement is cru-
cial. As intelligent beings, we can often detect that something out of the
ordinary has occurred which has not been previously anticipated and then
take appropriate actions. Computers will only do what they have been
programmed to do, even if it is to perform a dangerous act.

Chapter Summary
A desktop computer and its components are designed to fit on or under
a desk. Mobile computers include notebooks, tablets, handhelds, smart
phones, and wearables. A computer must run operating system (OS)
software in order to control processing and peripherals, run application
software, and control input and output, among other tasks.

22 Chapter 1 An Introduction to Computers


A network is a combination of hardware and software that allows com-
puters to exchange data and share software and devices, such as printers.
Networks are classified by their size, architecture, topology, and protocol.
Network users should use netiquette.
A programming language is a set of words, codes, and symbols that
allows a programmer to communicate with the computer. Programming
languages can be classified as low-level and high-level languages. Low-
level programming languages include machine language and assembly
language. High-level programming languages have English-like
instructions and are easier to use than machine language. High-level
programming languages include Fortran, C, Basic, COBOL, and Pascal.
The electrical circuits on an IC have one of two states, off or on. Therefore,
the binary number system (base 2), which uses only two digits (0 and 1),
was adopted for use in computers. Our most familiar number system is the
decimal or base 10 system. The binary number system is a base 2 system
and the hexadecimal system is base 16. Every letter of an alphabet (Latin,

e
Japanese, Cherokee, and so on) and symbols of every culture (=, @, ½, and
so on) have been given a representation in a digital code called Unicode.
Computer memory, file sizes, and storage device capacities are measured
in bytes. In computers and electronics MB stands for megabytes, GB stands

pl
for gigabytes, and K stands for kilobytes.
The binary representation of an integer number is usually stored in four
bytes of memory. Real numbers are numbers that contain decimal points
and the binary representation of a real number is usually 4 to 8 bytes of
memory.
A file is related data stored on a persistent media. A file is really just 1s
m
and 0s because it is stored in binary code. Computers are programmed to
translate bytes and words into symbols. File types are distinguished by
the extension that comes after the file name. Folders are used to organize
commonly related files.
Storage devices use a persistent media to maintain files. These devices,
which are also referred to as drives, mass storage, and auxiliary storage,
sa

can be categorized as internal or external, as removable or permanent


media, and as magnetic, optical, or solid state technology.
An intranet is a network that is used by a single organization and is only
accessible by authorized users. A firewall is a network security system that
prevents unauthorized network access. An extranet extends an intranet
by providing various levels of accessibility to authorized members of the
public. The largest and most widely accessed network is the Internet. The
most widely used Internet service is the World Wide Web, also called the
Web. Other Internet service include e-mail and mailing lists.
Telecommunications is the transmitting and receiving of data.
Telecommunication options include a conventional modem, a DSL modem,
a cable modem, leased/dedicated lines, and ISDN.
A search engine is a program that searches a database of web pages for
keywords and then lists hyperlinks to pages that contain those keywords.

Chapter 1 An Introduction to Computers 23


Search criteria is used by the search engine to determine a match. Limiting
the number of matches to a reasonable number can be accomplished using
Boolean logic in the search criteria. Some search engines also provide a
subject tree, or web directory.
Information found at a website should be evaluated for accuracy. There
are guidelines for citing electronic material on the Internet. The primary
purpose of a citation is to give credit to the original author and allow the
reader to locate the cited information.
The growth of the Internet has caused concerns about personal privacy.
Online profiling, cookies, and web bugs are all areas of concern. Before
providing personal information through a website, check the site’s pri-
vacy policy. To protect an individual’s privacy, several laws have been
passed. Concerns about Internet content, unproductive use, and copyright
have prompted many schools and businesses to develop an Internet Use
Agreement.
Historians refer to our present time as the information age. The poten-

e
tial for the use of computers to invade our right to privacy has prompted
legislation to protect individuals. Piracy is the illegal act of duplicating
software without permission. A virus is a computer file that erases data
and can cause considerable damage.
pl Working as an IT (information technology) professional includes taking
responsibility for the ethical aspects of a career choice. IT professionals
must also consider the impact they have on computer users.
m
sa

24 Chapter 1 An Introduction to Computers


Vocabulary

Address A unique binary representation of a location Cookie Text file created by the server computer
in memory. when a user enters information into a website.

Address bus Carries memory addresses that indi- Copyright Protects a piece of work from reproduc-
cate data storage locations. tion without permission from the work’s author.

ALU (Arithmetic Logic Unit) The part of the CPU CPU (Central Processing Unit) Processes data and
that handles arithmetic and logic operations. controls the flow of data between the computer’s
other units. Also contains the ALU. Located on the
Antivirus program Software installed on computers
motherboard.
and networks to detect and remove viruses.
Cracker Person who accesses a computer system
Applications software Program written to perform
without authorization.
a specific task.
Cross-platform connectivity The ability of one
Base unit Housing that contains the mother-
type of PC to link to and share data with a different

e
board, CD-RW/DVD drive, disk drive, and hard
type of PC.
disk drive.
Dedicated line See Leased line.
Binary number system Number system used by
computers that uses only digits 0 and 1. Also called Device driver One type of utility program.

pl
base 2.
Bit (BInary digiT) A single 0 or 1 in binary code.
Bus A central network cable. Also a set of circuits
that connect the CPU to other components.
Bus topology A physical LAN topology that uses a
single central cable to attach each node directly.
Downloading The process of copying a file from
a website to the user’s computer.
DSL (Digital Subscriber Line) modem A modem
that uses standard telephone phone lines. ADSL is
the most common form used.
E-mail (electronic mail) The sending and receiving
m
of messages and electronic files over a communica-
Byte A group of 8 bits.
tions network such as a LAN or the Internet.
Cable modem A modem that transmits data through
Environment A computer’s hardware and soft-
a coaxial cable television network.
ware configuration. Also referred to as platform.
Cache High-speed memory used to store frequently Environment types include desktop, multiuser, net-
sa

used data so that it can be quickly retrieved by an work, handheld, distributed, multiprocessing, and
application. multitasking.

Client A computer that is sent information from a Ergonomics The science that studies safe work
server computer. environments.

Client/server network A type of network that Extension Added after a file name to distinguish
consists of a group of computers, called clients con- file types.
nected to a server computer.
Extranet An extended intranet that provides vari-
Clock rate The speed at which a CPU can execute ous levels of access to authorized members of the
instructions, measured in megahertz or gigahertz. public.

Compiler A program that converts an entire pro- Expansion boards Circuit boards that connect to the
gram into machine code before the program is motherboard to add functionality to the computer.
executed.
File A collection of related data stored on a lasting
Control bus Carries control signals. medium.

Conventional modem A modem that uses stan- Firewall A network security system that prevents
dard telephone lines to convert analog signals to unauthorized network access.
digital data.

Chapter 1 An Introduction to Computers 25


Folder Used to organize commonly related files. Leased line A telecommunication option used
for a permanent connection to the Internet that is
Gigabytes (GB) Approximately one billion bytes.
always active.
Gigahertz (GHz) Billion of cycles per second.
Logical topology Refers to the way in which data
Hacker see Cracker. is passed between the nodes on a network.

Handheld computer A mobile computing device. Low-level programming languages First and
second generation programming languages including
Hardware The physical components of the computer, machine language and assembly language.
such as the monitor and system unit.
Mailing list server A server that manages mailing
Hexadecimal system Number system based on 16 lists for groups of users.
digits. Also called base 16.
Magnetic technology Storage device technology that
High-level programming languages Third uses a mechanical drive with tiny electro-magnetic
generation programming languages that have heads for reading and writing data to media.
English-like instructions.
Match A web page that contains the search
Hub A communication device that joins communica-

e
criteria.
tion lines at a central location on the network.
Mbps Millions of bits per second.
Information age Present time characterized
by increasing dependence on the computer’s Megabytes (MB) Approximately one million
pl
ability to store and manipulate large amounts of
information.
Input device Device used to enter data and instruc-
tions into the computer.
Integrated circuits (ICs) A silicon wafer with intri-
bytes.
Megahertz (MHz) Million of cycles per second.
Memory-resident A program that is always in
memory.
Minus sign (–) Used in search criteria to exclude
cate circuits etched into its surface and then coated
unwanted web pages.
with a metallic oxide that fills in the etched circuit
m
patterns. Also called a chip. Modern Language Association (MLA) Organization
that publishes standards used for citations.
Interactive Information accessed as a result of
selections made by the user. Motherboard The main circuit board inside the
base unit.
Internet The largest and most widely accessed
network. Netiquette The etiquette that should be followed
sa

when using a network.


Interpreter A program that translates and
executes an instruction before moving on to the Network A combination of software and hardware
next instruction in the program. that allows computers to exchange data and to share
software and devices, such as printers.
Intranet A network that is used by a single organi-
zation and only accessible by authorized users. Net work architect ure The st ruct ure of a
network.
ISDN (Integrated Services Digital Network) A
digital telephone network provided by a local tele- Network interface card A circuit board that goes
phone company. into a computer or other device in a LAN.

IT (Information Technology) A term that Network operating system Software that allows
encompasses all aspects of computer-related users and devices to communicate over a network.
technology.
Node A location on the network capable of processing
Kbps Thousands of bits per second. information, such as a computer or a printer.

Kilobytes (K) Approximately a thousand bytes. Notebook A portable, lightweight computer.

LAN (Local Area Network) A network used to


connect devices within a small area.

26 Chapter 1 An Introduction to Computers


Object-oriented programming (OOP) An approach Ring topology A physical LAN topology where each
to programming where modules are created that can node is connected to form a closed loop.
be used over and over again.
ROM (Read Only Memory) Memory that stores
Online profiling A marketing technique that data and is a permanent part of the computer.
collects online data about consumers.
Roundoff error An error that occurs when there
Operating system Software that allows the user are not enough bits to hold the mantissa.
to communicate with the computer. Types include
Router A device that connects different network
multiuser, multiprocessing, multitasking, multi-
technologies.
threading, or real time.
Search criteria A single word or phrase that is used
Optical technology Storage device technology
by the search engine to match web pages.
that uses a drive with a laser and optoelectronic
sensor. Search engine A program that searches a database
of web pages for keywords and then lists hyperlinks
Output device A device used to convey processed
to pages that contain those keywords.
data.
Secondary memory Any type of storage media.

e
Overflow error An error that occurs when the num-
ber of bits that are needed to represent the integer Server A computer used to manage network func-
is greater than four bytes. tions such as communication and data sharing.
Over writes Updates an original file with Smartphone Cellular phone that is able to send and

pl
changes.
Peer-to-peer network A type of network that does
not have a server.
Peripheral device A device attached to a PC.
Phishing The act of sending an e-mail to a user
falsely claiming to be a legitimate business in an
receive e-mail messages and access the Internet.
Solid state technology Storage device technology
that requires no moving parts.
SRAM (Static Random Access Memory) High-
speed memory referred to as cache.
Star topology A physical LAN topology where
m
attempt to trick the user into revealing personal each node is attached to a hub.
information that could be used for crimes such as
identity theft Storage devices Devices that use persistent media
to maintain files. Also referred to as drives, mass
Piracy Illegally copying or distributing software. storage, and auxiliary storage.
Plus sign (+) Used in search criteria to limit a search Subject tree A list of sites separated into
sa

to only those web pages containing two or more categories.


specified words.
Tablet PC A computer designed similar to a pad
Port Used to attach a peripheral device to a of paper.
computer.
TCP/IP (Transmission Control Protocol/Internet
Privacy policy A legally binding document that Protocol) Software used by networks connected
explains how any personal information will be to routers to communicate.
used.
Telecommunications The transmitting and receiv-
Programming languages A set of words, codes, and ing of data.
symbols that allows a programmer to communicate
with the computer. Topology The physical or logical arrangement of
the nodes on a network.
RAM (Random Access Memory) Memory that
temporarily stores data and instructions. Also called Transmission media The media that joins the nodes
primary or main memory. on a network to enable communication.

Real numbers Numbers that contain decimal Trojan horse Malicious code in the form of a program
points. that appears as something else, usually a program
that looks trustworthy.
Real time Occurs immediately.

Chapter 1 An Introduction to Computers 27


Ultra-portable devices Storage devices, such as
keychains, that are small and easy-to-use.
Unicode A digital code that uses a set of sixteen
1s and 0s to form a 16-bit binary code for each
symbol.
Utility program Program run by the operating
system to manage input and output, read and write
to memory, manage the processor, maintain system
security, and manage files and disks.
Virus A program that is designed to reproduce
itself by copying itself into other programs stored
on a computer without the user’s knowledge.
WAN (Wide Area Network) A network used to con-
nect computers over large geographical distances.

e
Wearable computer A mobile computing device
that is incorporated into clothing, eyewear, wrist-
wear, and other wearables.
Web See World Wide Web.
pl
Web beacon A tiny, transparent graphic located on
a web page used to collect data about the web page
user. Also called a web bug or pixel tag.
Web browser Interprets an HTML document to
display a web page.
Web directory See Subject tree.
m
Wireless network A type of network that does not
require the use of cables.
Word Bits grouped in units of 16 to 64.
World Wide Web The most widely used Internet
sa

service. Used to search and access information


available on the Internet.
Worm Program that is able to reproduce itself over
a network.

28 Chapter 1 An Introduction to Computers


Discovering Diverse Content Through
Random Scribd Documents
The Project Gutenberg eBook of Stories of the
Bible, Volume 1: The People of the Chosen
Land
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: Stories of the Bible, Volume 1: The People of the Chosen Land

Author: Myles Endicott

Illustrator: Gustave Doré

Release date: August 26, 2020 [eBook #63047]


Most recently updated: October 18, 2024

Language: English

Credits: Produced by Bryan Ness, Steve Read and the Online


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

*** START OF THE PROJECT GUTENBERG EBOOK STORIES OF THE


BIBLE, VOLUME 1: THE PEOPLE OF THE CHOSEN LAND ***
STORIES OF THE BIBLE

The People
of the

Chosen Land

by
MYLES ENDICOTT

ILLUSTRATIONS FROM DORÉ AND OTHER EMINENT ARTISTS

Volume I.

EDUCATIONAL PUBLISHING COMPANY


BOSTON

New York Chicago San Francisco


Copyrighted
By EDUCATIONAL PUBLISHING COMPANY
1897
CREATION OF LIGHT
CONTENTS
THE CREATION
THE GARDEN OF EDEN
THE FLOOD
THE TOWER OF BABEL
ABRAHAM
ABRAHAM'S VISIONS
HAGAR
ISAAC
REBEKAH
JACOB AND ESAU
JOSEPH
PHARAOH'S DREAM
JOSEPH'S BROTHERS
THE STORY OF MOSES
MOSES' VISION
THE PLAGUES OF EGYPT
THE RED SEA
MIRIAM'S SONG
IN THE WILDERNESS
THE TABERNACLE
THE PROMISED LAND
THE STORY OF JOSHUA
THE GIBEONITES
EHUD AND DEBORAH
THE STORY OF GIDEON
ABIMELECH
THE STORY OF SAMSON
THE STORY OF RUTH AND NAOMI
THE STORY OF SAMUEL
CREATION OF THE SUN AND MOON.

STORIES OF THE BIBLE.

THE CREATION.
Many, many years ago there was no earth. There were no plants,
nor animals; no sun; no moon; neither were there any people.
All was darkness.
Then God looked into the darkness and said, "Let there be light."
And light came. And out of the new light God created the blue sky,
the deep sea, the beautiful grass-covered earth, the plants, the
trees, and the many-colored flowers.
THE CREATION OF ANIMALS. (Raphael.)

And in the blue sky he placed the golden sun, the silver moon, and
the stars that shine like jewels in the sky.
Then, in the water he placed the fishes; on the earth, the animals;
and in the tree tops the birds sang their praises.
"This shall be for a home for man," the Creator said; and so, one
morning, there woke to life in the Garden of Eden a man and woman
—beautiful and good and pure.
To the animals God had given strength and speed, and fur for
protection from the wind and rain. To the birds he had given
plumage, brilliant and warm. To the fishes, fins and scales.
Then man came; and to him was given intelligence, and reason, and
power to grow in wisdom; for by these was he to protect himself
from the elements and gain dominion over all the earth,—the fishes,
the birds, and the animals thereof.
Then God blessed everything he had made; for he loved what he
had made, and surrounded it with all that was beautiful and good.
"Of every tree in the garden ye may eat," He had said to Adam and
Eve, "except the tree of Knowledge-of-Good-and-of-Evil. Of that eat
not lest ye die."

THE CREATION.
The spacious firmament on high,
With all the blue ethereal sky,
And spangled Heavens, a shining frame,
Their great Original proclaim.
The unwearied sun, from day to day,
Does his Creator's power display,
And publishes to every land
The work of an almighty hand.

Soon as the evening shades prevail,


The moon takes up the wondrous tale,
And nightly to the listening earth
Repeats the story of her birth;
Whist all the stars around her burn,
And all the planets, in their turn,
Confirm the tidings as they roll,
And spread the truth from pole to pole.

What though in solemn silence all


Move round this dark terrestrial ball!
What though no real voice or sound
Amidst their radiant orbs be found!—
In reason's ear they all rejoice,
And utter forth a glorious voice;
Forever singing as they shine,
"The hand that made us is Divine."

—Joseph Addison.
CREATION OF TERRA FIRMA. (Raphael.)

THE GARDEN OF EDEN.


When Adam and Eve looked out upon the world round about them;
when they saw the flowers and the grasses; when they heard the
splashing of the sun-lit waters, and the rustling of the soft branches,
—then their hearts were filled with love for each other, for their
home, and for the Father who had made all this joy for them.
For a long time they wandered up and down the Garden of Eden,
singing songs, and ready always to hear the voice of God when he
spoke to them in the soft winds that played among the tree tops.
Now, there was a wicked angel, named Satan. He had been cast out
from heaven, down, down from the blue sky. And in his own
unhappy home he dwelt now, alone, wretched and revengeful. And
when he saw this happy man and woman, so good and pure, their
hearts bounding with love to God and joy in right doing, his cruel
face grew black.
"Such happiness shall not last," he said. So he crept into the Garden,
took on the form of a serpent and spoke to Eve.
"Eat of the fruit of this tree," he said, "and give it to Adam that he
may eat too."
"But we are forbidden," Eve said.
"The fruit is like no other. Eat! Ye shall not die," the serpent
answered.

THE EXPULSION OF ADAM AND EVE FROM THE GARDEN OF EDEN. (Dore.)
Then Eve gathered the fruit and ate of it. It was sweet, even as the
serpent had said. Then she gathered more, and Adam, too, ate of it.
Then darkness fell upon the earth. A great wind arose, the thunder
rolled, and God drove Adam and Eve out from the Garden of Eden;
and at the entrance He placed cherubims and a flaming sword for no
one who had sinned could dwell in a land so beautiful and free from
sorrow.
But God pitied these children of his; and, although they had sinned
against him, he saw that, after long years of suffering, One should
be born, who would bring back to earth the joy and peace and
happiness that had once been theirs, and which would have been to
all their children in all the time to come, had not these parents
sinned.
And so Adam and Eve went out into the world to work and struggle
and build homes for themselves.
ADAM AND EVE. (Raphael.)

By and by two baby boys were born to them,—Cain and Abel. Pure
and kind and good these children should have been. But now they
were born into a world of sin, and of the nature of sin they too
partook.
When these children were grown men, Cain hated his brother. He
grew sullen and revengeful towards him. The serpent that had
tempted Adam and Eve now tempted him. He listened; and one day,
when they were at work together in the field, Cain slew Abel and hid
him in the earth.
Then a great storm gathered across the sky; and a voice said, "Cain,
where is thy brother?"
Cain trembled with fear; for he knew it was the voice of God. But he
raised his wicked face towards the heavens and cried, "Why should I
know? Am I my brother's keeper?"
And the voice said, "Thou art thy brother's keeper."
Then God put a brand upon the brow of Cain, and drove him forth
into the wilderness, to be a fugitive and a vagabond.

STATUE OF CAIN. (Giovanni Dupre.)


THE CURSE OF CAIN.
O, the wrath of the Lord is a terrible thing!—
Like the tempest that withers the blossoms of spring,
Like the thunder that bursts on the summer's domain,
It fell on the head of the homicide Cain.

And, lo! like a deer in the fright of the chase,


With a fire in his heart, and a brand on his face,
He speeds him afar to the desert of Nod,—
A vagabond, smote by the vengeance of God!

All nature, to him, has been blasted and banned,


And the blood of a brother yet reeks on his hand;
And no vintage has grown, and no fountain has sprung,
For cheering his heart, or for cooling his tongue.

The groans of a father his slumber shall start,


And the tears of a mother shall pierce to his heart,
And the kiss of his children shall scorch him like flame,
When he thinks of the curse that hangs over his name.

—Knox.
THE DOVE SENT FORTH FROM THE ARK.
THE FLOOD.
Earth shall be ocean! and no breath,
Save of the winds be on the unbounded wave!
Angels shall tire their wings, but find no spot:
Not even a rock from out the liquid grave
Shall lift its point to save,
Or show the place where strong despair hath died,
After long looking o'er the ocean wide
For the expected ebb which cometh not;
All shall be void, destroyed.

—Byron.
It was many, many years after Adam and Eve were driven out from
the Garden of Eden that the flood came.
There were thousands of people in the world now, and they were
scattered here and there through the fertile valleys and along the
rivers of the country far and wide.
There were rich farms everywhere, and shepherds watched their
flocks on the hillsides. There were towns and cities; many of them
where people dwelt together and made their laws and appointed
their law-givers.
But in all these years the people had been growing more and more
away from the simple, honest life that God had first shown Adam
and Eve.
They had grown selfish and greedy; they were cruel to each other;
they cared nothing for the rights and comforts of the community;
and more than all this, they had forsaken the simple faith of their
fathers and become worshippers of idols.
There was one good man dwelling among these people, many, many
years before, whose name was Enoch. Now, it was not the will of
God that Enoch should suffer for the sins of the people; and so,
when the flood was about to come upon the earth to destroy them,
God came and stood by Enoch and said, "Come with me."
Now there was another good man upon the earth, a great grandson
of Enoch's, and a man who had never forgotten God, and who had
reared his children always in the simple faith which had been his
own.
Although God meant to send a flood that should destroy the cities,
and separate the people so that the wickedness of the earth might
be destroyed, still it was not his wish that the race should perish
wholly. And so again God went down to the earth, and said to this
good man, Noah, "Build thou an ark, and into it bring all thy family,
and also two of every kind of bird and beast and animal. For a great
flood shall come upon the earth, and those in the ark only shall be
saved."
Noah was a simple hearted man. It was a strange thing for him to
be told to build an ark and place within its shelter his family and two
of every living thing upon the face of the earth.
NOAH BUILDING THE ARK. (Raphael.)

He told the people what God had said to him; and he urged them to
do likewise. But the people only laughed at him, and called him a
fool.
But Noah doubted not the word of God and set to work at once,—his
three sons, Ham, Shem, and Japheth helping him to build an ark,
and to gather together the birds and beasts and animals of the
earth.
Every morning the four men set out as soon as the sun had risen,
and kept at their work until darkness fell at night.
At last the ark was finished, and Noah, with his wife, his three sons
and their wives, journeyed to the mountain side. The people in the
valley laughed at them and threw stones at them, but the trustful
little band kept on their way and entered the ark, taking with them,
as they had been told, two of every kind of bird and beast.
Then the clouds began to gather in the south,—great black rolls of
cloud. The wind rose, the clouds scattered over the whole sky; and
so black and thick were they that the light of the sun was shut out.
It was like night.

THE DELUGE.

Then the rain fell. In great sheets, like rivers, it poured upon the
valleys. The thunders rolled, the lightnings flashed, the rivers
overflowed their banks. The winds howled, and great trees were
torn up by the roots.
For forty days this storm continued—forty days and forty nights.
Every living thing left upon the face of the earth was drowned. But
the ark, with its inmates, was borne up by the waters in safety. At
last, one morning when Noah and his people awoke, they could see
that the storm had ceased; the clouds were separating, and the sun
was sending its rays down through the mist upon the flooded earth
below.
Then came the beautiful rainbow, spanning the heavens in the west,
and reflecting its wonderful colors in the great sea below.

THE RAINBOW.
Triumphal arch, that fill'st the sky
When storms prepare to part,
I ask not proud philosophy
To teach me what thou art.

Still seem as to my childhood's sight,


A midway station given,
For happy spirits to alight
Betwixt the earth and heaven.

How glorious is thy girdle cast


O'er mountain, tower, and town,
Or mirror'd in the ocean vast,
A thousand fathoms down.

As fresh in yon horizon dark,


As young thy beauties seem,
As when the eagle from the ark
First sported in thy beam.

For faithful to its sacred page,


Heaven still rebuilds thy span,
Nor lets the type grow pale with age,
That first spoke peace to man.

—T. Campbell.
Never was rainbow so beautiful! Then the voice of God spoke from
out the skies to Noah, "This shall be to you a bow of promise. Never
again shall the earth and the people be destroyed by water."
Welcome to Our Bookstore - The Ultimate Destination for Book Lovers
Are you passionate about books and eager to explore new worlds of
knowledge? At our website, we offer a vast collection of books that
cater to every interest and age group. From classic literature to
specialized publications, self-help books, and children’s stories, we
have it all! Each book is a gateway to new adventures, helping you
expand your knowledge and nourish your soul
Experience Convenient and Enjoyable Book Shopping Our website is more
than just an online bookstore—it’s a bridge connecting readers to the
timeless values of culture and wisdom. With a sleek and user-friendly
interface and a smart search system, you can find your favorite books
quickly and easily. Enjoy special promotions, fast home delivery, and
a seamless shopping experience that saves you time and enhances your
love for reading.
Let us accompany you on the journey of exploring knowledge and
personal growth!

ebookgate.com

You might also like