100% found this document useful (2 votes)
71 views

Clearly Visual Basic: Programming with Microsoft Visual Basic 2010, Second Edition Diane Zak instant download

The document provides information about the book 'Clearly Visual Basic: Programming with Microsoft Visual Basic 2010, Second Edition' by Diane Zak, including its contents and chapters. It also includes links to download the book and other related educational resources. Additionally, it outlines the structure and organization of the book, emphasizing its focus on teaching Visual Basic programming concepts.

Uploaded by

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

Clearly Visual Basic: Programming with Microsoft Visual Basic 2010, Second Edition Diane Zak instant download

The document provides information about the book 'Clearly Visual Basic: Programming with Microsoft Visual Basic 2010, Second Edition' by Diane Zak, including its contents and chapters. It also includes links to download the book and other related educational resources. Additionally, it outlines the structure and organization of the book, emphasizing its focus on teaching Visual Basic programming concepts.

Uploaded by

raydfxture7
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/ 44

Clearly Visual Basic: Programming with Microsoft

Visual Basic 2010, Second Edition Diane Zak pdf


download

https://ebookmeta.com/product/clearly-visual-basic-programming-
with-microsoft-visual-basic-2010-second-edition-diane-zak/

Download more ebook from https://ebookmeta.com


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

Visual Basic in easy steps Covers Visual Basic 2015


Fourth Edition Mcgrath

https://ebookmeta.com/product/visual-basic-in-easy-steps-covers-
visual-basic-2015-fourth-edition-mcgrath/

Starting Out with Visual Basic - 8th Edition Tony


Gaddis

https://ebookmeta.com/product/starting-out-with-visual-basic-8th-
edition-tony-gaddis/

Oracle Database Programming with Visual Basic NET


Concepts Designs and Implementations 1st Edition Ying
Bai

https://ebookmeta.com/product/oracle-database-programming-with-
visual-basic-net-concepts-designs-and-implementations-1st-
edition-ying-bai/

The Clover Chapel 2 Jamison Valley 2021st Edition


Devney Perry

https://ebookmeta.com/product/the-clover-chapel-2-jamison-
valley-2021st-edition-devney-perry/
Great Ways to Learn Anatomy and Physiology 3rd Edition
Charmaine Mckissock

https://ebookmeta.com/product/great-ways-to-learn-anatomy-and-
physiology-3rd-edition-charmaine-mckissock/

Colombia 9th Edition Jade Bremner Alex Egerton Tom


Masters Kevin Raub

https://ebookmeta.com/product/colombia-9th-edition-jade-bremner-
alex-egerton-tom-masters-kevin-raub/

The Small Scale Poultry Flock An All Natural Approach


to Raising and Breeding Chickens and Other Fowl for
Home and Market Growers 2nd Edition Harvey Ussery

https://ebookmeta.com/product/the-small-scale-poultry-flock-an-
all-natural-approach-to-raising-and-breeding-chickens-and-other-
fowl-for-home-and-market-growers-2nd-edition-harvey-ussery/

Fortschritte der Physik Progress of Physics Band 29


Heft 11 12

https://ebookmeta.com/product/fortschritte-der-physik-progress-
of-physics-band-29-heft-11-12/

Hybrid Cloud Backup For Dummies®, Veeam Special Edition


Brett Mclaughlin

https://ebookmeta.com/product/hybrid-cloud-backup-for-dummies-
veeam-special-edition-brett-mclaughlin/
New Polymer Nanocomposites for Environmental
Remediation 1st Edition Chaudhery Mustansar Hussain
(Editor)

https://ebookmeta.com/product/new-polymer-nanocomposites-for-
environmental-remediation-1st-edition-chaudhery-mustansar-
hussain-editor/
This is an electronic version of the print textbook. Due to electronic rights restrictions, some third party content may be suppressed.
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience.
The publisher reserves the right to remove content from this title at any time if subsequent rights restrictions require it.
For valuable information on pricing, previous editions, changes to current editions, and alternate formats,
please visit www.cengage.com/highered to search by ISBN#, author, title, or keyword for materials in your areas of interest.
CLEARLY VISUAL BASIC®
P R O G R A M M I N G W I T H M I C R O S O F T ® V I S U A L B A S I C ® 2 01 0
This page intentionally left blank
SECOND EDITION

CLEARLY VISUAL BASIC ®


PROGRAMMING WITH MICROSOFT ® VISUAL BASIC ® 2010

DIANE ZAK

Australia l Brazil l Japan l Korea l Mexico l Singapore l Spain l United Kingdom l United States
Clearly Visual Basic: ª 2012 Course Technology, Cengage Learning
Programming with Microsoft
ALL RIGHTS RESERVED. No part of this work covered by the copyright herein may be
Visual Basic 2010, Second Edition reproduced, transmitted, stored or used in any form or by any means graphic, electronic,
Diane Zak or mechanical, including but not limited to photocopying, recording, scanning, digitizing,
taping, Web distribution, information networks, or information storage and retrieval
Executive Editor: Marie Lee
systems, except as permitted under Section 107 or 108 of the 1976 United States
Acquisitions Editor: Brandi Shailer Copyright Act, without the prior written permission of the publisher.
Senior Product Manager: Alyssa Pratt
Freelance Product Manager: Tricia Coia
For product information and technology assistance, contact us at
Associate Product Manager: Cengage Learning Customer & Sales Support, 1-800-354-9706
Stephanie Lorenz
For permission to use material from this text or product,
Marketing Manager: Shanna Shelton
submit all requests online at cengage.com/permissions
Senior Content Project Manager: Jill Braiewa Further permissions questions can be emailed to
Quality Assurance: Green Pen QA permissionrequest@cengage.com
Art Director: Faith Brosnan
Cover Designer: Cabbage Design Company Library of Congress Control Number: 2011921829
Text Designer: Shawn Girsberger
ISBN 13: 978 1 111 53015 0
Print Buyer: Julio Esperas
ISBN 10: 1 111 53015 7
Proofreader: Suzanne Huizenga
Indexer: Alexandra Nickerson Course Technology
Compositor: Integra Software Services 20 Channel Center Street
Boston, MA 02210
USA

Some of the product names and company names used in this book have been used for
identification purposes only and may be trademarks or registered trademarks of their
respective manufacturers and sellers.
Course Technology, a part of Cengage Learning, reserves the right to revise this
publication and make changes from time to time in its content without notice.
Example: Microsoft® is a registered trademark of the Microsoft Corporation.
Cengage Learning is a leading provider of customized learning solutions with office
locations around the globe, including Singapore, the United Kingdom, Australia,
Mexico, Brazil, and Japan. Locate your local office at: www.cengage.com/global
Cengage Learning products are represented in Canada by Nelson Education, Ltd.
To learn more about Course Technology, visit
www.cengage.com/coursetechnology
To learn more about Cengage Learning, visit www.cengage.com
Purchase any of our products at your local college store or at our preferred online store
www.cengagebrain.com

Printed in the United States of America


1 2 3 4 5 6 7 17 16 15 14 13 12 11
v

Brief Contents

Preface . . . . . . . . . . . . . . . . . . . . . . . . . . xiv
C H AP T E R 1 I Am Not a Control Freak! (Control Structures) . . . . . . . . . .1
C H AP T E R 2 First You Need to Plan the Party (Problem-Solving Process) . . . 11
C H AP T E R 3 I Need a Tour Guide (Introduction to Visual Basic 2010) . . . . . 27
C H AP T E R 4 Do It Yourself Designing (Designing Interfaces) . . . . . . . . . 49
C H AP T E R 5 The Secret Code (Assignment Statements) . . . . . . . . . . . 67
C H AP T E R 6 Where Can I Store This? (Variables and Constants) . . . . . . . 81
C H AP T E R 7 What’s Wrong with It? (Syntax and Logic Errors) . . . . . . . . .101
C H AP T E R 8 Decisions, Decisions, Decisions (Selection Structure) . . . . . .115
C H AP T E R 9 Time to Leave the Nest (Nested Selection Structures) . . . . . .139
C H AP T E R 1 0 So Many Paths . . . So Little Time (Multiple-Alternative
Selection Structures) . . . . . . . . . . . . . . . . . . . .159
C H AP T E R 1 1 Testing, Testing . . . 1, 2, 3 (Selecting Test Data) . . . . . . . .183
C H AP T E R 1 2 How Long Can This Go On? (Pretest Loops) . . . . . . . . . . .203
C H AP T E R 1 3 Do It, Then Ask Permission (Posttest Loops) . . . . . . . . . .231
C H AP T E R 1 4 Let Me Count the Ways (Counter-Controlled Loops) . . . . . . .241
C H AP T E R 1 5 I’m on the Inside; You’re on the Outside (Nested Loops) . . . . .261
C H AP T E R 1 6 I Hear You Are Breaking Up (Sub Procedures) . . . . . . . . . .279
C H AP T E R 1 7 Talk to Me (Function Procedures) . . . . . . . . . . . . . . .303
C H AP T E R 1 8 A Ray of Sunshine (One-Dimensional Arrays) . . . . . . . . . .319
C H AP T E R 1 9 Parallel and Dynamic Universes (More on One-Dimensional
Arrays) . . . . . . . . . . . . . . . . . . . . . . . . . . .341
C H AP T E R 2 0 Table Tennis, Anyone? (Two-Dimensional Arrays) . . . . . . . .363
C H AP T E R 2 1 Building Your Own Structure (Structures) . . . . . . . . . . . .383
vi
CONTENTS

C H AP T E R 2 2 I’m Saving for the Future (Sequential Access Files) . . . . . . .399


C H AP T E R 2 3 The String Section (String Manipulation) . . . . . . . . . . . .417
C H AP T E R 2 4 I’m Suffering from Information Overload (Access Databases) . . .439
C H AP T E R 2 5 The Missing “LINQ” (Querying a Database) . . . . . . . . . . .461
C H AP T E R 2 6 I Love This Class (Creating a Class) . . . . . . . . . . . . . .475
C H AP T E R 2 7 Getting “Web-ified” (Web Applications) . . . . . . . . . . . . .497
A PP E N D I X A Data Types . . . . . . . . . . . . . . . . . . . . . . . . .527
A PP E N D I X B Answers to Mini-Quizzes and TRY THIS Exercises . . . . . . . .529
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . .569
vii

Contents

Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . xiv

C H AP T E R 1 I Am Not a Control Freak! (Control Structures) . . . . . . . . . . . 1


Control Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
The Sequence Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2
The Selection Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2
The Repetition Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

C H AP T E R 2 First You Need to Plan the Party (Problem-Solving Process) . . . . 11


How Do Programmers Solve Problems? . . . . . . . . . . . . . . . . . . . . . . . . 12
Step 1 Analyze the Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Step 2 Plan the Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Step 3 Desk Check the Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . 18
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

C H AP T E R 3 I Need a Tour Guide (Introduction to Visual Basic 2010) . . . . . . 27


Ok, the Algorithm Is Correct. What’s Next? . . . . . . . . . . . . . . . . . . . . . . . 28
Creating a Visual Basic Windows Application . . . . . . . . . . . . . . . . . . . . . . 29
So Many Windows! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Creating the User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Save, Save, Save . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Whose Property Is It? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Using the Format Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Lock Them Down . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Ok, Let’s See the Interface in Action! . . . . . . . . . . . . . . . . . . . . . . . . . 41
Closing the Current Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Opening an Existing Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Exiting Visual Studio 2010 or Visual Basic 2010 Express . . . . . . . . . . . . . . . . . 43
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
viii
CONTENTS

C H AP T E R 4 Do It Yourself Designing (Designing Interfaces) . . . . . . . . . 49


Delegating the Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Making the Interface More User Friendly . . . . . . . . . . . . . . . . . . . . . . . . 54
Do What I Tell You to Do . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
The Me.Close() Instruction . . . . . . . . . . . . . . . . . . . . . . . . . 58
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62

C H AP T E R 5 The Secret Code (Assignment Statements) . . . . . . . . . . . 67


The Fun Starts Here . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
The Val Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Who’s in Charge of This Operation? . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Your Assignment, if You Choose to Accept It . . . . . . . . . . . . . . . . . . . . . . 72
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76

C H AP T E R 6 Where Can I Store This? (Variables and Constants) . . . . . . . . 81


Using Storage Bins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
So, What’s Your Type? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Let’s Play the Name Game . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
You’ll Need a Reservation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
How Many Variables Should I Use? . . . . . . . . . . . . . . . . . . . . . . . . . . 85
The TryParse Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Check, Please…I’m Ready to Go . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Using Constants to Keep Things…Well, the Same . . . . . . . . . . . . . . . . . . . . 89
Dressing Up the Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95

C H AP T E R 7 What’s Wrong with It? (Syntax and Logic Errors) . . . . . . . . .101


There’s a Bug in My Soup! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Finding Syntax Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Locating Logic Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
I’ve Reached My Breaking Point . . . . . . . . . . . . . . . . . . . . . . . . . 108
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113

C H AP T E R 8 Decisions, Decisions, Decisions (Selection Structure) . . . . . .115


Someone Might Need to Make a Decision . . . . . . . . . . . . . . . . . . . . . . 116
Going Beyond Rob’s Problems . . . . . . . . . . . . . . . . . . . . . . . . . . 120
The If…Then…Else Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
ix

Examining Another Problem Specification . . . . . . . . . . . . . . . . . . . . . . 124


Hey, That’s Not the Way I Would Have Done It . . . . . . . . . . . . . . . . . . . 129
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135

C H AP T E R 9 Time to Leave the Nest (Nested Selection Structures) . . . . . .139


Nested Selection Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
Putting Rob’s Problems Aside . . . . . . . . . . . . . . . . . . . . . . . . . . 143
Let’s Go to the Swap Meet . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
That’s Way Too Logical for Me . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Summary of Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155

C H AP T E R 1 0 So Many Paths . . . So Little Time (Multiple-Alternative


Selection Structures) . . . . . . . . . . . . . . . . . . . . .159
Which Way Should I Go? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
Coding the Fitness For Good Application . . . . . . . . . . . . . . . . . . . . . . 162
Don’t Be So Sensitive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
What’s the Next Case on the Docket? . . . . . . . . . . . . . . . . . . . . . . . . 167
Using Select Case in the Fitness For Good Application . . . . . . . . . . . . . . . . 168
Specifying a Range of Values in a Case Clause’s ExpressionList . . . . . . . . . . . . . 170
Coding the ABC Corporation Application . . . . . . . . . . . . . . . . . . . . . . 171
Using Radio Buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
Coding the Gentry Supplies Application . . . . . . . . . . . . . . . . . . . . . . 173
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177

C H AP T E R 1 1 Testing, Testing . . . 1, 2, 3 (Selecting Test Data) . . . . . . . .183


Will Your Application Pass the Test? . . . . . . . . . . . . . . . . . . . . . . . . . 184
The Only Cookies Version 1 Application . . . . . . . . . . . . . . . . . . . . . . . 184
The Only Cookies Version 2 Application . . . . . . . . . . . . . . . . . . . . . . . 187
Stop! This Is a Restricted Area! . . . . . . . . . . . . . . . . . . . . . . . . . . 189
The Shady Hollow Hotel Version 1 Application . . . . . . . . . . . . . . . . . . . . . 191
The Shady Hollow Hotel Version 2 Application . . . . . . . . . . . . . . . . . . . . . 193
I Need to Tell You Something . . . . . . . . . . . . . . . . . . . . . . . . . . 195
Just When You Thought It Was Safe . . . . . . . . . . . . . . . . . . . . . . . . 197
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201

C H AP T E R 1 2 How Long Can This Go On? (Pretest Loops) . . . . . . . . . . .203


Over and Over Again . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
x
CONTENTS

The Do…Loop Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208


Counter Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
My Dream Car Version 1 Application . . . . . . . . . . . . . . . . . . . . . . . . 210
My Dream Car Version 2 Application . . . . . . . . . . . . . . . . . . . . . . . . 214
The Sales Express Application Counter and Accumulator Variables . . . . . . . . . . . . 216
The InputBox Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
Can I Abbreviate That Assignment Statement? . . . . . . . . . . . . . . . . . . . . 223
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228

C H AP T E R 1 3 Do It, Then Ask Permission (Posttest Loops) . . . . . . . . . . .231


Testing After the Fact . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
More on the Do…Loop Statement . . . . . . . . . . . . . . . . . . . . . . . . . 233
Pseudocode and Flowchart Containing a Posttest Loop . . . . . . . . . . . . . . . . 234
The Bouncing Robot Application . . . . . . . . . . . . . . . . . . . . . . . . . . 235
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
Key Term . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238

C H AP T E R 1 4 Let Me Count the Ways (Counter-Controlled Loops) . . . . . . . .241


When Will It Stop? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
Spaceship Version 1 Application . . . . . . . . . . . . . . . . . . . . . . . . . 244
Spaceship Version 2 Application . . . . . . . . . . . . . . . . . . . . . . . . . 246
Hey, Turn That Noise Down! . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
The Monthly Payment Calculator Application . . . . . . . . . . . . . . . . . . . . . 247
The Financial.Pmt Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
But They Said There Were No Strings Attached . . . . . . . . . . . . . . . . . . . 250
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257

C H AP T E R 1 5 I’m on the Inside; You’re on the Outside (Nested Loops) . . . . . .261


One Loop Within Another Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
Clock Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
Revisiting the Monthly Payment Calculator Application . . . . . . . . . . . . . . . . . 265
But I Want to Do It a Different Way . . . . . . . . . . . . . . . . . . . . . . . . 270
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274

C H AP T E R 1 6 I Hear You Are Breaking Up (Sub Procedures) . . . . . . . . . .279


What’s the Proper Procedure? . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
The Weekly Pay Application . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
Send Me Something . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
Just Give Me Its Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
Where Do You Live? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
xi

Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297

C H AP T E R 1 7 Talk to Me (Function Procedures) . . . . . . . . . . . . . . . .303


What’s the Answer? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
Price Calculator Application . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
Revisiting the Total Due Calculator Application . . . . . . . . . . . . . . . . . . . . 308
Which Way Is Better? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315

C H AP T E R 1 8 A Ray of Sunshine (One-Dimensional Arrays) . . . . . . . . . . .319


Let’s Join the Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
My Friends Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
Salary Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
States Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336

C H AP T E R 1 9 Parallel and Dynamic Universes (More on One-Dimensional


Arrays) . . . . . . . . . . . . . . . . . . . . . . . . . . .341
We Share the Same Subscripts . . . . . . . . . . . . . . . . . . . . . . . . . . 342
Will You Share That with Me? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346
But I Don’t Know How Many There Are . . . . . . . . . . . . . . . . . . . . . . . . 352
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357

C H AP T E R 2 0 Table Tennis, Anyone? (Two-Dimensional Arrays) . . . . . . . . .363


Let’s Table That Idea for Now . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
Revisiting the Employee Application . . . . . . . . . . . . . . . . . . . . . . . . . 367
The GetLowerBound and GetUpperBound Methods . . . . . . . . . . . . . . . . . . 368
Calendar Orders Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377

C H AP T E R 2 1 Building Your Own Structure (Structures) . . . . . . . . . . . .383


Putting the Pieces Together . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384
Willow Pools Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386
Revisiting the Employee Application…Again! . . . . . . . . . . . . . . . . . . . . . 389
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
xii
CONTENTS

Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395


Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396

C H AP T E R 2 2 I’m Saving for the Future (Sequential Access Files) . . . . . . . .399


Sequential Access Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
Write Those Lines of Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
Now Read Those Lines of Text . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413

C H AP T E R 2 3 The String Section (String Manipulation) . . . . . . . . . . . . .417


Working with Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
How Many Characters Are There? . . . . . . . . . . . . . . . . . . . . . . . . . . 418
Get Rid of Those Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
The Product ID Application . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
Let’s Make a Substitution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
I Need to Fit This in Somewhere . . . . . . . . . . . . . . . . . . . . . . . . . . 421
The Phone Numbers Application . . . . . . . . . . . . . . . . . . . . . . . . . 422
Where Does It Begin? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425
I Just Want a Part of It . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426
The Rearrange Name Application . . . . . . . . . . . . . . . . . . . . . . . . . 427
Throw Away Those Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
The Last Name Application . . . . . . . . . . . . . . . . . . . . . . . . . . . 430
I Like This Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432
Modifying the Product Id Application . . . . . . . . . . . . . . . . . . . . . . . . 434
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437

C H AP T E R 2 4 I’m Suffering from Information Overload (Access Databases) . . .439


Keeping Good Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440
Connecting…Connecting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
Let the Computer Do It . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
The Copy to Output Directory Property . . . . . . . . . . . . . . . . . . . . . . . 448
How Does Visual Basic Do It? . . . . . . . . . . . . . . . . . . . . . . . . . . . 450
Thank You for Catching My Errors . . . . . . . . . . . . . . . . . . . . . . . . 450
I’ll Use My Own Controls, Thank You . . . . . . . . . . . . . . . . . . . . . . . . 452
Coding the Next Record and Previous Record Buttons . . . . . . . . . . . . . . . . 454
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458

C H AP T E R 2 5 The Missing “LINQ” (Querying a Database) . . . . . . . . . . . .461


Asking Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462
Revisiting the Raye Industries Application . . . . . . . . . . . . . . . . . . . . . . 463
xiii

One for All . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 466


Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471

C H AP T E R 2 6 I Love This Class (Creating a Class) . . . . . . . . . . . . . . .475


That’s a Real Classy Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476
Revisiting the Willow Pools Application . . . . . . . . . . . . . . . . . . . . . . . . 477
Who Owns That Property? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479
Behave Yourself . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483
Constructive Behavior Is the Key to Success . . . . . . . . . . . . . . . . . . . . 483
Methods Other than Constructors . . . . . . . . . . . . . . . . . . . . . . . . . 484
Using the Pattern to Create an Object . . . . . . . . . . . . . . . . . . . . . . . . 486
Pool Supplies Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 489
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493

C H AP T E R 2 7 Getting “Web-ified” (Web Applications) . . . . . . . . . . . . .497


Web Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498
Creating a Web Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500
Adding the Default.aspx Web Page to the Application . . . . . . . . . . . . . . . . . . 502
Customizing a Web Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503
Adding Static Text to a Web Page . . . . . . . . . . . . . . . . . . . . . . . . 504
Viewing a Web Page in Full Screen View . . . . . . . . . . . . . . . . . . . . . . . 505
Adding Another Web Page to the Application . . . . . . . . . . . . . . . . . . . . . 506
Adding a Link Button Control to a Web Page . . . . . . . . . . . . . . . . . . . . . 507
Starting a Web Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508
Adding an Image to a Web Page . . . . . . . . . . . . . . . . . . . . . . . . . . 510
Closing and Opening an Existing Web Application . . . . . . . . . . . . . . . . . . . 512
Repositioning a Control on a Web Page . . . . . . . . . . . . . . . . . . . . . . . 512
Dynamic Web Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514
Coding the Submit Button’s Click Event Procedure . . . . . . . . . . . . . . . . . . . 517
Validating User Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 522
Review Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523

A PP E N D I X A Data Types . . . . . . . . . . . . . . . . . . . . . . . . .527


A PP E N D I X B Answers to Mini-Quizzes and TRY THIS Exercises . . . . . . . . .529
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . .569
Other documents randomly have
different content
78.
Our souls shall magnify the Lord;
In God the Saviour we rejoice:
While we repeat the Virgin’s song,
May the same spirit tune our voice.

To those who fear and trust the Lord,


His mercy stands for ever sure:
From age to age the promise lives,
And the performance is secure.

But now no more shall Israel wait,


No more the Gentiles lie forlorn:
Lo! the Desire of Nations comes;
Behold, the promised seed is born!

42
79.
Great God! what do I see and hear?
The end of things created!
The Judge of mankind doth appear,
On clouds of glory seated.
The trumpet sounds; the graves restore
The dead which they contained before;
Prepare, my soul, to meet him.

The dead in Christ shall first arise,


At the last trumpet’s sounding,
Caught up to meet Him in the skies,
With joy their Lord surrounding!
No gloomy fears their souls dismay;
His presence sheds eternal day
On those prepared to meet Him.

Great God! what do I see and hear?


The end of things created!
The Judge of mankind doth appear,
On clouds of glory seated.
Beneath His cross I view the day
When heaven and earth shall melt away,
And thus prepare to meet Him.
80.
O for a glance of heavenly love,
Our hearts and songs to raise;
Sweetly to bear our souls above,
And mingle with their lays.

With joy the chorus we’ll repeat,—


“Glory to God on high!
Good-will and peace are now complete,—
Jesus was born to die.”

Hail, Prince of Peace, for ever hail!


Redeemer, Brother, Friend;
Though earth and time, and life, should fail,
Thy praise shall never end.

43
81.
How shall I meet my Saviour?
How shall I welcome Thee?
What manner of behaviour
Is now required of me?
Let thine illumination
Guide heart and hand aright,
That this my preparation
Be pleasing in thy sight.

While with her sweetest flowers


Thy Zion strews the way,
I’ll raise with all my powers
To Thee a grateful lay:
To Thee, the King of Glory,
I’ll raise a song divine;
And make thy love’s bright story
In graceful numbers shine.

I lay in fetters groaning,


Thou cam’st to set me free;
My shame I was bemoaning,
With grace thou clothedst me;
Thou raisedst me to glory,
Endowed me with thy bliss,
Which is not transitory,
As worldly pleasure is.

This caused thy incarnation,


This brought thee down to me:
Thy thirst for my salvation
Contrived my liberty!
May I still enjoy this feeling,
In all need to Jesus go!
Prove his wounds each day more healing,
And himself more fully know.

44
82.
Before Jehovah’s awful throne,
Ye nations, bow with sacred joy;
Know that the Lord is God alone:
He can create and He destroy.

His sovereign power, without our aid,


Made us of clay, and formed us men;
And when like wand’ring sheep we strayed,
He brought us to his fold again.

We’ll crowd thy gates with thankful songs,


High as the heavens our voices raise;
And earth, with her ten thousand tongues,
Shall fill thy courts with sounding praise.

Wide as the world is thy command,


Vast as eternity thy love;
Firm as a rock thy truth must stand,
When rolling years shall cease to move.
83.
If Jesus Christ was sent
To save us from our sin,
And kindly teach us to repent,
We should at once begin.

’Tis not enough to say,


We’re sorry, and repent,
Yet still go on from day to day,
Just as we always went.

Repentance is to leave
The sins we loved before;
And show that we in earnest grieve,
By doing so no more.

Lord, make us thus sincere,


To watch as well as pray;
However small, however dear,
Take all our sins away.

45
84.
O come, let us sing to the God of salvation!
To Jesus our King who hath brought consolation,
Who in His own body hath opened a fountain
To cleanse our transgressions, tho’ high as a mountain!

Hallelujah to the Lamb who hath bought us a pardon;


We’ll praise Him again when we’ve passed over Jordan!

Though we are deprav’d, though with sin we are burdened,


Our souls may be saved, and our sins may be pardoned;
For Jesus, our Saviour, hath promised to bless us,
And free us for ever from those that oppress us.
Hallelujah, &c.

The hour may be nigh when our bosoms, faint heaving,


Shall breathe their last sigh in the peace of believing;
And Thou from our pillow all darkness dispelling,
Wilt calm the rude billow of Jordan’s proud swelling.
Hallelujah, &c.
85.
How kind is the Saviour, how great is his love!
To bless little children, he came from above;
He left holy angels, and their bright abode,
To dwell here with children, and teach them the road.

He wept in the garden, and died on the tree,


To open a fountain for sinners like me:
His blood is that fountain which pardon bestows,
And cleanses the foulest wherever it flows.

He went back to glory; but left us His Word,


Which oft from our teachers and pastors we’ve heard;
He sends forth His Spirit our hearts to inflame,
With joy to His service, and love to His name.

O help us, blest Jesus, more sweetly to praise,


And walk in Thy footsteps the rest of our days;
Then raise us, dear Saviour, to taste of Thy love,
And praise Thee for ever with angels above!

46
86.
I sing the almighty power of God,
That made the mountains rise;
That spread the flowing seas abroad,
And built the lofty skies.

I sing the wisdom that ordained


The sun to rule the day;
The moon shines full at his command,
And all the stars obey.

I sing the goodness of the Lord,


That filled the earth with food;
He formed the creatures with His Word,
And then pronounced them good.

Lord! how thy wonders are displayed


Where’er I turn mine eye!
If I survey the ground I tread,
Or gaze upon the sky.

There’s not a plant or flower below


But makes thy glories known;
And clouds arise, and tempests blow,
By order from Thy throne.

Creatures, as numerous as they be,


Are subject to Thy care;
There’s not a place where we can flee
But God is present there.

In heaven He shines with beams of love,


With wrath in hell beneath;
’Tis on His earth I stand or move,
And ’tis His air I breathe.

His hand is my perpetual guard;


He keeps me with His eye:
Why should I then forget the Lord,
Who is for ever nigh?

47
87.
Hail, Bethlehem! favour’d city, hail!
And hail thou star, with lustre mild,
Whose light, unerring, points the way
Of sages, to the holy Child!

Yes, ye were wise—and heaven-taught knew


The language of that mystic ray,
Which led you far from Persia’s plains,
From twilight dim, to noontide day.

True to the light that star arose


On you, though far from Salem’s towers;
That star to Bethlehem leads you where
The righteous Sun his radiance pours.

And thus may we our way pursue,


Improve our rising dawn of grace,
Which, followed, will to Jesus lead,
Jesus, our “Sun of Righteousness.”
88.
Once thou didst on earth appear
For all mankind to atone;
Now be manifested here,
And bid our sins begone.

Come, and by thy presence chase


Its nature with its guilt and power;
Jesus, shew thy open face,
And sin shall be no more.

Thou, who didst so greatly stoop


To a poor virgin’s womb,
Here thy mean abode take up,
To me, my Saviour, come.

Come, and Satan’s works destroy,


And let me all thy Godhead prove;
Fill’d with peace and heavenly joy,
And pure, eternal love!

48
W. WALKER AND SONS,
OF THE
Wharfedale Steam-Printing Works,
OTLEY, YORKSHIRE,
ARE PUBLISHERS OF A VERY INTERESTING SERIES OF
Reward Books and Recitations
For Sabbath and other Schools;
RURAL DIALOGUES, FOR CHILDREN;
DIALOGUES ON THE MESSIAH;
Temperance Dialogues & Recitations;
HUMOROUS DIALOGUES,
For Festivals and Anniversaries; and
GEMS OF SACRED MELODY,
In Penny Sheets of Excellent Music.

Catalogues sent to any Address on receipt of a Penny Stamp.


Transcriber’s Notes
Retained publication information from the printed edition: this
eBook is public-domain in the country of publication.
Silently corrected a few palpable typos.
In the text versions only, text in italics is delimited by
_underscores_.
*** END OF THE PROJECT GUTENBERG EBOOK 88 FAVOURITE
CAROLS AND HYMNS FOR CHRISTMAS ***

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,

You might also like