0% found this document useful (0 votes)
16 views39 pages

Java For Students 5th Edition Edition Bell

The document promotes various educational ebooks available for download at ebookname.com, including titles like 'Java for Students 5th Edition' and 'Java For Dummies 5th Edition.' It highlights the features of the 'Java for Students' book, which is aimed at beginners and covers programming principles, GUI development, and includes exercises. The document also provides links to additional resources and companion websites for further learning.

Uploaded by

panjulheikel65
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
0% found this document useful (0 votes)
16 views39 pages

Java For Students 5th Edition Edition Bell

The document promotes various educational ebooks available for download at ebookname.com, including titles like 'Java for Students 5th Edition' and 'Java For Dummies 5th Edition.' It highlights the features of the 'Java for Students' book, which is aimed at beginners and covers programming principles, GUI development, and includes exercises. The document also provides links to additional resources and companion websites for further learning.

Uploaded by

panjulheikel65
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/ 39

Endless Ebook, One Click Away – Start Downloading at ebookname.

com

Java for Students 5th Edition Edition Bell

https://ebookname.com/product/java-for-students-5th-edition-
edition-bell/

OR CLICK HERE

DOWLOAD EBOOK

Browse and Get More Ebook Downloads Instantly at https://ebookname.com


Click here to visit ebookname.com and download ebook now
Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...

Java For Dummies 5th Edition Barry Burd

https://ebookname.com/product/java-for-dummies-5th-edition-barry-
burd/

Elementary geometry for college students 5th ed Edition


Alexander

https://ebookname.com/product/elementary-geometry-for-college-
students-5th-ed-edition-alexander/

Research methods for business students 5th Edition


Edition Mark Saunders

https://ebookname.com/product/research-methods-for-business-
students-5th-edition-edition-mark-saunders/

Cytokines in Human Health Immunotoxicology Pathology


and Therapeutic Applications 1st Edition Theresa L.
Whiteside (Auth.)

https://ebookname.com/product/cytokines-in-human-health-
immunotoxicology-pathology-and-therapeutic-applications-1st-
edition-theresa-l-whiteside-auth/
The Mechanical Universe Mechanics and Heat Steven C.
Frautschi

https://ebookname.com/product/the-mechanical-universe-mechanics-
and-heat-steven-c-frautschi/

New Materials Processes and Methods Technology 1st


Edition Mel Schwartz (Author)

https://ebookname.com/product/new-materials-processes-and-
methods-technology-1st-edition-mel-schwartz-author/

Founder of Hasidism A Quest for the Historical Ba al


Shem Tov Moshe Rosman

https://ebookname.com/product/founder-of-hasidism-a-quest-for-
the-historical-ba-al-shem-tov-moshe-rosman/

Essays A Fully Annotated Edition Henry David Thoreau


(Editor)

https://ebookname.com/product/essays-a-fully-annotated-edition-
henry-david-thoreau-editor/

Mayday Asking for Help in Times of Need M Nora Klaver

https://ebookname.com/product/mayday-asking-for-help-in-times-of-
need-m-nora-klaver/
the physics of solar flares 1st Edition Einar Tandberg-
Hanssen

https://ebookname.com/product/the-physics-of-solar-flares-1st-
edition-einar-tandberg-hanssen/
JAVA
sixth

six ition
'The best book for my first year edition

ed
programming students.'

th
Gary Hill, The University of Northampton

JAVA
s
'It is really hard to fault it or find a better book.'

t
Ken Chisholm, Edinburgh Napier University

e n
'An excellent rewarding introduction to

d
Java programming.’
FOR

t u
Dr Simon Jones, University of Stirling

S
If you are new to computer programming then this book is for you! Starting from
scratch, it assumes no prior knowledge of programming and is written in a simple,
direct style for maximum clarity.

FOR
This sixth edition of Java for Students has been fully updated to include the new
features of Java 6.0. The authors’ GUI-based approach helps students to build their
programming skills by producing exciting and dynamic graphical output.

Students
Key features
 A focus on applications and GUI development with Swing.
 Graphics are used from the start to promote interest and enjoyment and
to illustrate programming principles.
 UML 2.0 is used for modelling and design.
 A wealth of exercises and self-test questions with solutions.

Check out the companion website for the book at www.pearsoned.co.uk/bell


to find additional resources for both students and instructors.

ABOUT THE AUTHORS


Douglas Bell and Mike Parr have many years experience teaching programming
in the UK. They have written a number of programming books, including the
bestselling Java for Students, Visual Basic for Students and C# for Students. They
continue to teach and learn about programming with enthusiasm.
BELL
Cover illustration by Gary Thompson

&
PARR

www.pearson-books.com
DOUGLAS BELL & MIKE PARR
CVR_BELL1221_06_SE_CVRindd 1 4/2/10 14:11:38
A01_BELL1221_06_SE_FM.QXD 2/11/10 2:22 PM Page i

Java for
Students

Visit the Java for Students, sixth edition Companion Website


at www.pearsoned.co.uk/bell to find valuable student
learning material including:
n How to download Java 6.0
n Programs from the book
n An extra chapter on Java network programming
A01_BELL1221_06_SE_FM.QXD 2/11/10 2:22 PM Page ii

We work with leading authors to develop the


strongest educational materials in computing,
bringing cutting-edge thinking and best
learning practice to a global market.

Under a range of well-known imprints, including


Prentice Hall, we craft high quality print and
electronic publications which help readers to
understand and apply their content, whether
studying or at work.

To find out more about the complete range of our


publishing, please visit us on the World Wide Web at:
www.pearsoned.co.uk
A01_BELL1221_06_SE_FM.QXD 2/11/10 2:22 PM Page iii

Java
for Students
DOUGLAS BELL
MIKE PARR

Sixth edition
A01_BELL1221_06_SE_FM.QXD 2/11/10 2:22 PM Page iv

Pearson Education Limited


Edinburgh Gate
Harlow
Essex CM20 2JE
England
and Associated Companies throughout the world

Visit us on the World Wide Web at:


www.pearsoned.co.uk

Sixth edition published 2010

© Prentice Hall Europe 1998


© Pearson Education Limited 2001, 2010

The rights of Douglas Bell and Mike Parr to be identified


as authors of this work have been asserted by them in
accordance with the Copyright, Designs and Patents Act 1988.

All rights reserved. No part of this publication may be reproduced, stored in a


retrieval system, or transmitted in any form or by any means, electronic, mechanical,
photocopying, recording or otherwise, without either the prior written permission
of the publisher or a licence permitting restricted copying in the United Kingdom
issued by the Copyright Licensing Agency Ltd, Saffron House, 6–10 Kirby Street,
London EC1N 8TS.

All trademarks used herein are the property of their respective owners. The use of any
trademark in this text does not vest in the author or publisher any trademark ownership
rights in such trademarks, nor does the use of such trademarks imply any affiliation with
or endorsement of this book by such owners.

ISBN: 978-0-273-73122-1

British Library Cataloguing-in-Publication Data


A catalogue record for this book is available from the British Library

Library of Congress Cataloging-in-Publication Data


Bell, Doug, 1944–
Java for students / Douglas Bell, Mike Parr. – 6th ed.
p. cm.
Includes index.
ISBN 978-0-273-73122-1 (pbk.)
1. Java (Computer program language) I. Parr, Mike, 1949– II. Title.
QA76.73.J38B45 2010
005.13′3–dc22
2009051149

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

Typeset in 9.75/12pt Galliard by 35


Printed in Great Britain by Henry Ling Ltd., at the Dorset Press, Dorchester, Dorset

The publisher’s policy is to use paper manufactured from sustainable forests.


A01_BELL1221_06_SE_FM.QXD 2/11/10 2:22 PM Page v

Contents

Detailed contents vii


Introduction xix
Guided tour xxiv

1 The background to Java 1


2 First programs 8
3 Using graphics methods 22
4 Variables and calculations 35
5 Methods and parameters 60
6 Using objects 88
7 Selection 115
8 Repetition 152
9 Writing classes 171
10 Inheritance 194
11 Calculations 210
12 Array lists 228
13 Arrays 242
14 Arrays – two dimensional 265
15 String manipulation 278
16 Exceptions 301
17 Files and console applications 318
18 Object-oriented design 348
19 Program style 369

v
A01_BELL1221_06_SE_FM.QXD 2/11/10 2:22 PM Page vi

vi Contents

20 Testing 383
21 Debugging 397
22 Threads 406
23 Interfaces 416
24 Programming in the large – packages 426
25 Polymorphism 432
26 Java in context 441

Appendices 454

Index 522
A01_BELL1221_06_SE_FM.QXD 2/11/10 2:22 PM Page vii

Detailed contents

Introduction xix
Guided tour xxiv

1 The background to Java 1


The history of Java 1
The main features of Java 2
What is a program? 3
Programming principles 5
Programming pitfalls 5
Summary 6
Exercises 6
Answers to self-test questions 7

2 First programs 8
Introduction 8
Integrated development environments 9
Files and folders 9
Creating a Java program 10
The libraries 13
Demystifying the program 14
Objects, methods: an introduction 15
Classes: an analogy 16
Using a text field 17
Programming principles 19
Programming pitfalls 19
Grammar spot 20

vii
A01_BELL1221_06_SE_FM.QXD 2/11/10 2:22 PM Page viii

viii Detailed contents

New language elements 20


Summary 20
Exercises 21
Answers to self-test questions 21

3 Using graphics methods 22


Introduction 22
Events 22
The button-click event 24
The graphics coordinate system 25
Explanation of the program 25
Methods for drawing 27
Drawing with colours 28
Creating a new program 28
The sequence concept 29
Adding meaning with comments 31
Programming principles 31
Programming pitfalls 32
Grammar spot 32
New language elements 32
Summary 32
Exercises 32
Answers to self-test questions 33

4 Variables and calculations 35


Introduction 35
The nature of int 36
The nature of double 36
Declaring variables 37
The assignment statement 41
Calculations and operators 41
The arithmetic operators 42
The % operator 45
Joining strings with the + operator 46
Converting between strings and numbers 47
Message dialogs and input dialogs 49
Formatting text in dialogs with \n 51
Converting between numbers 52
Constants: using final 53
The role of expressions 54
Programming principles 55
Programming pitfalls 55
Grammar spot 56
New language elements 56
Summary 57
A01_BELL1221_06_SE_FM.QXD 2/11/10 2:22 PM Page ix

Detailed contents ix

Exercises 57
Answers to self-test questions 59

5 Methods and parameters 60


Introduction 60
Writing your own methods 61
A first method 62
Calling a method 64
Passing parameters 64
Formal and actual parameters 66
A triangle method 67
Local variables 70
Name clashes 71
Event-handling methods and main 72
return and results 73
Building on methods: drawHouse 76
Building on methods: areaHouse 78
this and objects 79
Overloading 80
Programming principles 81
Programming pitfalls 82
Grammar spot 82
New language elements 83
Summary 83
Exercises 83
Answers to self-test questions 86

6 Using objects 88
Introduction 88
Instance variables 89
Instantiation: using constructors with new 92
The Random class 92
The main method and new 97
The Swing toolkit 98
Events 98
Creating a JButton 99
Guidelines for using objects 101
The JLabel class 101
The JTextField class 103
The JPanel class 104
The Timer class 104
The JSlider class 106
The ImageIcon class – moving an image 109
Programming principles 111
Programming pitfalls 112
A01_BELL1221_06_SE_FM.QXD 2/11/10 2:22 PM Page x

x Detailed contents

Grammar spot 112


New language elements 112
Summary 112
Exercises 112
Answers to self-test questions 114

7 Selection 115
Introduction 115
The if statement 116
if...else 118
Comparison operators 121
Multiple events 129
And, or, not 131
Nested ifs 134
switch 136
Boolean variables 139
Comparing strings 143
Programming principles 143
Programming pitfalls 143
Grammar spot 145
New language elements 146
Summary 146
Exercises 147
Answers to self-test questions 149

8 Repetition 152
Introduction 152
while 153
for 158
And, or, not 159
do...while 161
Nested loops 163
Combining control structures 164
Programming principles 165
Programming pitfalls 165
Grammar spot 166
New language elements 166
Summary 167
Exercises 167
Answers to self-test questions 169

9 Writing classes 171


Introduction 171
Designing a class 172
A01_BELL1221_06_SE_FM.QXD 2/11/10 2:22 PM Page xi

Detailed contents xi

Classes and files 175


private variables 177
public methods 177
The get and set methods 179
Constructors 180
Multiple constructors 181
private methods 182
Scope rules 184
Operations on objects 185
Object destruction 186
static methods 186
static variables 187
Programming principles 188
Programming pitfalls 189
Grammar spot 190
New language elements 190
Summary 191
Exercises 191
Answers to self-test questions 193

10 Inheritance 194
Introduction 194
Using inheritance 195
protected 196
Scope rules 197
Additional items 197
Overriding 198
Class diagrams 198
Inheritance at work 199
super 200
Constructors 200
final 203
Abstract classes 204
Programming principles 205
Programming pitfalls 206
New language elements 207
Summary 207
Exercises 208
Answers to self-test questions 209

11 Calculations 210
Introduction 210
Library mathematical functions and constants 211
Formatting numbers 211
Case study – money 214
A01_BELL1221_06_SE_FM.QXD 2/11/10 2:22 PM Page xii

xii Detailed contents

Case study – iteration 217


Graphs 218
Exceptions 222
Programming principles 223
Programming pitfalls 223
Summary 223
Exercises 224
Answer to self-test question 227

12 Array lists 228


Introduction 228
Creating an array list and generics 229
Adding items to a list 229
The length of a list 230
Indices 231
Displaying an array list 231
The enhanced for statement 232
Using index values 233
Removing items from an array list 234
Inserting items within an array list 235
Lookup 235
Arithmetic on an array list 236
Searching 238
Programming principles 239
Programming pitfalls 240
New language elements 240
Summary 240
Exercises 241
Answers to self-test questions 241

13 Arrays 242
Introduction 242
Creating an array 244
Indices 245
The length of an array 247
Passing arrays as parameters 247
The enhanced for statement 248
Using constants with arrays 249
Initializing an array 250
A sample program 251
Lookup 253
Searching 254
Arrays of objects 256
Programming principles 257
Programming pitfalls 258
A01_BELL1221_06_SE_FM.QXD 2/11/10 2:22 PM Page xiii

Detailed contents xiii

Grammar spot 259


Summary 259
Exercises 260
Answers to self-test questions 263

14 Arrays – two dimensional 265


Introduction 265
Declaring an array 266
Indices 267
The size of an array 268
Passing arrays as parameters 269
Using constants with two-dimensional arrays 269
Initializing an array 270
A sample program 271
Programming principles 272
Programming pitfalls 273
Summary 273
Exercises 274
Answers to self-test questions 277

15 String manipulation 278


Introduction 278
Using strings – a recap 279
The characters within strings 280
A note on the char type 280
The String class 281
The String class methods 281
Comparing strings 283
Amending strings 285
Examining strings 286
String conversions 289
String parameters 291
An example of string processing 291
String case study – Frasier 292
Programming principles 296
Programming pitfalls 297
Grammar spot 297
New language elements 297
Summary 298
Exercises 298
Answer to self-test question 300

16 Exceptions 301
Introduction 301
Exceptions and objects 303
A01_BELL1221_06_SE_FM.QXD 2/11/10 2:22 PM Page xiv

xiv Detailed contents

When to use exceptions 304


The jargon of exceptions 304
A try–catch example 304
try and scopes 307
The search for a catcher 308
Throwing – an introduction 309
Exception classes 310
Compilation and checked exceptions 310
Catching – the common cases 312
Using the exception class structure 314
Programming principles 314
Programming pitfalls 315
Grammar spot 315
New language elements 315
Summary 316
Exercises 316
Answers to self-test questions 317

17 Files and console applications 318


Introduction 318
File access: stream or random? 319
The essentials of streams 319
The Java I/O classes 320
The BufferedReader and PrintWriter classes 320
File output 321
File input 324
File searching 327
The File class 331
The JFileChooser class 333
Console I/O 336
The System class 336
Using JOptionPane 338
A console example: Finder 338
Reading from a remote site 340
Command-line arguments 342
Programming principles 344
Programming pitfalls 344
Grammar spot 344
New language elements 344
Summary 345
Exercises 346
Answers to self-test questions 347

18 Object-oriented design 348


Introduction 348
The design problem 349
Other documents randomly have
different content
sleep with medicine, and when you were in dreamland they took
that extra hump off your shoulder.”
“I’m glad they did,” said Shaggo. “I feel ever so much better
without it. I begin to feel more like myself—more like when I was
the strongest buffalo on the range in the National Park.”
“I’m pleased to hear that,” said Dido. “Maybe, now, they will teach
you to do tricks.”
“Maybe,” agreed Shaggo.
The doctor with the big beard and the shiny glasses came with the
zoo keepers to look at Shaggo in his cage.
“Ah, my operation was a success,” said the big doctor. “Now that
buffalo will be as good as new.”
And as the days went on and Shaggo became stronger and
stronger and his shoulder healed he did, indeed, become “as good
as new.”
Once more his eyes shone brightly and he held his head up. He no
longer limped about the cage, but walked as well as any of the lions,
tigers or bears in the zoo.
Each day a keeper came to feed Shaggo, and, after a while, the
man put his hand in through the bars and rubbed Shaggo’s head.
And Shaggo felt so grateful to the men for curing his sore shoulder
that the big buffalo did not try to bite or kick or butt with his horns.
He licked the man’s hand with his tongue.
“Well, I guess you are getting tame, Shaggo,” said the keeper. “It
was a good thing we bought you from the circus, and it was a good
thing the doctor made you well. In a little while I will let you out in
the yard to run around. It is not good for a big animal like you to be
shut in a cage all the while.”
And you can imagine how glad Shaggo was when, one day, his
cage was opened and he was allowed to come out. Of course he
was not permitted to roam wherever he pleased, but there was a big
yard in the zoo where he could walk about and even run. And when
he ran and found that his shoulder did not hurt him, Shaggo felt like
bellowing at the top of his voice, he was so glad.
“Now I am myself again!” cried Shaggo.
And Shaggo did enjoy himself in the big yard of the zoological
park. Some camels and zebus, as well as other animals of the kind
that eat grass and hay, were also allowed to roam in this yard, and
many people came to watch them. Shaggo was much admired,
especially his big head and the mighty hump on his back—this was
the real hump that belonged there. The other hump—the sore one—
had been taken off and Shaggo limped no more.
One day some deer were put in the yard with Shaggo and the
camels. The deer had horns, and when Shaggo saw them he
thought of the time he had driven the herd of antelopes away from
the water hole.
Shaggo hit the fence with all his might.

“But we will not quarrel about who is to drink first here,” said one
of the deer. “There is water in the tank, enough for all of us.”
“No,” said Shaggo, “here we are a happy family, and we will not
quarrel.”
In time Shaggo grew to be very good friends with all the other
animals of the zoo, but, best of all, he liked the deer, for they had
come from the far West, the land of the prairies where he used to
live, and they could talk to him about that country.
One day White Tail, the largest of the deer in the zoo, was eating
grass near a wooden fence, and, in some manner, White Tail’s horns
became caught in a crack of the boards. At first the deer thought he
could pull himself loose, but the more he pulled and twisted the
tighter his horn seemed to be caught.
“Help! Help!” finally White Tail called to his animal friends. “I am
caught in the fence and can not get loose!”
Some of the other deer tried to pry him loose with their horns, but
they could not.
“Oh, if only Bundo, the big elephant were here, he could get me
loose!” cried White Tail. “With his strong head he could break the
board that is holding me fast.”
But Bundo was in another part of the zoo then, and no keepers
were near, or one of them would have helped the deer. Then Shaggo
saw what the matter was.
“Ho there!” cried the mighty buffalo. “Stand aside, everybody, and
I’ll get White Tail loose!”
“How can you?” asked Dido, the dancing bear.
“With my big, hard head I can ram that fence and break the board
as easily as anything,” the mighty buffalo answered. “I am not afraid
of hurting my shoulder now. Stand still, White Tail, and I’ll get you
loose.”
White Tail, the deer, stood still, his head held down where his horn
was caught in a crack in the fence. Shaggo backed off a little way,
and then, with his head lowered, he ran across the yard. Taking care
not to bump into White Tail, Shaggo hit the fence with all his might.
There was a crash, a splintering of wood, and the deer was set
free. He shook his head, and said:
“Thank you, Shaggo! You are, indeed, a mighty buffalo.”
“Oh, that was nothing,” said Shaggo. “I could have broken a much
thicker board than that, now my shoulder is well.”
The keepers came running up at the sound of the crash, and
when they saw what Shaggo had done to help the deer they were
very glad. The fence was mended, and fixed so no more animals
would be caught in it.
“It is a good thing to have a big head,” said Dido to Shaggo, when
they went to sleep in their cages that night.
And so, for many years Shaggo, the mighty buffalo, lived in the
zoo, and hundreds of boys and girls came to look at him and admire
him. Sometimes he wished he might go back to the prairies, and see
his old friends, and watch Rumpo and Bumpo knock each other in
somersaults.
“But it is very nice, here in the zoo,” said Shaggo. “And, who
knows? perhaps some day I may join the circus again and travel out
West. Then I would have some wonderful adventures to tell the rest
of the buffaloes.”
But the last I heard of him, Shaggo was still in the zoological park,
and I hope he lives there and is happy for many long years.

THE END
Transcriber’s Notes:
Punctuation and spelling inaccuracies were silently corrected.
Archaic and variable spelling has been preserved.
*** END OF THE PROJECT GUTENBERG EBOOK SHAGGO, THE
MIGHTY BUFFALO: HIS MANY ADVENTURES ***

Updated editions will replace the previous one—the old editions will
be renamed.

Creating the works from print editions not protected by U.S.


copyright law means that no one owns a United States copyright in
these works, so the Foundation (and you!) can copy and distribute it
in the United States without permission and without paying
copyright royalties. Special rules, set forth in the General Terms of
Use part of this license, apply to copying and distributing Project
Gutenberg™ electronic works to protect the PROJECT GUTENBERG™
concept and trademark. Project Gutenberg is a registered trademark,
and may not be used if you charge for an eBook, except by following
the terms of the trademark license, including paying royalties for use
of the Project Gutenberg trademark. If you do not charge anything
for copies of this eBook, complying with the trademark license is
very easy. You may use this eBook for nearly any purpose such as
creation of derivative works, reports, performances and research.
Project Gutenberg eBooks may be modified and printed and given
away—you may do practically ANYTHING in the United States with
eBooks not protected by U.S. copyright law. Redistribution is subject
to the trademark license, especially commercial redistribution.

START: FULL LICENSE


THE FULL PROJECT GUTENBERG LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK

To protect the Project Gutenberg™ mission of promoting the free


distribution of electronic works, by using or distributing this work (or
any other work associated in any way with the phrase “Project
Gutenberg”), you agree to comply with all the terms of the Full
Project Gutenberg™ License available with this file or online at
www.gutenberg.org/license.

Section 1. General Terms of Use and


Redistributing Project Gutenberg™
electronic works
1.A. By reading or using any part of this Project Gutenberg™
electronic work, you indicate that you have read, understand, agree
to and accept all the terms of this license and intellectual property
(trademark/copyright) agreement. If you do not agree to abide by all
the terms of this agreement, you must cease using and return or
destroy all copies of Project Gutenberg™ electronic works in your
possession. If you paid a fee for obtaining a copy of or access to a
Project Gutenberg™ electronic work and you do not agree to be
bound by the terms of this agreement, you may obtain a refund
from the person or entity to whom you paid the fee as set forth in
paragraph 1.E.8.

1.B. “Project Gutenberg” is a registered trademark. It may only be


used on or associated in any way with an electronic work by people
who agree to be bound by the terms of this agreement. There are a
few things that you can do with most Project Gutenberg™ electronic
works even without complying with the full terms of this agreement.
See paragraph 1.C below. There are a lot of things you can do with
Project Gutenberg™ electronic works if you follow the terms of this
agreement and help preserve free future access to Project
Gutenberg™ electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation (“the
Foundation” or PGLAF), owns a compilation copyright in the
collection of Project Gutenberg™ electronic works. Nearly all the
individual works in the collection are in the public domain in the
United States. If an individual work is unprotected by copyright law
in the United States and you are located in the United States, we do
not claim a right to prevent you from copying, distributing,
performing, displaying or creating derivative works based on the
work as long as all references to Project Gutenberg are removed. Of
course, we hope that you will support the Project Gutenberg™
mission of promoting free access to electronic works by freely
sharing Project Gutenberg™ works in compliance with the terms of
this agreement for keeping the Project Gutenberg™ name associated
with the work. You can easily comply with the terms of this
agreement by keeping this work in the same format with its attached
full Project Gutenberg™ License when you share it without charge
with others.

1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside the
United States, check the laws of your country in addition to the
terms of this agreement before downloading, copying, displaying,
performing, distributing or creating derivative works based on this
work or any other Project Gutenberg™ work. The Foundation makes
no representations concerning the copyright status of any work in
any country other than the United States.

1.E. Unless you have removed all references to Project Gutenberg:

1.E.1. The following sentence, with active links to, or other


immediate access to, the full Project Gutenberg™ License must
appear prominently whenever any copy of a Project Gutenberg™
work (any work on which the phrase “Project Gutenberg” appears,
or with which the phrase “Project Gutenberg” is associated) is
accessed, displayed, performed, viewed, copied or distributed:
This eBook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it away
or re-use it under the terms of the Project Gutenberg License
included with this eBook or online at www.gutenberg.org. If you
are not located in the United States, you will have to check the
laws of the country where you are located before using this
eBook.

1.E.2. If an individual Project Gutenberg™ electronic work is derived


from texts not protected by U.S. copyright law (does not contain a
notice indicating that it is posted with permission of the copyright
holder), the work can be copied and distributed to anyone in the
United States without paying any fees or charges. If you are
redistributing or providing access to a work with the phrase “Project
Gutenberg” associated with or appearing on the work, you must
comply either with the requirements of paragraphs 1.E.1 through
1.E.7 or obtain permission for the use of the work and the Project
Gutenberg™ trademark as set forth in paragraphs 1.E.8 or 1.E.9.

1.E.3. If an individual Project Gutenberg™ electronic work is posted


with the permission of the copyright holder, your use and distribution
must comply with both paragraphs 1.E.1 through 1.E.7 and any
additional terms imposed by the copyright holder. Additional terms
will be linked to the Project Gutenberg™ License for all works posted
with the permission of the copyright holder found at the beginning
of this work.

1.E.4. Do not unlink or detach or remove the full Project


Gutenberg™ License terms from this work, or any files containing a
part of this work or any other work associated with Project
Gutenberg™.

1.E.5. Do not copy, display, perform, distribute or redistribute this


electronic work, or any part of this electronic work, without
prominently displaying the sentence set forth in paragraph 1.E.1
with active links or immediate access to the full terms of the Project
Gutenberg™ License.

1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if you
provide access to or distribute copies of a Project Gutenberg™ work
in a format other than “Plain Vanilla ASCII” or other format used in
the official version posted on the official Project Gutenberg™ website
(www.gutenberg.org), you must, at no additional cost, fee or
expense to the user, provide a copy, a means of exporting a copy, or
a means of obtaining a copy upon request, of the work in its original
“Plain Vanilla ASCII” or other form. Any alternate format must
include the full Project Gutenberg™ License as specified in
paragraph 1.E.1.

1.E.7. Do not charge a fee for access to, viewing, displaying,


performing, copying or distributing any Project Gutenberg™ works
unless you comply with paragraph 1.E.8 or 1.E.9.

1.E.8. You may charge a reasonable fee for copies of or providing


access to or distributing Project Gutenberg™ electronic works
provided that:

• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”

• You provide a full refund of any money paid by a user who


notifies you in writing (or by e-mail) within 30 days of receipt
that s/he does not agree to the terms of the full Project
Gutenberg™ License. You must require such a user to return or
destroy all copies of the works possessed in a physical medium
and discontinue all use of and all access to other copies of
Project Gutenberg™ works.

• You provide, in accordance with paragraph 1.F.3, a full refund of


any money paid for a work or a replacement copy, if a defect in
the electronic work is discovered and reported to you within 90
days of receipt of the work.

• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.

1.E.9. If you wish to charge a fee or distribute a Project Gutenberg™


electronic work or group of works on different terms than are set
forth in this agreement, you must obtain permission in writing from
the Project Gutenberg Literary Archive Foundation, the manager of
the Project Gutenberg™ trademark. Contact the Foundation as set
forth in Section 3 below.

1.F.

1.F.1. Project Gutenberg volunteers and employees expend


considerable effort to identify, do copyright research on, transcribe
and proofread works not protected by U.S. copyright law in creating
the Project Gutenberg™ collection. Despite these efforts, Project
Gutenberg™ electronic works, and the medium on which they may
be stored, may contain “Defects,” such as, but not limited to,
incomplete, inaccurate or corrupt data, transcription errors, a
copyright or other intellectual property infringement, a defective or
damaged disk or other medium, a computer virus, or computer
codes that damage or cannot be read by your equipment.

1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except for


the “Right of Replacement or Refund” described in paragraph 1.F.3,
the Project Gutenberg Literary Archive Foundation, the owner of the
Project Gutenberg™ trademark, and any other party distributing a
Project Gutenberg™ electronic work under this agreement, disclaim
all liability to you for damages, costs and expenses, including legal
fees. YOU AGREE THAT YOU HAVE NO REMEDIES FOR
NEGLIGENCE, STRICT LIABILITY, BREACH OF WARRANTY OR
BREACH OF CONTRACT EXCEPT THOSE PROVIDED IN PARAGRAPH
1.F.3. YOU AGREE THAT THE FOUNDATION, THE TRADEMARK
OWNER, AND ANY DISTRIBUTOR UNDER THIS AGREEMENT WILL
NOT BE LIABLE TO YOU FOR ACTUAL, DIRECT, INDIRECT,
CONSEQUENTIAL, PUNITIVE OR INCIDENTAL DAMAGES EVEN IF
YOU GIVE NOTICE OF THE POSSIBILITY OF SUCH DAMAGE.

1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you


discover a defect in this electronic work within 90 days of receiving
it, you can receive a refund of the money (if any) you paid for it by
sending a written explanation to the person you received the work
from. If you received the work on a physical medium, you must
return the medium with your written explanation. The person or
entity that provided you with the defective work may elect to provide
a replacement copy in lieu of a refund. If you received the work
electronically, the person or entity providing it to you may choose to
give you a second opportunity to receive the work electronically in
lieu of a refund. If the second copy is also defective, you may
demand a refund in writing without further opportunities to fix the
problem.

1.F.4. Except for the limited right of replacement or refund set forth
in paragraph 1.F.3, this work is provided to you ‘AS-IS’, WITH NO
OTHER WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.

1.F.5. Some states do not allow disclaimers of certain implied


warranties or the exclusion or limitation of certain types of damages.
If any disclaimer or limitation set forth in this agreement violates the
law of the state applicable to this agreement, the agreement shall be
interpreted to make the maximum disclaimer or limitation permitted
by the applicable state law. The invalidity or unenforceability of any
provision of this agreement shall not void the remaining provisions.

1.F.6. INDEMNITY - You agree to indemnify and hold the Foundation,


the trademark owner, any agent or employee of the Foundation,
anyone providing copies of Project Gutenberg™ electronic works in
accordance with this agreement, and any volunteers associated with
the production, promotion and distribution of Project Gutenberg™
electronic works, harmless from all liability, costs and expenses,
including legal fees, that arise directly or indirectly from any of the
following which you do or cause to occur: (a) distribution of this or
any Project Gutenberg™ work, (b) alteration, modification, or
additions or deletions to any Project Gutenberg™ work, and (c) any
Defect you cause.

Section 2. Information about the Mission


of Project Gutenberg™
Project Gutenberg™ is synonymous with the free distribution of
electronic works in formats readable by the widest variety of
computers including obsolete, old, middle-aged and new computers.
It exists because of the efforts of hundreds of volunteers and
donations from people in all walks of life.

Volunteers and financial support to provide volunteers with the


assistance they need are critical to reaching Project Gutenberg™’s
goals and ensuring that the Project Gutenberg™ collection will
remain freely available for generations to come. In 2001, the Project
Gutenberg Literary Archive Foundation was created to provide a
secure and permanent future for Project Gutenberg™ and future
generations. To learn more about the Project Gutenberg Literary
Archive Foundation and how your efforts and donations can help,
see Sections 3 and 4 and the Foundation information page at
www.gutenberg.org.

Section 3. Information about the Project


Gutenberg Literary Archive Foundation
The Project Gutenberg Literary Archive Foundation is a non-profit
501(c)(3) educational corporation organized under the laws of the
state of Mississippi and granted tax exempt status by the Internal
Revenue Service. The Foundation’s EIN or federal tax identification
number is 64-6221541. Contributions to the Project Gutenberg
Literary Archive Foundation are tax deductible to the full extent
permitted by U.S. federal laws and your state’s laws.

The Foundation’s business office is located at 809 North 1500 West,


Salt Lake City, UT 84116, (801) 596-1887. Email contact links and up
to date contact information can be found at the Foundation’s website
and official page at www.gutenberg.org/contact

Section 4. Information about Donations to


the Project Gutenberg Literary Archive
Foundation
Project Gutenberg™ depends upon and cannot survive without
widespread public support and donations to carry out its mission of
increasing the number of public domain and licensed works that can
be freely distributed in machine-readable form accessible by the
widest array of equipment including outdated equipment. Many
small donations ($1 to $5,000) are particularly important to
maintaining tax exempt status with the IRS.

The Foundation is committed to complying with the laws regulating


charities and charitable donations in all 50 states of the United
States. Compliance requirements are not uniform and it takes a
considerable effort, much paperwork and many fees to meet and
keep up with these requirements. We do not solicit donations in
locations where we have not received written confirmation of
compliance. To SEND DONATIONS or determine the status of
compliance for any particular state visit www.gutenberg.org/donate.

While we cannot and do not solicit contributions from states where


we have not met the solicitation requirements, we know of no
prohibition against accepting unsolicited donations from donors in
such states who approach us with offers to donate.

International donations are gratefully accepted, but we cannot make


any statements concerning tax treatment of donations received from
outside the United States. U.S. laws alone swamp our small staff.

Please check the Project Gutenberg web pages for current donation
methods and addresses. Donations are accepted in a number of
other ways including checks, online payments and credit card
donations. To donate, please visit: www.gutenberg.org/donate.

Section 5. General Information About


Project Gutenberg™ electronic works
Professor Michael S. Hart was the originator of the Project
Gutenberg™ concept of a library of electronic works that could be
freely shared with anyone. For forty years, he produced and
distributed Project Gutenberg™ eBooks with only a loose network of
volunteer support.
Project Gutenberg™ eBooks are often created from several printed
editions, all of which are confirmed as not protected by copyright in
the U.S. unless a copyright notice is included. Thus, we do not
necessarily keep eBooks in compliance with any particular paper
edition.

Most people start at our website which has the main PG search
facility: www.gutenberg.org.

This website includes information about Project Gutenberg™,


including how to make donations to the Project Gutenberg Literary
Archive Foundation, how to help produce our new eBooks, and how
to subscribe to our email newsletter to hear about new eBooks.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

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

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookname.com

You might also like