Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
100% found this document useful (2 votes)
9 views

(eBook PDF) Introduction to Programming Using Python An 1 download

The document is an introduction to programming using Python, emphasizing problem-solving skills and the development of computer programs. It covers various topics such as programming tools, core objects, control flow structures, functions, data processing, and object-oriented programming, with practical exercises and projects included in each chapter. The text aims to provide a thorough understanding of programming concepts while being accessible to beginners.

Uploaded by

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

(eBook PDF) Introduction to Programming Using Python An 1 download

The document is an introduction to programming using Python, emphasizing problem-solving skills and the development of computer programs. It covers various topics such as programming tools, core objects, control flow structures, functions, data processing, and object-oriented programming, with practical exercises and projects included in each chapter. The text aims to provide a thorough understanding of programming concepts while being accessible to beginners.

Uploaded by

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

(eBook PDF) Introduction to Programming Using

Python An 1 pdf download

https://ebooksecure.com/product/ebook-pdf-introduction-to-
programming-using-python-an-1/

Download more ebook from https://ebooksecure.com


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

Python Programming: An Introduction to Computer Science


3rd Edition by John Zelle (eBook PDF)

http://ebooksecure.com/product/python-programming-an-
introduction-to-computer-science-3rd-edition-by-john-zelle-ebook-
pdf/

(eBook PDF) Introduction to Programming Using Visual


Basic 10th Edition

http://ebooksecure.com/product/ebook-pdf-introduction-to-
programming-using-visual-basic-10th-edition/

An Introduction to Parallel Programming 2. Edition


Pacheco - eBook PDF

https://ebooksecure.com/download/an-introduction-to-parallel-
programming-ebook-pdf/

(eBook PDF) Java: An Introduction to Problem Solving


and Programming 7th Edition

http://ebooksecure.com/product/ebook-pdf-java-an-introduction-to-
problem-solving-and-programming-7th-edition/
(eBook PDF) Java: An Introduction to Problem Solving
and Programming 8th Edition

http://ebooksecure.com/product/ebook-pdf-java-an-introduction-to-
problem-solving-and-programming-8th-edition/

(eBook PDF) Python Programming in Context 3rd Edition

http://ebooksecure.com/product/ebook-pdf-python-programming-in-
context-3rd-edition/

Python Programming in Context, 3rd Edition (eBook PDF)

http://ebooksecure.com/product/python-programming-in-context-3rd-
edition-ebook-pdf/

(eBook PDF) Microsoft Visual C#: An Introduction to


Object-Oriented Programming 7th Edition

http://ebooksecure.com/product/ebook-pdf-microsoft-visual-c-an-
introduction-to-object-oriented-programming-7th-edition/

Problem Solving and Python Programming 1st edition -


eBook PDF

https://ebooksecure.com/download/problem-solving-and-python-
programming-ebook-pdf/
Contents

Guide to VideoNotes iii

Guide to Application Topics v

Preface xi

Acknowledgments xv

Chapter 1 An Introduction to Computing


and Problem Solving 1
1.1 An Introduction to Computing and Python 2
1.2 Program Development Cycle 4
1.3 Programming Tools 6
1.4 An Introduction to Python 13

Chapter 2 Core Objects, Variables, Input,


and Output 23
2.1 Numbers 24
2.2 Strings 35
2.3 Output 49
2.4 Lists, Tuples, and Files–An Introduction 58

Key Terms and Concepts 71

Programming Projects 74

Chapter 3 Structures That Control Flow 77


3.1 Relational and Logical Operators 78
3.2 Decision Structures 89
3.3 The while Loop 105
vii
viii ◆ Contents  

3.4 The for Loop 118

Key Terms and Concepts 137

Programming Projects 139

Chapter 4 Functions 143


4.1 Functions, Part 1 144
4.2 Functions, Part 2 164
4.3 Program Design 182

Key Terms and Concepts 186

Programming Projects 188

Chapter 5 Processing Data 191


5.1 Processing Data, Part 1 192
5.2 Processing Data, Part 2 207
5.3 Dictionaries 221

Key Terms and Concepts 235

Programming Projects 238

Chapter 6 Miscellaneous Topics 243


6.1 Exception Handling 244
6.2 Selecting Random Values 251
6.3 Turtle Graphics 257
6.4 Recursion 269

Key Terms and Concepts 277

Programming Projects 278


  Contents ◆ ix

Chapter 7 Object-Oriented Programming 281


7.1 Classes and Objects 282
7.2 Inheritance 295

Key Terms and Concepts 307

Programming Projects 308

Chapter 8 Graphical User Interface 311


8.1 Widgets 312
8.2 The Grid Geometry Manager 325
8.3 Writing GUI Programs 334

Key Terms and Concepts 343

Programming Projects 345

Appendices
Appendix A ASCII Values 349
Appendix B Reserved Words 351
Appendix C Installing Python and IDLE 353

Answers 355

Index 405
This page intentionally left blank
Preface

S ince its introduction in the 1990s, Python has become one of the most widely used
programming languages in the software industry. Also, students learning their first
programming language find Python the ideal tool to understand the development of
computer programs.
My objectives when writing this text were as follows:
1. To develop focused chapters. Rather than covering many topics superficially,
I concentrate on important subjects and cover them thoroughly.
2. To use examples and exercises with which students can relate, appreciate, and feel
comfortable. I frequently use real data. Examples do not have so many embel-
lishments that students are distracted from the programming techniques
illustrated.
3. To produce compactly written text that students will find both readable and informa-
tive. The main points of each topic are discussed first and then the peripheral
details are presented as comments.
4. To teach good programming practices that are in step with modern programming
methodology. Problem-solving techniques, structured programming, and
object-oriented programming are thoroughly discussed.
5. To provide insights into the major applications of computers.

Unique and Distinguishing Features


Programming Projects. Beginning with Chapter 2, every chapter contains programming
projects. The programming projects reflect the variety of ways that computers are
used. The large number and range of difficulty of the programming projects pro-
vide the flexibility to adapt the course to the interests and abilities of the students.
Some programming projects in later chapters can be assigned as end-of-the-semester
projects.
Exercises for Most Sections. Each section that teaches programming has an exercise
set. The exercises both reinforce the understanding of the key ideas of the section
and challenge the student to explore applications. Most of the exercise sets require
the student to trace programs, find errors, and write programs. The answers to every
odd-numbered exercise in the book, with the exception of Section 6.3 (Turtle Graph-
ics) and Chapter 8 (Graphical User Interface), are given at the end of the text. (The
answers to every other odd-numbered exercise from Section 6.3 are given. The Stu-
dent Solutions Manual contains the answer to every odd-numbered exercise in the
book.) A possible output accompanies nearly every programming exercise and pro-
gramming project.
Practice Problems. Practice Problems are carefully selected exercises located at the end
of a section, just before the exercise set. Complete solutions are given following the
exercise set. The practice problems often focus on points that are potentially confusing

xi
xii ◆ Preface 

or are best appreciated after the student has thought about them. The reader should
seriously attempt the practice problems and study their solutions before moving on
to the exercises.
Comments. Extensions and fine points of new topics are deferred to the “Comments”
portion at the end of each section so that they will not interfere with the flow of the
presentation.
Key Terms and Concepts. In Chapters 2 through 8, the key terms and concepts (along
with examples) are summarized at the end of the chapter.
Guide to Application Topics. This section provides an index of programs that deal
with various topics including Business, Economics, Mathematics, and Sports.
VideoNotes. Twenty-four VideoNotes are available at www.pearsonhighered.com/
schneider. VideoNotes are Pearson’s visual tool designed for teaching key program-
ming concepts and techniques. VideoNote icons are placed in the margin of the text
book to notify the reader when a topic is discussed in a video. Also, a Guide to Video
Notes summarizing the different videos throughout the text is included.
Solution Manuals. The Student Solutions Manual contains the answer to every odd-
numbered exercise (not including programming projects). The Instructor Solutions
Manual contains the answer to every exercise and programming project. Both solu-
tion manuals are in pdf format and can be downloaded from the Publisher’s website.
Source Code and Data Files. The programs for all examples and the data files needed
for the exercises can be downloaded from the Publisher’s website.

How to Access Instructor and Student Resource


Materials
Online Practice and Assessment with MyProgrammingLab™
MyProgrammingLab helps students fully grasp the logic, semantics, and syntax of
programming. Through practice exercises and immediate, personalized feedback,
MyProgrammingLab improves the programming competence of beginning students
who often struggle with the basic concepts and paradigms of popular high-level pro-
gramming languages.
A self-study and homework tool, a MyProgrammingLab course consists of hun-
dreds of small practice problems organized around the structure of this textbook. For
students, the system automatically detects errors in the logic and syntax of their code
submissions and offers targeted hints that enable students to figure out what went
wrong—and why. For instructors, a comprehensive gradebook tracks correct and
incorrect answers and stores the code inputted by students for review.
For a full demonstration, to see feedback from instructors and students, or to
get started using MyProgrammingLab in your course, visit www.myprogramminglab
.com.

Instructor Resources
The following protected instructor resource materials are available on the Publisher’s
website at www.pearsonhighered.com/schneider. For username and password infor-
mation, please contact your local Pearson representative.
  Preface  ◆ xiii

• Test Item File


• PowerPoint Lecture Slides
• Instructor Solutions Manual
• VideoNotes
• Programs for all examples and answers to exercises and programming projects
(Data files needed for the exercises are included in the Programs folder.)

Student Resources
Access to the Premium website and VideoNotes tutorials is located at www
.pearsonhighered.com/schneider. Students must use the access card located in the
front of the book to register and access the online material. If there is no access
card in the front of this textbook, students can purchase access by going to www
.­pearsonhighered.com/schneider and selecting “purchase access to premium con-
tent.” Instructors must register on the site to access the material.
The following content is available through the Premium website:
• VideoNotes
• Student Solutions Manual
• Programs for examples (Data files needed for the exercises are included in the
Programs folder.)
This page intentionally left blank
Acknowledgments

M any talented instructors and programmers provided helpful comments and


constructive suggestions during the writing of this text and I am most grateful
for their contributions. The book benefited greatly from the valuable comments of
the following reviewers:
Daniel Solarek, University of Toledo
David M. Reed, Capital University
Debraj De, Georgia State
Desmond Chun, Chabot College
Mark Coffey, Colorado School of Mines
Randall Alexander, College of Charleston
Vineyak Tanksale, Ball State University
Zhi Wei, New Jersey Institute of Technology
Many people are involved in the successful publication of a book. I wish to thank
the dedicated team at Pearson whose support and diligence made this textbook pos-
sible, especially Carole Snyder, Program Manager for Computer Science, Kelsey
Loanes, Editorial Assistant for Computer Science, and Scott Disanno, Team Lead
Product Management.
I would like to thank Jacob Saina for his assistance with every stage in the writing
of the book. Production Editors Pavithra Jayapaul and Greg Dulles did a ­fantastic
job producing the book and keeping it on schedule. I am grateful to John Russo of
the Wentworth Institute of Technology for producing the VideoNotes, to Dr. Kathy
Liszka of the University of Akron for producing the test bank, and to Dr. Steve
­Armstrong of LeTourneau University for producing the PowerPoint slides that
accompany the book. The competence and graciousness of Shylaja Gattupalli at
Jouve India made for a pleasant production process.
I extend special thanks to my editor Tracy Johnson. Her ideas and enthusiasm
helped immensely with the preparation of the book.
David I. Schneider
dis@alum.mit.edu

xv
This page intentionally left blank
1
An Introduction to
­Computing and Problem
Solving
1.1 An Introduction to Computing and Python 2

1.2 Program Development Cycle 4


◆ Performing a Task on the Computer ◆ Program Planning
1.3 Programming Tools 6
◆ Flowcharts ◆ Pseudocode ◆ Hierarchy Chart ◆ Decision Structure
◆ Direction of Numbered NYC Streets Algorithm ◆ Repetition Structure

◆ Class Average Algorithm

1.4 An Introduction to Python 13


◆ Starting IDLE ◆ A Python Shell Walkthrough
◆ A Python Code Editor Walkthrough ◆ An ­Open-​­a-​­Program Walkthrough

1
2 ◆ Chapter 1 An Introduction to ­Computing and Problem Solving

1.1 An Introduction to Computing and Python


An Introduction to Programming Using Python is about problem solving using computers.
The programming language used is Python, but the principles apply to most modern pro-
gramming languages. Many of the examples and exercises illustrate how computers are
used in the real world. Here are some questions that you may have about computers and
programming.

Question: How do we communicate with the computer?


Answer: Programming languages are used to communicate with the computer. At the low-
est level, there is machine language, which is understood directly by the microprocessor
but is difficult for humans to understand. Python is an example of a ­high-​­level language. It
consists of instructions to which people can relate, such as print, if, and input. Some other
­well-​­known ­high-​­level languages are Java, C++, and Visual Basic.

Question: How do we get computers to perform complicated tasks?


Answer: Tasks are broken down into a sequence of instructions, called a program, that
can be expressed in a programming language. Programs can range in size from two or three
instructions to millions of instructions. The process of executing the instructions is called
running the program.

Question: Why did you decide to use Python as the programming language?
Answer: Many people consider Python to be the best language to teach beginners how to
program. We agree. Also, Python is being used by major software companies. Python is
powerful, easy to write and read, easy to download and install, and it runs under Windows,
Mac, and Linux operating systems.

Question: How did the language Python get its name?


Answer: It is named for the British comedy group Monty Python. Python’s creator, Guido
van Rossum, is a fan of the group.

Question: This book uses the editor IDLE to create programs. How did IDLE get its name?
Answer: Idle stands for Integrated DeveLopment Environment. (Some people think the
name was chosen as a tribute to Eric Idle, a founding member of the Monty Python group.)
The IDLE editor has many features (such as color coding and formatting assistance) that
help the programmer.

Question: Python is referred to as an interpreted language. What is an interpreted language?


Answer: An interpreted language uses a program called an interpreter that translates a ­high-​
­level language one statement at a time into machine language and then runs the program.
The ­interpreter will spot several types of errors and terminate the program when one is
encountered.

Question: What are the meanings of the terms “programmer” and “user”?
Answer: A programmer (also called a developer) is a person who solves problems by writing
programs on a computer. After analyzing the problem and developing a plan for solving it,
the programmer writes and tests the program that instructs the computer how to carry out
the plan. The program might be run many times, either by the programmer or by others.
A user is any person who runs the program. While working through this text, you will
function both as a programmer and as a user.
1.1   An Introduction to Computing and Python ◆ 3

Question: What is the meaning of the term “code”?


Answer: The Python instructions that the programmer writes are called code. The pro-
cesses of writing a program is often called coding.

Question: Are there certain characteristics that all programs have in common?
Answer: Most programs do three things: take in data, manipulate data, and produce results.
These operations are referred to as input, processing, and output. The input data might be
held in the program, reside on a disk, or be provided by the user in response to requests
made by the computer while the program is running. The processing of the input data
occurs inside the computer and can take from a fraction of a second to many hours. The
output data are displayed on a monitor, printed on a printer, or recorded on a disk. As a
simple example, consider a program that computes sales tax. An item of input data is the
cost of the thing purchased. The processing consists of multiplying the cost by the sales
tax rate. The output data is the resulting product, the amount of sales tax to be paid.

Question: What are the meanings of the terms “hardware” and “software”?
Answer: Hardware refers to the physical components of the computer, including all periph-
erals, the central processing unit (CPU), disk drives, and all mechanical and electrical
devices. Programs are referred to as software.

Question: How are problems solved with a program?


Answer: Problems are solved by carefully reading them to determine what data are given
and what outputs are requested. Then a ­step-​­by-​­step procedure is devised to process the
given data and produce the requested output.

Question: Many programming languages, including Python, use a ­zero-​­based numbering system.
What is a ­zero-​­based numbering system?
Answer: In a ­zero-​­based numbering system, numbering begins with zero instead of one. For
example, in the word “code”, “c” would be the zeroth letter, “o” would be the first letter,
and so on.

Question: Are there any prerequisites to learning Python?


Answer: You should be familiar with how folders (also called directories) and files are managed
on your computer. Files reside on storage devices such as hard disks, USB flash drives, CDs,
and DVDs. Traditionally, the primary storage devices for personal computers were hard disks
and floppy disks. Therefore, the word disk is frequently used to refer to any storage device.

Question: What is an example of a program developed in this textbook?


Answer: Figure 1.1 shows a possible output of a program from Chapter 3. When it is first
run, the statement “Enter a first name:” appears. After the user types in a first name and

Enter a first name: James


James Madison
James Monroe
James Polk
James Buchanan
James Garfield
James Carter

Figure 1.1 A possible output for a program in Chapter 3.


4 ◆ Chapter 1 An Introduction to ­Computing and Problem Solving

presses the Enter (or return) key, the names of the presidents who have that first name are
displayed.

Question: How does the programmer create the aforementioned program?


Answer: For this program, the programmer writes about 10 lines of code that search a text
file named USpres.txt, and extracts the requested names.

Question: What conventions are used to show keystrokes?


Answer: The combination key1+key2 means “hold down key1 and then press key2”. The
combination Ctrl+C places selected material into the Clipboard. The combination key1/
key2 means “press and release key1, and then press key2”. The combination Alt/F opens
the File menu on a menu bar.

Question: How can the programs for the examples in this textbook be obtained?
Answer: See the preface for information on how to download the programs from the
­Pearson website.

Question: Where will new programs be saved?


Answer: Before writing your first program, you should create a special folder to hold your
programs.

1.2 Program Development Cycle


We learned in Section 1.1 that hardware refers to the machinery in a computer system (such
as the monitor, keyboard, and CPU) and software refers to a collection of instructions,
called a program, that directs the hardware. Programs are written to solve problems or
perform tasks on a computer. Programmers translate the solutions or tasks into a language
the computer can understand. As we write programs, we must keep in mind that the com-
puter will do only what we instruct it to do. Because of this, we must be very careful and
thorough when writing our instructions.

■■ Performing a Task on the Computer


The first step in writing instructions to carry out a task is to determine what the output
should ­be—​­that is, exactly what the task should produce. The second step is to identify the
data, or input, necessary to obtain the output. The last step is to determine how to process
the input to obtain the desired o ­ utput—​­that is, to determine what formulas or ways of
doing things should be used to obtain the output.
This ­problem-​­solving approach is the same as that used to solve word problems in an
algebra class. For example, consider the following algebra problem:
How fast is a car moving if it travels 50 miles in 2 hours?
The first step is to determine the type of answer requested. The answer should be a num-
ber giving the speed in miles per hour (the output). The information needed to obtain the
answer is the distance and time the car has traveled (the input). The formula
speed = distance/time

is used to process the distance traveled and the time elapsed in order to determine the
speed. That is,
1.2   Program Development Cycle ◆ 5

speed = 50 miles/2 hours


= 25 miles per hour

A graphical representation of this ­problem-​­solving process is shown in Fig. 1.2.

+PRWV 2TQEGUUKPI 1WVRWV

Figure 1.2 The ­problem-​­solving process.

We determine what we want as output, get the needed input, and process the input to
produce the desired output.
In the chapters that follow, we discuss how to write programs to carry out the preceding
operations. But first we look at the general process of writing programs.

■■ Program Planning
A baking recipe provides a good example of a plan. The ingredients and the amounts are
determined by what is to be baked. That is, the output determines the input and the process-
ing. The recipe, or plan, reduces the number of mistakes you might make if you tried to
bake with no plan at all. Although it’s difficult to imagine an architect building a bridge or
a factory without a detailed plan, many programmers (particularly students in their first
programming course) try to write programs without first making a careful plan. The more
complicated the problem, the more complex the plan must be. You will spend much less
time working on a program if you devise a carefully thought out ­step-​­by-​­step plan and test
it before actually writing the program.
Many programmers plan their programs using a sequence of steps, referred to as the
Software Development Life Cycle. The following s­ tep-​­by-​­step process will enable you to use
your time efficiently and help you design e­ rror-​­free programs that produce the desired output.

1. Analyze: Define the problem.


Be sure you understand what the program should ­do—​­that is, what the output should
be. Have a clear idea of what data (or input) are given and the relationship between the
input and the desired output.
2. Design: Plan the solution to the problem.
Find a logical sequence of precise steps that solve the problem. Such a sequence of
steps is called an algorithm. Every detail, including obvious steps, should appear in
the algorithm. In the next section, we discuss three popular methods used to develop
the logic plan: flowcharts, pseudocode, and hierarchy charts. These tools help the pro-
grammer break a problem into a sequence of small tasks the computer can perform to
solve the problem. Planning also involves using representative data to test the logic of
the algorithm by hand to ensure that it is correct.
3. Code: Translate the algorithm into a programming language.
Coding is the technical word for writing the program. During this stage, the program is
written in Python and entered into the computer. The programmer uses the algorithm
devised in Step 2 along with a knowledge of Python.
4. Test and correct: Locate and remove any errors in the program.
Testing is the process of finding errors in a program. (An error in a program is called
a bug and testing and correcting is often referred to as debugging.) As the program is
6 ◆ Chapter 1 An Introduction to ­Computing and Problem Solving

typed, Python points out certain kinds of program errors. Other kinds of errors are
detected by Python when the program is executed—however, many errors due to typ-
ing mistakes, flaws in the algorithm, or incorrect use of the Python language rules, can
be uncovered and corrected only by careful detective work. An example of such an
error would be using addition when multiplication was the proper operation.
5. Complete the documentation: Organize all the material that describes the program.
Documentation is intended to allow another person, or the programmer at a later
date, to understand the program. Internal documentation (comments) consists of
statements in the program that are not executed, but point out the purposes of vari-
ous parts of the program. Documentation might also consist of a detailed descrip-
tion of what the program does and how to use it (for instance, what type of input is
expected). For commercial programs, documentation includes an instruction manual
and ­on-​­line help. Other types of documentation are the flowchart, pseudocode, and
hierarchy chart that were used to construct the program. Although documentation
is listed as the last step in the program development cycle, it should take place as the
program is being coded.

1.3 Programming Tools


This section discusses some specific algorithms and describes three tools used to convert
algorithms into computer programs: flowcharts, pseudocode, and hierarchy charts.
You use algorithms every day to make decisions and perform tasks. For instance, when-
ever you mail a letter, you must decide how much postage to put on the envelope. One rule
of thumb is to use one stamp for every five sheets of paper or fraction thereof. Suppose a
friend asks you to determine the number of stamps to place on an envelope. The following
algorithm will accomplish the task.

1. Request the number of sheets of paper; call it Sheets. (input)


2. Divide Sheets by 5. (processing)
3. If necessary, round the quotient up to a whole number; call it Stamps. (processing)
4. Reply with the number Stamps. (output)

The preceding algorithm takes the number of sheets (Sheets) as input, processes the
data, and produces the number of stamps needed (Stamps) as output. We can test the algo-
rithm for a letter with 16 sheets of paper.

1. Request the number of sheets of paper; Sheets = 16.


2. Dividing 5 into 16 gives 3.2.
3. Rounding 3.2 up to 4 gives Stamps = 4.
4. Reply with the answer, 4 stamps.

This ­problem-​­solving example can be illustrated by Fig. 1.3.

+PRWV 2TQEGUUKPI 1WVRWV


 HQTOWNCU 

Figure 1.3 The ­problem-​­solving process for the stamp problem.


1.3  Programming Tools ◆ 7

Of the program design tools available, three popular ones are the following:
Flowcharts: Graphically depict the logical steps to carry out a task and show how the
steps relate to each other.
Pseudocode: Uses ­English-​­like phrases with some Python terms to outline the task.
Hierarchy charts: Show how the different parts of a program relate to each other.

■■ Flowcharts
A flowchart consists of special geometric symbols connected by arrows. Within each sym-
bol is a phrase presenting the activity at that step. The shape of the symbol indicates the type
of operation that is to occur. For instance, the parallelogram denotes input or output. The
arrows connecting the symbols, called flowlines, show the progression in which the steps
take place. Flowcharts should “flow” from the top of the page to the bottom. Although the
symbols used in flowcharts are standardized, no standards exist for the amount of detail
required within each symbol.

5[ODQN 0COG /GCPKPI


(NQYNKPG 7UGFVQEQPPGEVU[ODQNUCPFKPFKECVGVJG
ƃQYQHNQIKE

6GTOKPCN 7UGFVQTGRTGUGPVVJGDGIKPPKPI 5VCTV QT


VJGGPF 'PF QHCVCUM

+PRWV1WVRWV 7UGFHQTKPRWVCPFQWVRWVQRGTCVKQPU
6JGFCVCVQDGKPRWVQTQWVRWVKUFGUETKDGF
KPVJGRCTCNNGNQITCO

2TQEGUUKPI 7UGFHQTCTKVJOGVKECPFFCVCOCPKRWNCVKQP
QRGTCVKQPU6JGKPUVTWEVKQPUCTGNKUVGF
KPUKFGVJGTGEVCPING

&GEKUKQP 7UGFHQTCP[NQIKEQTEQORCTKUQPQRGTCVKQPU
7PNKMGVJGKPRWVQWVRWVCPFRTQEGUUKPI
U[ODQNUYJKEJJCXGQPGGPVT[CPFQPGGZKV
ƃQYNKPGVJGFGEKUKQPU[ODQNJCUQPGGPVT[
CPFVYQGZKVRCVJU6JGRCVJEJQUGPFGRGPFU
QPYJGVJGTVJGCPUYGTVQCSWGUVKQPKUp[GUq
QTpPQq

%QPPGEVQT 7UGFVQLQKPFKHHGTGPVƃQYNKPGU

#PPQVCVKQP 7UGFVQRTQXKFGCFFKVKQPCNKPHQTOCVKQP
CDQWVCPQVJGTƃQYEJCTVU[ODQN

The table of the flowchart symbols has been adopted by the American National Stand-
ards Institute (ANSI). Figure 1.4 shows the flowchart for the ­postage-​­stamp problem.
The main advantage of using a flowchart to plan a task is that it provides a graphical
representation of the task, thereby making the logic easier to follow. We can clearly see
every step and how each is connected to the next. The major disadvantage is that when a
program is very large, the flowcharts may continue for many pages, making them difficult
to follow and modify.

■■ Pseudocode
Pseudocode is an abbreviated plain English version of actual computer code (hence, pseu-
docode). The geometric symbols used in flowcharts are replaced by E ­ nglish-​­like statements
that outline the process. As a result, pseudocode looks more like computer code than does
8 ◆ Chapter 1 An Introduction to ­Computing and Problem Solving

5VCTV

1DVCKP
KPRWV
5JGGVU

5GV5VCORU=
RTQEGUUKPI
5JGGVU

4QWPF5VCORU
WRVQCYJQNG RTQEGUUKPI
PWODGT

&KURNC[
QWVRWV
5VCORU

'PF

Figure 1.4 Flowchart for the p


­ ostage-​­stamp problem.

a flowchart. Pseudocode allows the programmer to focus on the steps required to solve a
problem rather than on how to use the computer language. The programmer can describe
the algorithm in P
­ ython-​­like form without being restricted by the rules of Python. When
the pseudocode is completed, it can be easily translated into the Python language.
The pseudocode for the ­postage-​­stamp problem is shown in Fig. 1.5.

Program: Determine the proper number of stamps for a letter.


Obtain number of sheets (Sheets) (input)
Set the number of stamps to Sheets / 5 (processing)
Round the number of stamps up to a whole number (processing)
Display the number of stamps (output)
Figure 1.5 Pseudocode for the ­postage-​­stamp problem.

Pseudocode has several advantages. It is compact and probably will not extend for many
pages as flowcharts commonly do. Also, the pseudocode looks like the code to be written
and so is preferred by many programmers.

■■ Hierarchy Chart
The last programming tool we’ll discuss is the hierarchy chart, which shows the overall
program structure. Hierarchy charts are also called structure charts, HIPO (Hierarchy plus
­Input-​­Process-​­Output) charts, ­top-​­down charts, or VTOC (Visual Table of Contents) charts.
All these names refer to planning diagrams that are similar to a company’s organization chart.
Another Random Scribd Document
with Unrelated Content
following the religion they were brought up in; that they are as good
as they wish to be, and not half so bad as their neighbours. Thus in
heart they are all alike; those in a profession and those out of it, are
all upon a level. The Gospel Pharisees thank God they are not so
bad as those vile Antinomians, who talk about free grace, and
perform no works. Others thank God they are not quite so bad, nor
indeed nothing like, other people; they have good hearts, they mean
well and wish well to all. Hence our dear Lord spake a parable to
those who trusted in themselves that they were righteous, and
despised others. The Pharisee stood, and prayed, God I thank thee
I am not as other men—so they vainly think, and so they declare:
their works are of themselves; they wear Spider’s webs, they make a
covering, but not of God’s Spirit; they are stretching themselves
upon a bed which is too short, and so all will find who reject the
plan of salvation, by Jesus alone.—These make a noise about
holiness, and good works—these sound a trumpet and proclaim their
own goodness; and they have their reward—this is but sounding
brass and the tinkling of a cymbal—it is feeding on wind; all the
works they do, are to be seen of men: but the Saviour says to his
disciples, Be ye not like to them. These will give nothing away,
without their names are published, printed, or put up in the front of
an alms house, or on the walls of a church or hospital—on these
things they feed—a good name among men; a refutation in the
world: this is the foundation of their hope, and this is said to be in
dust—His foundation is in the dust; but the hail will sweep away
their refuge of lies, and the waters will overflow their hiding places,
what they build on, that they enjoy; and thus dust is their meat—
and if they do not absolutely declare that all their hopes are laid on
what they do, they conclude their good works will either help
forward their salvation, or are grand essences of it—whereas nothing
that the brightest saint can do, externally, is any evidence of his new
birth, none at all; for any man, destitute of divine teaching can do
the same. He may hear, read, commune, speak well, relieve the
poor, and be found in every external ordinance; so says Isaiah xlviii,
and Ezekiel xxiii. And should this little Pamphlet fall into the hands
of any man or woman, who has been building on such evidences, I
pray God that the scales may drop from their eyes, that they may
see their danger, and be brought, as poor sinners, to the Lord Christ
for all they want.
The performances of persons who are destitute of the grace of God,
are called the Works of the Law; whereas it is not so properly, for
they are ignorant of the Law, nor does the Law call for any such
Works; therefore they are but the Works of the flesh, and those who
feed on them are eating dust, whether they are in a profession or
not. Hence God threaten his enemies that he will send them the
Poison of Serpents of the dust. Deut xxxii. And when he takes a
sinner in hand, he is said to scrape her dust from her.—Ezek. xxvi;
then he kindly invites, Come now, let us reason together—and,
graciously promises, though your sins be as scarlet they shall be as
wool, and though they be red like crimson they shall be whiter than
snow; and I will surely purge away thy dross, and take away thy tin.
Isaiah i. This is the Work of God and this must be done if ever we
see the face of God with joy; we must be stripped of all supposed
goodness, and emptied of self before we can be filled with the
Saviour.
When the excellent Toplady had finished his Sermon on Justification,
pious Lady Huntingdon said to him, “Sir, I think you gave the
Pharisees a good dressing to night.” “Oh, Madam,” said he, “I did
not want to dress them, but I aimed to undress them:”—and sure I
am that our filthy garments of self-righteousness must be taken
away, before we can enjoy the change of raiment. Zech. iii. Till this
is the case with us we may cry out, with the tongue (and if not,
every Pharisee exclaims, practically) Stand by thyself. I am holier
than thou! But, from all such blindness, hardness of heart, and
contempt of God’s Word and Commandment, Good Lord deliver us.
The food of the hypocrite, which the Swine did eat, these are called
husks. Hence our dear Lord, by a Parable, represented his own
people in a backsliding state, trying to fill their souls with husks, a
form of godliness without the power, the sound without the
substance, the shell without the kernel. So it is written in Luke xv.
And there arose a mighty famine in the land, and he began to be in
want, and he joined himself to a citizen of that country, and he sent
him out to feed Swine, and he fain would have filled his belly with
the husks that the Swine did eat. Here is an awakened soul, with
spiritual life, guilt, and shame in his conscience, flying to a false
refuge to make up what had been amiss; and obeying the orders of
a false teacher, without looking to Jesus as his only refuge.
When a poor sinner first comes into a profession, he is full of
legality, and being full of sin and darkness, he generally flies to those
kind of preachers that will set him to work; and these commonly
argue with such poor sinners, “Why, as you have done so much
against God, it is now high time you did something for God.” This
sounds well in the ears of such, and to work they go, to try to please
God; and if the Preacher does not immediately send them to the
Moral Law, they are generally sent to some tradition of the Elders;
they must become teachers in the Sunday Schools; they must form a
Society and visit the Sick; they must attend upon Prayer Meetings
and other religious Societies. Here those who have no spiritual life
can rest; upon these husks they can feed; but where there is real
hungering and thirsting after the bread of life, the mind cannot be
fed with such things; not but that they are praise-worthy in
themselves, but they should not be carried on by souls in such a
state, their place is to wait at the door of mercy; to be in spiritual
labour to get the bread of life, and having found him, then to
observe their call in Providence to visit others. But many are at this
work all their days, and will be found with no other title or
qualification for glory but this. When death comes, then they will,
perhaps, have to reflect with pleasure on the use they have been to
others. But this will be a miserable foundation; and if they do not
expect salvation upon this ground, yet they must confess they have
looked upon these things as fruits and evidences; but eternity will
convince them they are not the fruits of the Spirit. Hypocrite and
Pharisees can feed here, but a quickened soul cannot; this every
truly converted character must acknowledge. Those hypocritical
professors not only feed on these eternals, but on the failings, sins,
and falls, either real or supposed, of God’s people, every fall they
hear of is marrow and fatness to them: these they sweetly enjoy,
quite forgeting that they cannot be said to fall themselves, for, as
they never stood, either by faith or love, they cannot fall; they have
but few temptations, and those only what a worldly man has, and
not what is peculiar to God’s elect. Hence the Apostle says, Let him
that thinketh he standeth—he only thinks so, yet he may fall from
his profession altogether; and as he exulted in the supposed falls of
the saints, God may cast him down from his excellency. I have often
observed this myself, and the sacred Scriptures strikingly set it forth;
the net they spread for others, the pit they have digged they have
been taken in; so God has always testified, sooner or later, as it is
written, He that rolleth a stone it shall turn upon him, and he that
diggeth a pit shall fall therein.—He that cleaveth wood shall be
endangered thereby. Read the 10th of Eccles. from the 8th to the
15th verse.
The Food of the Serpent is said to be Lies—Hosea x, 13, Ye have
eaten lies—this is that kind of food which suits their vitiated taste.
The same Prophet declares, They eat up the sin of my people; they
set their hearts on their iniquity, for they shall eat and not have
enough.—Hosea iv, 8, 9, 10.—The private injury done to others is
called Bread eaten in secret places—and such eaters are like
Pharaoh’s lean kine, none the better for all they have devoured.
They are said to eat up the flesh of God’s people, Psalm xxvii, 2; and
their lying words, back-biting, whisperings, envies, hatred, gossiping,
and evil speaking, their running from house to house with tales
against others, their secret and outward triumph in all they can get
against others, whether true or false—the whole of such conduct
demonstrates a serpentine disposition, feeding on dust; this has
been seen of late in my severe trials from such Serpents and
generation of Vipers. All the foolish, absurd improbabilities, lies, and
the most cruel and daring misrepresentations of my natural temper
and kindness to others, good or bad; these been turned by such
persons to every thing infamous—while some, being high priests, on
whom the religious would have fixed their eyes instead of Jesus, or
his word, because of their name, their popularity, and property; the
last being the occasion of the rest. Many, to ingratiate themselves in
the favor of such, for sinister purposes, and nothing else, have
imposed upon them such things as they well knew their hearts
naturally love; then the Press has been employed—while boys, who
have been set up for teachers, have been employed to do the Devil’s
drudgery, violate the Sabbath, and act contrary to every law, human
and divine. The Press sends forth a farrago of rubbish, and in the
compass of a few pages not less than eighty lies, which I shall one
day expose. These are the sweet morsels on which thousands of
mere nominal Professors have fed, and God declares in my text they
shall.—Under the mask of sanctity, the garb of holiness, and a
contention for the Law, all their spleen has been vented against me
and my supposed crimes. But, alas, I fear it has been rather against
the great things God has done for me. Witness the bitterness
against my preaching, and those who have been blessed under it.
The lying accusation of being an Antinomian in Principle, Preaching,
and Practice, when every person that is acquainted with the Gospel
must acknowledge that I preach all the Words of this Life,
doctrinally, experimentally, and practically. To be sure, they wonder
where I got the teaching that I have received; and my adversaries
are as much puzzled about this, as those of old, who asked, How
knoweth this man his letters, having never learned?
I must say here, that I feel thankful for what my enemies have said
and done against me, as I have learned much from these things; the
Spirit of God teaches by the Cross, and in the School of Affliction
much is to be derived—whoso is wise will observe these things, and
he shall understand the loving kindness of the Lord.
My enemies have been perpetually representing me as an enemy to
the Law, whereas, their conduct has proved that they were acting
contrary to every Law of God and man. Thou shalt not go up and
down (not even Blackfriars Road) as a tale-bearer among thy
people.—Levit. xix,—this was the express command of God.—Thou
shalt love thy neighbour as thy self, whether he has fallen among
thieves or not. Speak evil of no man, says the New Testament—Owe
no man any thing but love. Moreover, if thy brother trespass, go
and tell him his fault, between him and thee alone, (suppose it be
true) if he shall hear thee, thou hast gained thy brother—so speaks
the Word of God, which it our Rule of Walk and Conduct. Now, if we
consider the conduct of my holy enemies who are all zealous for
practical holiness, and see how their demeanor corresponds with this
rule—may we not exclaim, Which is the Antinomian, me or they?
How many turn sick at the success of others.—What a wretched
principle is ENVY—Solomon asks Who can stand before it? But as my
foes have had such a Feast on Ashes and Dust, I only wish them a
spiritual appetite, and better food, even the Bread of eternal Life,
which is meat indeed. This is the joy of heaven—this is Angels food,
and this is the food on which the Believer lives. ’Tis most blessed to
trace this Subject. Our Covenant God provided it, the Holy Spirit
quickens us to a spiritual hungering after it—convinces us of the
vanity of all things else beside—brings us to love his word—to hear
those Preachers that bring forth this food; satisfies us with blessed
views of him, sweet enjoyments of his glorious Person, covenant
love, eternal mercy, his imputed righteousness, his sovereign
purposes, his atoning sacrifice, his peace-speaking blood, and the
invitations, declarations, and exceeding precious promises. This is
the food on which our souls live, if born of God, and every man is
known by his taste; the Serpent on those things which are compared
to dust; the Believer on that which is called the Bread of God; hence
the Promise, Ye shall eat in plenty, and be satisfied. Eat, O friends,
drink abundantly, O beloved. The meek shall eat and be satisfied.
And I will satisfy her poor with bread. For he hath filled the hungry
with good things, but the rich he hath sent empty away—so all
Serpents will find it.
The text concludes, They shall not hurt nor destroy in all my holy
mountain, saith the Lord.—This was renewed in the New Testament,
Nothing shall by any means hurt you. And, in fact, nothing can
eventually hurt the Church; sin cannot, as it is atoned for—the guilt
of it is gone—the love of it is removed as the love of Jesus comes
into the mind; and the power and dominion of it is removed by
almighty Grace, the stronger than the strong man armed—the Law
cannot, because it is well satisfied with the Obedience of the
adorable Surety—Satan cannot; frighten he may, but cannot touch
them to their injury, for his very temptations make us hate him the
more—Our own inbred corruptions cannot hurt us; they are more
trying to us, the more we loath them and abhor ourselves, as vile in
God’s sight—the World cannot, as it is overcome for us, and the
Faith God has given will overcome it in us. Pharisees, Hypocrites,
and Impostors, with their damnable errors cannot, though they may
cause us much trouble. Yet this will furnish us with much matter for
Prayer and fear: these things will drive us nearer to God—nor can
poverty, pain, reproach, or sorrow do it, for these shew us this is not
our rest, it is polluted; and all these work together for good, as sure
as we are the called, according to his Plan. These can neither hurt
nor destroy one bud of hope, or faith, or desire, or affection, either
to God or his truth. Nor can they destroy the soul, God loves it too
well, and Jesus has paid too great a price to permit it to be lost.
Besides, it is the temple of the holy and eternal Spirit; who then can
destroy it?
The Church is called God’s holy Mountain—typified by Mount Sion,
firmly settled in the eternal love, and everlasting purposes of Grace.
Conspicuous and useful in the world, and which, as a great
Mountain, shall fill the whole earth in the latter day. They are called
a holy people; the Lord Jesus Christ is their holiness before God, Ye
are compleat in him, who of God is made unto us Sanctification.
Secondly, All their holiness is received from him, as the High Priest of
their profession; anointed, and taught by him, as a Prophet; they
obey his commands, as a King; this constitutes them holy, as their
faith embraced the atonement and righteousness of Christ; the holy
Spirit’s gracious inhabitation leads them to love and delight in God,
his ways, his truth, his people, and his ordinances; having grace
given to walk in wisdom to them that are without: this is real
holiness, nothing short of this is scriptural holiness, and this is the
Work of God; this proves our union to the Saviour, and this is our
meetness for glory, and such honor have all the Saints.

Finis.

SHORTLY WILL BE PUBLISHED,

A FEW REMARKS
ON

BEL AND THE DRAGON,


In the Book of the Apocrypha—
In a Letter to a Friend.

Bel is confounded.—Jerem. l, 2.
And the Dragon fought and his Angels, and prevailed not.—Rev.
xii, 7.
FOOTNOTES.

[0] The title page of the original in the British Library has a very
faint 1812 printed just below the 1813 date on the title page.
*** END OF THE PROJECT GUTENBERG EBOOK A FEAST FOR
SERPENTS ***

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.
back

You might also like