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

Clearly Visual Basic: Programming with Microsoft Visual Basic 2010, Second Edition Diane Zak - eBook PDF pdf download

The document provides information about various eBooks related to Microsoft Visual Basic, including titles by Diane Zak and Tony Gaddis, available for download. It includes links to different editions of programming books and mentions the publisher's rights regarding content usage. Additionally, it outlines the structure and chapters of the book 'Clearly Visual Basic: Programming with Microsoft Visual Basic 2010, Second Edition' by Diane Zak.

Uploaded by

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

Clearly Visual Basic: Programming with Microsoft Visual Basic 2010, Second Edition Diane Zak - eBook PDF pdf download

The document provides information about various eBooks related to Microsoft Visual Basic, including titles by Diane Zak and Tony Gaddis, available for download. It includes links to different editions of programming books and mentions the publisher's rights regarding content usage. Additionally, it outlines the structure and chapters of the book 'Clearly Visual Basic: Programming with Microsoft Visual Basic 2010, Second Edition' by Diane Zak.

Uploaded by

feutzarion39
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/ 64

Clearly Visual Basic: Programming with Microsoft

Visual Basic 2010, Second Edition Diane Zak -


eBook PDF install download

https://ebookluna.com/download/clearly-visual-basic-programming-
with-microsoft-visual-basic-2010-second-edition-ebook-pdf/

Download more ebook from https://ebookluna.com


Instant digital products (PDF, ePub, MOBI) ready for you
Download now and discover formats that fit your needs...

Programming with Microsoft Visual Basic 2017 8th Edition


Diane Zak - eBook PDF

https://ebookluna.com/download/programming-with-microsoft-visual-
basic-2017-ebook-pdf/

ebookluna.com

(eBook PDF) Introduction to Programming Using Visual Basic


10th Edition

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

ebookluna.com

(eBook PDF) Starting Out With Visual Basic 8th Edition by


Tony Gaddis

https://ebookluna.com/product/ebook-pdf-starting-out-with-visual-
basic-8th-edition-by-tony-gaddis/

ebookluna.com

(eBook PDF) Starting Out With Visual Basic 7th Edition by


Tony Gaddis

https://ebookluna.com/product/ebook-pdf-starting-out-with-visual-
basic-7th-edition-by-tony-gaddis/

ebookluna.com
Microsoft Visual Basic 2017 for Windows, Web, and Database
Applications: Comprehensive 1st Edition Corinne Hoisington
- eBook PDF
https://ebookluna.com/download/microsoft-visual-basic-2017-for-
windows-web-and-database-applications-comprehensive-ebook-pdf/

ebookluna.com

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


Object-Oriented Programming 7th Edition

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

ebookluna.com

(eBook PDF) Starting out with Visual C# 5th Edition

https://ebookluna.com/product/ebook-pdf-starting-out-with-
visual-c-5th-edition/

ebookluna.com

Microsoft Visual C# Step by Step, 9th Edition John Sharp -


eBook PDF

https://ebookluna.com/download/microsoft-visual-c-step-by-step-9th-
edition-ebook-pdf/

ebookluna.com

Basic Japanese Second Edition Eriko Sato - eBook PDF

https://ebookluna.com/download/basic-japanese-second-edition-ebook-
pdf/

ebookluna.com
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 [email protected]
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
xiv

Preface

Clearly Visual Basic: Programming with Microsoft Visual Basic 2010, Second Edition is designed
for a beginning programming course. The book assumes students have no previous
programming knowledge or experience. However, students should be familiar with basic
Windows skills and file management. The book’s primary focus is on teaching programming
concepts, with a secondary focus on teaching the Visual Basic programming language. In other
words, the purpose of the book is to teach students how to solve a problem that requires a
computer solution. The Visual Basic language is used as a means of verifying that the solution
works correctly.

Organization and Coverage


Clearly Visual Basic: Programming with Microsoft Visual Basic 2010, Second Edition
contains 27 chapters and two appendices. In the chapters, students with no previous
programming experience learn how to analyze a problem specification and then plan and
create an appropriate computer solution. Pseudocode and flowcharts are used to plan the
solution, and desk-check tables are used to verify that the solution is correct before it is
coded. Students code the solutions using the Visual Basic 2010 language, and then desk-
check the code before it is executed. An entire chapter is devoted to teaching students how
to select appropriate test data. By the end of the book, students will have learned how to
write Visual Basic statements such as If…Then…Else, Select Case, Do…Loop, and
For…Next. Students also will learn how to create and manipulate variables, constants,
strings, sequential access files, structures, classes, and arrays. In addition, they will learn how
to connect an application to a Microsoft Access database, and then use Language Integrated
Query (LINQ) to query the database. They also will learn how to create simple Web
applications. The text also introduces students to OOP concepts and terminology. Appendix
A provides a listing of the data types available in Visual Basic. Appendix B contains the
answers to the Mini-Quizzes and TRY THIS Exercises in each chapter.

Approach
Rather than focusing on a specific programming language, Clearly Visual Basic:
Programming with Microsoft Visual Basic 2010, Second Edition focuses on programming
concepts that are common to all programming languages—such as input, output, selection,
and repetition. Concepts are introduced, illustrated, and reinforced using simple examples
and applications, which are more appropriate for a first course in programming. The
concepts are spread over many short chapters, allowing students to master the material one
small piece at a time. Because its emphasis is on teaching the fundamentals of programming,
the book covers only the basic controls, properties, and events available in Visual Basic.
Each chapter provides the steps for creating and/or coding an application that uses the
concepts covered in the chapter. The videos and PDF files that accompany each chapter are
designed to help students master the chapter’s concepts.
xv
Organization and Coverage

Features
Clearly Visual Basic: Programming with Microsoft Visual Basic 2010, Second Edition is an
exceptional textbook because it also includes the following features:
READ THIS BEFORE YOU BEGIN This section is consistent with Course Technology’s unequaled
commitment to helping instructors introduce technology into the classroom. Technical
considerations and assumptions about hardware, software, and default settings are listed in one
place to help instructors save time and eliminate unnecessary aggravation.
VIDEOS These notes direct students to videos that accompany each chapter in the book. The
videos explain and/or demonstrate one or more of the chapter’s concepts, provide additional
information about the concepts, or cover topics related to the concepts. The videos are available
online at www.cengagebrain.com. Search for the ISBN of your title (from the back cover of your
book) using the search box at the top of the page. This will take you to the product page where
free companion resources can be found.
WANT MORE INFO? FILES These notes direct students to files that accompany each chapter in
the book. The files contain additional examples and further explanations of the concepts
covered in the chapter. The files are in PDF format. The files are available online at www.
cengagebrain.com.

FIGURES Figures that introduce new statements, functions, or methods contain both the syntax
and examples of using the syntax. Including the syntax in the figures makes the examples more
meaningful.
OBJECTIVES Each chapter begins with a list of objectives so you know the topics that will be
presented in the chapter. In addition to providing a quick reference to topics covered, this
feature provides a useful study aid.
MINI-QUIZZES Mini-Quizzes are strategically placed to test students’ knowledge at various
points in each chapter. Answers to the quiz questions are provided in Appendix B in the book.
SUMMARY Each chapter contains a Summary section that recaps the concepts covered in the
chapter.
KEY TERMS Following the Summary section in each chapter is a listing of the key terms
introduced throughout the chapter, along with their definitions.
REVIEW QUESTIONS Each chapter contains Review Questions designed to test a student’s
understanding of the chapter’s concepts.
EXERCISES The Review Questions in each chapter are followed by Exercises, which provide
students with additional practice of the skills and concepts they learned in the chapter. The
Exercises are designated as TRY THIS, MODIFY THIS, INTRODUCTORY, INTERMEDIATE,
ADVANCED, FIGURE THIS OUT, and SWAT THE BUGS.
TRY THIS EXERCISES The TRY THIS Exercises should be the first Exercises students complete
after reading a chapter. These Exercises are similar to the application developed in the chapter,
and they allow students to test their understanding of the chapter’s concepts. The answers to
TRY THIS Exercises are provided in Appendix B in the book.
MODIFY THIS EXERCISES In these Exercises, students modify an existing application.

FIGURE THIS OUT EXERCISES These Exercises require students to analyze a block of code and
then answer questions about the code.
SWAT THE BUGS EXERCISES The SWAT THE BUGS Exercises provide an opportunity for
students to detect and correct errors in an existing application.
xvi
PREFACE Instructor Resources and Supplements

New to This Edition!


DESIGNED FOR THE DIFFERENT LEARNING STYLES The book provides videos for visual and
auditory learners, and tutorial sections and Want More Info? files for kinesthetic learners.
VIDEOS The videos that accompany each chapter have been updated and now contain self-
review quizzes.

WEB APPLICATIONS The Web Application chapter (Chapter 27) is now in the book rather than
online. The chapter now shows students how to create a Web application that contains two
Web pages. It also covers the LinkButton tool.
REVIEW QUESTIONS AND EXERCISES Additional Review Questions and Exercises have been
added to each chapter.
APPENDIX B Appendix B contains the answers to each chapter’s Mini-Quizzes and TRY THIS
Exercises. The answers are provided to give students immediate feedback and more opportunity
for learning.
POSTTEST LOOPS AND STRING CONCATENATION In the previous edition of the book, posttest
loops and string concatenation were covered in the same chapter. In this edition, posttest loops
are covered in a separate chapter (Chapter 13). String concatenation is now covered along with
counter-controlled loops in Chapter 14.
ARITHMETIC ASSIGNMENT OPERATORS These operators are covered along with pretest loops
in Chapter 12.
SELECTION STRUCTURES The selection structure chapters (Chapters 8, 9, and 10) now refer to
the different forms of the selection structure as single-alternative, dual-alternative, and multiple-
alternative.
REPETITION STRUCTURES The repetition structure chapters (Chapters 12, 13, and 14) were
revised to include the following terms: looping condition and loop exit condition.
STRING MANIPULATION The Remove method was added to the string manipulation chapter
(Chapter 23).
AUTO-IMPLEMENTED PROPERTIES Auto-implemented properties are covered in the video that
accompanies the chapter on classes (Chapter 26).

Instructor Resources and Supplements


All of the resources available with this book are provided to the instructor on a single CD-ROM.
Many also can be found at www.cengagebrain.com. At the CengageBrain.com home page, search
for the ISBN of your title (from the back cover of your book) using the search box at the top of
the page. This will take you to the product page where free companion resources can be found.
ELECTRONIC INSTRUCTOR’S MANUAL The Instructor’s Manual that accompanies this textbook
includes additional instructional material to assist in class preparation, including items such as
Sample Syllabi, Chapter Outlines, Technical Notes, Lecture Notes, Quick Quizzes, Teaching
Tips, Discussion Topics, and Additional Case Projects.
EXAMVIEW® This textbook is accompanied by ExamView, a powerful testing software package
that allows instructors to create and administer printed, computer (LAN-based), and Internet
exams. ExamView includes hundreds of questions that correspond to the topics covered in this
text, enabling students to generate detailed study guides that include page references for further
review. The computer-based and Internet testing components allow students to take exams at
their computers, and also save the instructor time by grading each exam automatically.
xvii
Acknowledgments

POWERPOINT PRESENTATIONS This book offers Microsoft PowerPoint slides for each chapter.
These are included as a teaching aid for classroom presentation, to make available to students on
the network for chapter review, or to be printed for classroom distribution. Instructors can add
their own slides for additional topics they introduce to the class.
DATA FILES Data Files are necessary for completing the computer activities in this book. The
Data Files are provided on the Instructor Resources CD-ROM and also may be found at www.
cengagebrain.com.
SOLUTION FILES Solutions to the chapter applications and the end-of-chapter Review
Questions and Exercises are provided on the Instructor Resources CD-ROM and also may be
found at www.cengagebrain.com. The solutions are password protected.
DISTANCE LEARNING Course Technology is proud to present online test banks in WebCT,
Blackboard, and Angel to provide the most complete and dynamic learning experience possible.
Instructors are encouraged to make the most of the course, both online and offline. For more
information on how to access the online test bank, contact your local Course Technology sales
representative.

Acknowledgments
Writing a book is a team effort rather than an individual one. I would like to take this
opportunity to thank my team, especially Jill Braiewa (Senior Content Project Manager), Alyssa
Pratt (Senior Product Manager), Tricia Coia (Freelance Product Manager), Nicole Ashton
(Quality Assurance), Suzanne Huizenga (Proofreader), and the compositors at Integra. Thank
you for your support, enthusiasm, patience, and hard work. Last, but certainly not least, I want
to thank the following reviewers for their invaluable ideas and comments: Wayne Payton,
Gadsden State Community College; Annette Kerwin, College of DuPage, Matthew Alimagham,
Spartanburg Community College; Anthony Basilico, College of Rhode Island; Frank Malinowski,
Darton College; Craig Brown, Boston College; and Laura Gipson, Beaufort Community College.

Diane Zak
xviii

Read This Before


You Begin

Technical Information
Data Files
You will need data files to complete the computer activities in this book. Your instructor may
provide the data files to you. You may obtain the files electronically at www.cengagebrain.com,
and then navigating to the page for this book.
Each chapter in this book has its own set of data files, which are stored in a separate folder
within the ClearlyVB2010 folder. The files for Chapter 3 are stored in the ClearlyVB2010\Chap03
folder. Similarly, the files for Chapter 4 are stored in the ClearlyVB2010\Chap04 folder.
Throughout this book, you will be instructed to open files from or save files to these folders.
You can use a computer in your school lab or your own computer to complete the chapter
applications and Exercises in this book.

Using Your Own Computer


To use your own computer to complete the computer activities in this book, you will need the
following:
l A Pentium® 4 processor, 1.6 GHz or higher, personal computer running Microsoft Windows.
This book was written and Quality Assurance tested using Microsoft Windows 7.
l Either Microsoft Visual Studio 2010 or the Express Editions of Microsoft Visual Basic 2010
and Microsoft Visual Web Developer 2010 installed on your computer. This book was
written using Microsoft Visual Studio 2010 Professional Edition, and Quality Assurance
tested using the Express Editions of Microsoft Visual Basic 2010 and Microsoft Visual Web
Developer 2010. At the time of this writing, you can download a free copy of the Express
Editions at www.microsoft.com/express/downloads (Visual Basic 2010 Express) and
http://www.microsoft.com/express/Downloads/#2010-Visual-Web-Developer
(Visual Web Developer 2010 Express). If necessary, use the following information when
installing the Professional or Express Editions of the software:

To configure Visual Studio 2010 or Visual Basic 2010 Express:


1. Start either Visual Studio 2010 or Visual Basic 2010 Express. If the Choose Default
Environment Settings dialog box appears when you start Visual Studio, select the Visual
Basic Development Settings option.
2. If you are using Visual Basic 2010 Express, click Tools on the menu bar, point to
Settings, and then click Expert Settings.
xix
Read This Before You Begin

3. Click Tools on the menu bar and then click Options to open the Options dialog box. If
necessary, deselect the Show all settings check box. Click the Projects and Solutions
node. Use the information shown in Figure 3-3 in Chapter 3 to select and deselect the
appropriate check boxes. (Your dialog box will look slightly different if you are using
Visual Basic 2010 Express.).
4. Expand the Projects and Solutions node in the Options dialog box and then click VB
Defaults. Verify that both Option Explicit and Option Infer are set to On. Also verify that
Option Strict and Option Compare are set to Off and Binary, respectively. Click the OK
button to close the Options dialog box.

To configure Visual Web Developer 2010 Express:


1. Start Visual Web Developer 2010 Express. Click Tools on the menu bar, point to
Settings, and then click Expert Settings.
2. Click Tools on the menu bar and then click Options to open the Options dialog box. If
necessary, select the Show all settings check box. Click the Projects and Solutions node.
Use the information shown in Figure 27-5 in Chapter 27 to select and deselect the
appropriate check boxes. When you are finished, click the OK button to close the
Options dialog box.

Figures
The figures in this book reflect how your screen will look if you are using Microsoft Visual
Studio 2010 Professional Edition and a Microsoft Windows 7 system. Your screen may appear
slightly different in some instances if you are using another version of Microsoft Visual Studio,
Microsoft Visual Basic, or Microsoft Windows.

Visit Our Web Site


Additional materials designed for this textbook might be available at www.cengagebrain.com.
Search this site for more details.

To the Instructor
To complete the computer activities in this book, your students must use a set of data files. The
files are included on the Instructor’s Resource CD. They also may be obtained electronically at
www.cengagebrain.com.
The material in this book was written using Microsoft Visual Studio 2010 Professional Edition
on a Microsoft Windows 7 system. It was Quality Assurance tested using the Express Editions of
Microsoft Visual Basic 2010 and Microsoft Visual Web Developer 2010 on a Microsoft
Windows 7 system. The book assumes that both Option Explicit and Option Infer are set to On,
Option Strict is set to Off, and Option Compare is set to Binary. To verify these settings, start
either Visual Studio 2010 or Visual Basic 2010 Express. Click Tools on the menu bar and then
click Options. Expand the Projects and Solutions node in the Options dialog box and then click
VB Defaults. Verify the four Option settings and then click the OK button to close the Options
dialog box.

Course Technology Data Files


You are granted a license to copy the data files to any computer or computer network used by
individuals who have purchased this book.
This page intentionally left blank
CHAPTER 1
I Am Not a Control Freak!
(Control Structures)

After studying Chapter 1, you should be able to:

Describe the three control structures


Write simple algorithms using the sequence, selection, and
repetition structures
2
CHAPTER 1 I Am Not a Control Freak! (Control Structures)

Control Structures
All computer programs, no matter how simple or how complex, are written using one or more of
three basic structures: sequence, selection, and repetition. These structures are called control
structures or logic structures, because they control the flow of a program’s logic. You will use the
sequence structure in every program you write. In most programs, you also will use both the
selection and repetition structures. This chapter gives you an introduction to the three control
structures. It also introduces you to a computerized mechanical man named Rob, who will help
illustrate the control structures. More detailed information about each structure, as well as how to
implement these structures using the Visual Basic language, is provided in subsequent chapters.

The Sequence Structure


You already are familiar with the sequence structure, because you use it each time you follow a
set of directions, in order, from beginning to end. A cookie recipe, for instance, provides a good
example of the sequence structure. To get to the finished product (edible cookies), you need
to follow each recipe instruction in order, beginning with the first instruction and ending with
the last. Likewise, the sequence structure in a computer program directs the computer to
process the program instructions, one after another, in the order listed in the program. You will
find the sequence structure in every program.
You can observe how the sequence structure works by programming a mechanical man named
Rob. Like a computer, Rob has a limited instruction set. This means that Rob can understand
only a specific number of instructions, also called commands. For now, you will use only three of
the commands from Rob’s instruction set: walk forward, turn right 90 degrees, and sit down.
When told to walk forward, Rob takes one complete step forward. In other words, he moves his
right foot forward one step and then moves his left foot to meet his right foot. For this first
example, Rob is facing a chair that is two steps away from him. Your task is to write the
instructions, using only the commands that Rob understands, that direct Rob to sit in the chair.
Figure 1-1 shows Rob, the chair, and the instructions that will get Rob seated properly. The five
instructions shown in the figure are called an algorithm, which is a set of step-by-step
instructions that accomplish a task. For Rob to be properly seated in the chair, he must follow
the instructions in order—in other words, in sequence.

1. walk forward
2. walk forward 2 steps
algorithm 3. turn right 90 degrees
4. turn right 90 degrees
5. sit down

Figure 1-1 An example of the sequence structure

The Selection Structure


As with the sequence structure, you already are familiar with the selection structure, also called
the decision structure. The selection structure indicates that a decision needs to be made,
followed by an appropriate action derived from that decision. You use the selection structure
3
Control Structures

every time you drive your car and approach a railroad crossing. Your decision, as well as the
appropriate action, is based on whether the crossing signals (flashing lights and ringing bells) are
on or off. If the crossing signals are on, you stop your car before crossing the railroad tracks;
otherwise, you proceed with caution over the railroad tracks. When used in a computer
program, the selection structure alerts the computer that a decision needs to be made, and it
provides the appropriate action to take based on the result of that decision.
You can observe how the selection structure works by programming Rob, the mechanical man.
In this example, Rob is holding either a red or yellow balloon, and he is facing two boxes. One of
the boxes is colored yellow and the other is colored red. The two boxes are located three steps
away from Rob. Your task is to have Rob drop the balloon into the appropriate box: the yellow
balloon belongs in the yellow box, and the red balloon belongs in the red box. To write an
algorithm to accomplish the current task, you need to use four additional instructions from
Rob’s instruction set: if the balloon is red, do this:, otherwise, do this:, drop the balloon in the red
box, and drop the balloon in the yellow box. The additional instructions allow Rob to make a
decision about the color of the balloon he is holding, and then take the appropriate action based
on that decision. Figure 1-2 shows an illustration of the current example, along with the correct
algorithm. Notice that the drop the balloon in the red box and drop the balloon in the yellow box
instructions are indented within the selection structure. Indenting in this manner clearly
indicates the instructions to be followed when the balloon is red, as well as the ones to be
followed when the balloon is not red.

1. walk forward
2. walk forward
3. walk forward
4. if the balloon is red, do this:
drop the balloon in the red box
indent otherwise, do this:
Red
drop the balloon in the yellow box 3 steps
Yellow

Figure 1-2 An example of the selection structure

The Repetition Structure


The last of the three control structures is the repetition structure. Like the sequence and
selection structures, you already are familiar with the repetition structure. For example,
shampoo bottles typically include the repetition structure in the directions for washing your
hair. Those directions usually tell you to repeat the “apply shampoo to hair,” “lather,” and “rinse”
steps until your hair is clean. When used in a program, the repetition structure directs the
computer to repeat one or more instructions until some condition is met, at which time the
computer should stop repeating the instructions. The repetition structure is also referred to as a
loop or as iteration.
You can observe how the repetition structure works by programming Rob, the mechanical man.
In this example, Rob is facing a chair that is 50 steps away from him. Your task is to write the
algorithm that directs Rob to sit in the chair. If the repetition structure was not available to
you, you would need to write the walk forward instruction 50 times, followed by the turn right
90 degrees instruction twice, followed by the sit down instruction. Although that algorithm
would work, it is quite cumbersome to write. Imagine if Rob were 500 steps away from the chair!
The best way to write the algorithm to get Rob seated in a chair that is 50 steps away from him
Other documents randomly have
different content
How little do they see what is, who frame
Their hasty judgment upon that which seems.
Southey.
If Seurat had not seen men of firmer make, he would not know
that the infirmity peculiar to himself is unnatural. Were he dressed
like other persons, there is nothing in his countenance or speech to
denote him different from themselves; and yet the difference is so
great, that it is wonderful that he should “live, and move, and have
his being.”

The “Interesting Account and Anatomical Description” of this


extraordinary individual, sold at the Chinese Saloon, where he is
exhibited, is to the following effect:—
Claude Ambroise Seurat was born at Troyes, in the department of
Champaigne, on the 10th of April, 1797, and is now therefore
twenty-eight years of age. His parents were respectable, but poor,
and neither of them presented any deformity, or uncommon
appearance; on the contrary, they are stated to have enjoyed robust
health. The child on coming into the world, presented the customary
baby form, but in proportion as the infant grew, the frame gradually
wasted away, and so continued to decrease until the attainment of
its full stature, which occurred at the usual term of life, at which
period Claude had attained his present height, while his frame had
dwindled to the skeleton form which it now so decidedly presents.
In France, where he ate very little of any animal food, a penny
French roll was enough for a day’s sustenance; but as he now
partakes of a small quantity of animal diet, his bread is reduced
accordingly.
As regards his feeding, those dishes which afford most
nourishment satisfy him the quickest; and two or three ounces a day
are quite sufficient.
In France he was accustomed to drink the wine of his country;
but in England he partakes of wines greatly diluted with water,
finding the liquors here so much stronger, as the Champaigne he
usually drank was what is denominated vin de pays, or small wine, of
which there is none in this country. In eating, he masticates his
victuals very much, taking small pieces, as the passage to the
stomach would not admit of any great repletion, and in drinking the
same precaution is required, otherwise suffocation would ensue. His
digestion is extremely good, and the consequent functions of nature
are regularly performed.
It is a singular fact, that such is the extreme sensitiveness of this
almost nondescript, or sport of nature, that when touched on the left
side with the finger, the surface of the body, to a certain extent, is
observed to manifest its sympathy, by an involuntary chill, which
contracts the pores, and produces that roughness of surface vulgarly
known by the denomination of goose’s skin. In raising either of his
feet from the floor, the limb appears to be distended uselessly from
the knee, and we cannot better illustrate the idea than by that
sensation we commonly experience upon allowing a limb to remain
too long in one position, thereby causing a temporary strangulation
of the vessels, known by the common term of the foot being asleep.
Previous to the arrival of Seurat in England, the French physicians
who had inspected him, gave it as their opinion, that his lungs were
placed in a different position to that usually occupied in the human
frame.
Since his arrival, sir Astley Cooper, by whom he has been visited,
finds that his heart is placed so much out of the common region
allotted to it, that it is precisely its own length lower than if properly
placed.
Many attempts were made to have Claude Ambroise Seurat
presented to the French king; but the father conceiving that he
might be consigned to some wretched asylum, there to subsist upon
a miserable pension, uniformly objected to it. From the statements
made by the father, it appears that the French gentlemen of the
faculty, who visited his son, handling him roughly, and pinching him
in every direction, the son refused to see them at all afterwards, and
thus imbibed such a distaste for his professional countrymen, that he
determined not to show himself to them any more. In consequence,
the Parisian Ecole de Medicine has never been made acquainted with
his existence.
Many proposals made to the father for the purchase of the body
of his son, Claude Ambroise Seurat, in the event of his demise, were
uniformly rejected. A medical gentleman particularly, in Burgundy,
offered a carte blanche, which the parent, with feelings highly
honourable to himself, refused, stating his determination, that in the
event of his son’s demise, he should be peaceably consigned to the
cemetery of his native city. While at Rouen, no less than one
thousand five hundred persons flocked in one day to see Seurat on
his road to England.
The health of this singular being has been very good. His
respiration is somewhat confined, being the necessary result of a
contraction of the lungs; yet, upon the whole, he does not appear to
be much inconvenienced on that account, in consequence of the
little exercise he takes, and the quiescent state of the animal system.
The texture of the skin is of a dry, parchment-like appearance,
which, covering any other human form, would not answer the
purposes of its functions, but seems calculated alone to cover the
slender, juiceless body of the being arrayed with it.
The ribs are not only capable of being distinguished, but may be
clearly separated and counted one by one, and handled like so many
pieces of cane; and, together with the skin which covers them,
resemble more the hoops and outer covering of a small balloon, than
any thing in the ordinary course of nature.
If any thing can exceed the unearthly appearance displayed by
this wonderful phenomenon, it is that taken by profile; which, from
the projection of the shoulder, pursuing the same down through the
extreme hollow of the back, and then following the line to the front
of the hip, nearly forms a figure of 3. In the front appears the
unnatural projection of the chest, from the falling in of the abdomen;
the prominence of the left side of the body, in consequence of the
position of the heart; and the sudden protrusion of the posteriors.
The action produced by the effort of the lungs does not proceed
from the chest, as in ordinary cases, but from the lower extremity of
the abdomen, as though the organs of respiration, from excessive
laxity, had absolutely descended from their proper sphere, and that
by a tenacious effort of nature, unwilling to yield possession of her
functions, they had accommodated themselves, by time, to such an
unnatural and incredible a position.
Seurat is presented to view in a state of nudity, save a mere
covering of several inches deep round the loins, through which are
cut large holes to admit the hip bones to pass through, for the
purpose of keeping it in its place. His general appearance is that of a
person almost entirely devoid of muscular substance, and conveys to
the mind the idea of a being composed of bones, cellular substance
and skin only on. It is true, the appearances of the face, neck, fore-
arm, and calves of the legs, may, in some measure, form exceptions
to this general assertion, since in these situations there is something
like flesh.
His height is about five feet seven inches and a half. The length
of his extremities proportionate to the height of his body. His head is
small rather than otherwise. The cranium, (or skull,) at the back
part, over the occipital protuberance above the neck, is much
flattened; the cervical organs in this situation being very sparely
developed. In other respects the skull is tolerably well formed.
Seurat’s countenance is by no means displeasing; for though the
cheek-bones are prominent, the cheeks themselves sunk, and the
other features of the face plain, still there is a placid and
contemplative expression, which indicates the presence of a serene
and thoughtful mind, claiming for itself from the spectators, feelings
of pity and regret.
The neck, on being examined from before, appears short, flat,
and broad. The shortness is principally owing to his inability to hold
the face properly elevated, in consequence of which the chin drops
down, and conceals the upper part of the neck. The flatness
depends on the little muscular and cellular substance present, and
on the great breadth of the neck, which takes from its natural
rotundity. This great breadth is caused by the peculiar form and
situation of the scapulæ, (or shoulder-blades,) the upper angles of
which, instead of laying on the posterior portions of the uppermost
ribs, are turned over the shoulder, and pass so far forward as nearly
to reach the middle of the clavicles, (the collar-bones,) where their
situation may be easily seen from before. Of course, the muscles
called levatores scapulæ, which arise from the upper vertebræ of the
neck, and usually pass downwards, and a very little outwards, in this
case, pass very much outwards, in a direction towards the shoulder-
joint, and extend the neck considerably in a lateral direction. These
muscles, from their size and turgidity, have the appearance of bones
in Seurat.
The larynx, as far as can be judged of from an external
examination, is well formed, and that protuberance of the thysoir
cartilage called pomum adami, or the apple of the throat, is
prominent.
The formation of the upper extremities and chest, is one of the
most remarkable features of this man. The left scapula is higher than
the right; both are remarkably prominent; so much so, that, when
viewed sideways, there appears to be a large tumour underneath the
skin, over the lower angle: this arises from the great projection of
the lower angle itself from the ribs. It has been already stated, that
the upper angle is placed unusually forwards, and at the bottom of
the neck, from this point, the scapula proceeds backwards, and, to
permit its closer application to the upper and back part of the chest,
its concave surface is remarkably curved, but still not sufficiently so
to prevent the lower angle from projecting in an unseemly manner.
This arrangement of the component parts of the scapula and its
muscles, interferes very much with the freedom of its movements,
particularly the rotatory ones, which in other subjects are so varied.
Seurat can raise his hands and arms from his side, in a lateral
direction, to a position nearly horizontal. He cannot, however, pass
them far forwards, when thus elevated. He can throw the scapula
backwards, so as to make them almost meet at their lower ends;
nevertheless, he is unable to lift his hands to his mouth, so as to
feed himself in the ordinary way. When eating, he places his elbow
on the table before him, then, by raising his hand, thus supported,
and passing his head downwards, so as to meet it half way as it
were, he is able to put his food into his mouth.
The humerus, or bone of the arm, from the elbow to the
shoulder, appears quite destitute of muscle, and as if it consisted of
bone, skin, vessels, and cellular membrane only. It may be
remarked, however, that at that part where the biceps muscle is
generally, there is a trifling fulness, probably caused by a few fibres
of that muscle.
The piner, the bone of the arm from the elbow to the wrist,
seems at the elbow joint considerably enlarged, but, in fact, it is only
of its natural dimensions. The muscles of the fore-arm, though small,
may, nevertheless, be distinctly traced. The hands are perfect in
appearance. Seurat, however, cannot straighten his fingers, but
keeps them in a semi-bent position; with this exception, he can use
them freely.
The trunk is singularly shaped. Viewed from the front, the chest
is not particularly narrow; it measures, from one shoulder to the
other, across the sternum, or breast-bone, sixteen inches. The
sternum is much flattened, as though it had been driven inwards,
towards the dorsal vertebra, or back-bone. In well-formed people,
the sternum is a little convex, externally, and concave, internally,
permitting all possible room for the thoracic viscera. In Seurat,
however, this order of things is changed, the outer surface of the
breast-bone being concave, and the internal convex. It is pushed so
far inwards, as scarcely to leave more than one and a half inches, or
two inches between itself and the opposite vertebræ.
This position of the sternum, and of the ribs, may probably afford
an explanation of the causes which produce a slight impediment to
his swallowing with despatch, or such morsels as are not cut very
small; and of the unnatural situation of the heart, which, instead of
being placed behind the 3d, 4th, and 5th ribs, is observed pulsating
very low down behind the 7th, 8th, and 9th, ribs, in the situation of
the left hypochondrium. The five or six lower ribs, called false or
floating ribs, are rounder, and approach nearer to nature in their
form, thereby affording sufficient space for the heart, stomach, and
liver, and some other of the abdominal viscera. It is conceived, that
without this freer sweep of the lower ribs, life could not have been
maintained, so much would the functions of the heart, and
chylopretic viscera have been interrupted. The false ribs descend
very low down, on each side, there being scarcely one and a half
inch between them and the crest of the ileum. The pelvis is
capacious, and on its front aspect presents nothing very
extraordinary.
There is an appearance of the abdomen, which must not be
passed over. When looking at it, one might almost suppose that it
consisted of two cavities, an upper and a lower one, so much is this
poor fellow contracted round the loins. The following
admeasurement may afford some idea of this circumstance:—
Ft. In.
Circumference of the chest, directly under the armpits 2 63⁄4
Circumference lower down, opposite the second false rib 2 2
Circumference round the loins 1 9
Circumference round the pelvis 2 31⁄2

The muscles of the sides of the pelvis, partake of the general


wasting, in consequence of which the trochantes stand out from the
glenon cavities in the same gaunt manner that they do in the true
skeleton, being covered by integuments alone. The thighs are
imperfect in bulk, and the knees, like the elbows, appear enlarged.
The calves of the legs seem to have more firm good muscle, than
any other part of the body, particularly that of the right leg, which is
much more fleshy than the left. The feet are well formed; a trifling
overlapping of the toes is probably accidental.
The examination of the back part of Seurat’s body corresponds
with the front, as far as the general leanness goes. The occiput is
flat, the neck broad; the scapula projecting, the spine crooked; some
of the lower cervical vertebræ are curved backwards, and there is a
curve towards the right side, formed by some of the lower dorsal
vertebræ. All the bony points of the back part of the body are so
prominent that every individual bone may be distinctly traced by the
eye, even at a considerable distance.
On first beholding Seurat, a person might almost imagine that he
saw before him, one returned from “that bourne whence no traveller
returns:” the first impressions over, he begins to wonder how so frail
a being exists, and is surprised, that all those functions, necessary
for the continuance of his own life, are regularly and effectively
performed. He eats, drinks, and sleeps—the progress of digestion, as
carried on throughout the alimentary canal, is regularly executed.
The secretions of the liver, kidnies, and skin are separated from the
blood, in such quantities as may be deemed necessary for the
economy of his frame. His heart performs its office regularly, and
sends the blood to the various parts of the body, in due proportions.
He can bear the effects of heat and cold, like other people
accustomed to lead a sedentary life, and does not need unusual
clothes. His mind is better constituted, perhaps, than that of many a
man, better formed in body. He comprehends quickly, and his
memory is good. He has learnt to read and write his own language,
and is now anxious to become acquainted with ours.
Such is Claude Ambroise Seurat, who may justly be considered as
a most extraordinary lusus naturæ,—an object calculated to throw
much and useful light on many interesting questions of the highest
importance, towards the advancement of anatomical study.

So far from having any disinclination to being exhibited in this


country, Claude Ambroise Seurat has repeatedly urged his wish to
gratify the strong desire of the public, to view him without loss of
time; and hearing that one of the journals had expressed some
harshness concerning his exhibition, he indited and signed the
following letter
To the Editor.
Sir,
Having learned that in an article in your journal, the motives and
conduct of the persons who brought me to England are severely
alluded to, it is my duty, both to them and to the public, to declare,
that so far from experiencing any thing disagreeable, either in having
been conducted hither or at being exposed, I feel great satisfaction
not only in the change of my situation, but also at the bounties with
which I have been loaded by the individuals who protect me. Far
from having “been brought from the tranquillity of my native village,”
I was wandering about France, and making but little by the exposure
of my person, when I so fortunately met my present protectors,
whose liberality will shortly render me sufficiently independent to
enable me to return and live at my ease in my native country. I only
beg leave to add, that my present situation is more happy than I
ever yet enjoyed during my whole life, and is entirely conformable to
my desires.
I have the honour to be, Sir, your most humble servant,
Claude Ambroise Seurat.
Aug. 4, 1825.
This, with what follows, will give a tolerably adequate idea of this
singular being, both as to his form and mind.
I have paid two visits to Seurat. His public exhibition takes place
in a room in Pall-mall called the “Chinese Saloon;” its sides are
decorated with Chinese paper; Chinese lanterns are hung from lines
crossing from wall to wall. In front of a large recess, on one side, is a
circular gauze canopy over a platform covered with crimson cloth,
raised about eighteen inches from the floor, and enclosed by a light
brass railing; the recess is enclosed by a light curtain depending from
the cornice to the floor of the platform, and opening in the middle. A
slight motion within intimates that the object of attraction is about to
appear; the curtain opens a little on each side, and Seurat comes
forth, as he is represented in the first engraving, with no other
covering than a small piece of fringed purple silk, supported round
the middle by a red band, with a slit like pocket holes, to allow the
hip-bones to pass through on each side. On the finger of the left
hand, next to the middle one, he wears a plain gold ring. An artist
who accompanied me at each visit, for the purpose of making the
drawings here engraved, has well represented him. The portraits,
both front and profile, are better resemblances than any that exist,
and the anatomy of his figure more correct.
It is justly remarked, that “the title of ‘Living Skeleton’ does not
seem exactly to be well applied to this strange production of nature,
and may, perhaps, create some disappointment; because the
curiosity, as it really exists, lies far less in the degree of attenuation
which Seurat’s frame exhibits, than in the fact that, with a frame so
reduced, a human being should be still in possession of most of his
functions, and enjoying a reasonable quantity of health. As regards
the exhibition of bone, for instance, there is not so much as may
frequently be found (in the dead subject) in cases where persons
have died of lingering consumption. The parchment-like aspect
attributed to the skin too seems to have been a little overstated;
and, in fact, most medical men who served in the late war, will
recollect instances enough, where men of five feet eight inches high,
dying from dysentery, or intermittent fever, have weighed
considerably less than 78lbs., which is the weight of Seurat. The real
novelty, therefore, should be looked for, not in the degree to which
this man’s body is wasted and exhausted, but in the fact that such a
degree of decay should be compatible with life, and the possession
of some degree of strength and spirits. This decay does not seem to
have operated equally upon all parts of the figure: it shows most
strikingly in the appearance of the neck and trunk; the upper arms,
from the shoulder to the elbow, and the thigh. The upper part of the
arm is not quite destitute of flesh; but so small, that it may be
spanned with ease by a very moderate fore-finger and thumb. The
thighs are wasted very much—little remains upon them beyond the
skin. The cap of the knee, which is large, and protrudes considerably,
is of a reddish colour, unlike the aspect of the flesh or skin in
general. The trunk, from the shoulder to the hip, has the
appearance, more than any thing else, of a large bellows, a mere
bag of hoops covered with leather, through which the pulsation of
the heart is distinctly visible. On the thicker part of the fore-arm
there is flesh, white in appearance, though of a soft and unhealthy
character; and the division of the two bones, the ulna and the
radius, may be detected by feeling. Upon the calves of the legs,
again, there is some show of substance, and one is larger than the
other. But the most curious circumstance, perhaps, in the man’s
condition is, that while his whole body exhibits these extraordinary
appearances of decay, his face (which is decidedly French, and not
unpleasant,) displays no signs of attenuation whatever, and scarcely
any symptom of disease or weakness.”[226]
It was on the first day of Seurat’s exhibition that I first visited
him; this was on Tuesday, the 9th of August, 1825; a day the present
sheet of the Every-Day Book has not yet reached; I have been
anxious to be before the day and the public, as regards Seurat, and
it is therefore, as to him, anticipated. I was at the “Chinese Saloon”
before the doors were opened, and was the first of the public
admitted, followed by my friend, the artist. Seurat was not quite
ready to appear; in the mean time, another visitor or two arrived,
and after examining the canopy, and other arrangements, my
attention was directed to the Chinese papering of the room, while
Seurat had silently opened the curtains that concealed him, and
stood motionless towards the front of the platform, as he is
represented in the engraving. On turning round, I was instantly
rivetted by his amazing emaciation; he seemed another “Lazarus,
come forth” without his grave-clothes, and for a moment I was too
consternated to observe more than his general appearance. My eye,
then, first caught the arm as the most remarkable limb; from the
shoulder to the elbow it is like an ivory German flute somewhat
deepened in colour by age; it is not larger, and the skin is of that
hue, and, not having a trace of muscle, it is as perfect a cylinder as a
writing rule. Amazed by the wasted limbs, I was still more amazed
by the extraordinary depression of the chest. Its indentation is
similar to that which an over-careful mother makes in the pillowed
surface of an infant’s bed for its repose. Nature has here inverted her
own order, and turned the convex inwards, while the nobler organs,
obedient to her will, maintain life by the gentle exercise of their
wonted functions in a lower region. Below the ribs, which are well
described in the accounts already given, the trunk so immediately
curves in, that the red band of the silk-covering, though it is only
loosely placed, seems a tourniquet to constrict the bowels within
their prison house, and the hip-bones, being of their natural size, the
waist is like a wasp’s. By this part of the frame we are reminded of
some descriptions of the abstemious arid Bedouin Arab of the desert,
in whom it is said the abdomen seems to cling to the vertebra. If the
integument of the bowels can be called flesh, it is the only flesh on
the body: for it seems to have wholly shrunk from the limbs; and
where the muscles that have not wholly disappeared remain, they
are also shrunk. He wears shoes to keep cold from his feet, which
are not otherwise shaped than those of people who have been
accustomed to wear tight shoes; his instep is good, and by no means
so flat as in the generality of tavern waiters. His legs are not more ill-
shaped than in extremely thin or much wasted persons; the right
leg, which is somewhat larger than the left, is not less than were the
legs of the late Mr. Suett, the comedian. On this point, without a
private knowledge of Mr. Liston, I would publicly appeal to that
gentleman, whom, on my second visit in the afternoon, I saw there,
accompanied by Mr. Jones. Mr. Liston doubtless remembers Suett,
and I think he will never forget Seurat, at whom he looked,
“unutterable things,” as if he had been about to say—“Prodigious!”
Seurat’s head and body convey a sentiment of antithesis. When
the sight is fixed on his face alone, there is nothing there to denote
that he varies from other men. I examined him closely and
frequently, felt him on different parts of the body, and, not speaking
his language, put questions to him through others, which he readily
answered. His head has been shaved, yet a little hair left on the
upper part of the neck, shows it to be black, and he wears a wig of
that colour. His strong black beard is perceptible, although clean
shaved. His complexion is swarthy, and his features are good,
without the emaciation of which his body partakes; the cheek-bones
are high, and the eyes are dark brown, approaching to black. They
are represented as heavy and dull, and to denote little mental
capacity; but, perhaps, a watchful observer, who made pertinent
inquiries of him in a proper manner, would remark otherwise. He
usually inclines the head forward towards his breast, and therefore,
and because he is elevated above the spectators, his eyes frequently
assume a position wherein he might see, and “descant on his own
deformity.” His features are flexible, and therefore capable of great
animation, and his forehead indicates capacity. Depression of the
eyelid is by no means to be taken as a mark of dulness or inefficient
intellect. One of our poets, I think Churchill, no incompetent judge of
human nature, has a line concerning Genius “lowering on the
penthouse of the eye.” Seurat, on any other than a common-place
question, elevates his head to an ordinary position, answers
immediately and with precision, and discourses rationally and
sensibly; more sensibly than some in the room, who put childish
questions about him to the attendants, and express silly opinions as
to his physical and mental structure and abilities, and call him “a
shocking creature.” There is nothing shocking either in his mind or
his face. His countenance has an air of melancholy, but he expresses
no feeling of the kind; it is not, however, so mournful as the
engraving at the head of this article shows. The artist was timid, and
in form and habit the reverse of Seurat; and as “like will to like,” so
through dislike to the life of the subject before him, he imagined
more dolour in Seurat’s face than it has; this could not be remedied
by the engraver without hazarding the likeness, which is really good.
Seurat’s voice is pleasing, deep-toned, and gentle. Except for the
privations to which his conformation constrains him, he is not an
object of pity, and perhaps very little on that account. We meet
many perfectly-formed beings in daily society whose abject
indulgences or abject circumstances in life render them far more
pitiable, and in a moral point of view, some of them are far more
shocking. There is nothing in Seurat to disgust, as far as I could
judge from what I saw or heard of him.
Thou who despisest so debased a fate
As in the pride of wisdom thou may’st call
The much submissive Seurat’s low estate,
Look round the world, and see where over all
injurious passions hold mankind in thrall!—
Behold the fraudful arts, the covert strife,
The jarring interests that engross mankind;
The low pursuits, the selfish aims of life;
Studies that weary and contract the mind,
That bring no joy, and leave no peace behind;—
And Death approaching to dissolve the spell!
Southey’s Tale of Paraguay.
Death is not contemplated by Seurat as near to him, and it is
even probable that his “last event” is far off. The vital organs have
wonderfully conformed themselves to his malformation, and where
they are seated, perform their office uninterruptedly. The quantity of
solid nutriment for the support of his feeble frame never exceeds
four ounces a day. The pulsations of his heart are regular, and it has
never palpitated; at the wrist, they are slow and equally regular. He
has never been ill, nor taken medicine, except once, and then only a
small quantity of manna. His skin is not more dry than the skin of
many other living persons who abstain, as he does, from strong
vinous or fermented liquors, and drink sparingly; it is not branny, but
perfectly smooth; nor is it of a colour unnatural to a being who
cannot sustain much exercise, who exists in health with very little,
and therefore does not require more. The complexion of his body is
that of a light Creole, or perhaps more similar to that of fine old
ivory; it must be remembered, that his natural complexion is
swarthy. What has been asserted elsewhere is perfectly true, that
when dressed in padded clothes, he would not in any position be
more remarkable than any other person, except that, among
Englishmen, he would be taken for a foreigner. On the day before his
public exhibition, he walked from the Gothic-hall in the Haymarket,
to the Chinese Saloon in Pall-mall, arm-in-arm with the gentleman
who brought him from France, and was wholly unrecognized and
unnoticed.
Until ten years of age, Seurat was as healthy as other children,
except that his chest was depressed, and he was much weaker; until
that year, he used to run about and play, and tumble down from
feebleness. From that age his feebleness increased, and he grew
rapidly until he was fourteen, when he attained his present stature,
with further increase of weakness: he is not weaker now than he
was then. His recreation is reading, and he is passionately fond of
listening to music. He cannot stoop, but he can lift a weight of
twelve pounds from a chair: of course, he displays no feats of any
kind, and unless great care is taken, he may be injured by cold, and
the fatigue of the exhibition. Of this, however, himself and his father,
who is with him, and who is a shrewd, sensible man, seem aware.
He remains about ten minutes standing and walking before the
company, and then withdraws between the curtains to seat himself,
from observation in a blanketed arm-chair, till another company
arrives. His limbs are well-proportioned; he is not at all knock-kneed,
nor are his legs any way deformed.
Seurat is “shocking” to those who have never reflected on
mortality, and think him nearer to the grave than themselves.
Perhaps he is only so in appearance. The orderly operation of the
vita principle within him for the last thirteen or fourteen years, may
continue to the ordinary duration of human life. Every one of his
spectators is “encompassed in a ghostly frame,” and exemplifies, as
much as Seurat, the scriptural remark, that “in the midst of life we
are in death:” it is not further from us for not thinking on it, nor is it
nearer to us because it is under our eyes.

Seurat’s Positions when exhibiting


himself.
Seurat’s existence is peculiar to himself; he is unlike any being
ever heard of, and no other like him may ever live. But if he is alone
in the world, and to himself useless, he may not be without his use
to others. His condition, and the privations whereby he holds his
tenure of existence, are eloquent to a mind reflecting on the few real
wants of mankind, and the advantages derivable from abstinent and
temperate habits. Had he been born a little higher in society, his
mental improvement might have advanced with his corporeal
incapacity, and instead of being shown as a phenomenon, he might
have flourished as a sage. No man has been great who has not
subdued his passions; real greatness has insisted on this as essential
to happiness, and artificial greatness shrunk from it. When Paul
“reasoned of righteousness, temperance, and judgment to come,
Felix trembled.” Seurat’s appearance seems an admonition from the
grave to “think on these things.”

[218] Morning Herald.


[219] The Times.
[220] Zoological Anecdotes.
[221] Ibid.
[222] Ibid.
[223] Maitland’s London, edit. 1772, i. 17.
[224] Gent. Mag.
[225] Patrick’s Devot. of Rom. Church.
[226] Times.

July 27.
St. Pantaleon, A. D. 303. Sts. Maximian, Malchus,
Martinian, Dionysius, John, Serapion, and
Constantine, the Seven Sleepers, A. D. 250. St.
Congail, St. Luica.
THE SEVEN SLEEPERS.

These saints, according to Alban Butler, were Ephesians, who for


their faith, under Decius, in 250, were walled up together in a cave,
wherein they had hid themselves, till they were found in 479; and
hence, he says, “some moderns have imagined that they only lay
asleep till they were found.” He designates them in his title, however,
as having been “commonly called the seven sleepers;” and we shall
see presently who his “moderns” are. He adds, that “the cave
wherein their bodies were found, became famous for devout
pilgrimages, and is still shown to travellers, as James Spon testifies.”
The miraculous story of the seven sleepers relates, that they
remained in the cave till the heresy that “denyed the resurreccyon of
deed bodyes” under Theodotian, when a “burges” of Ephesus
causing a stable to be made in the mountain, the masons opened
the cave, “and then these holy sayntes that were within awoke and
were reysed,” and they saluted each other, and they “supposed
veryley that they had slepte but one nyght onely,” instead of two
hundred and twenty-nine years. Being hungry, Malchus, one of
themselves, was deputed to go to Ephesus and buy bread for the
rest; “and then Malchus toke V shillynges, and yssued out of the
cave.” He marvelled when he saw the mason’s work outside, and
when he came to one of the gates of Ephesus he was “all doubtous,”
for he saw the sign of the cross on the gate; then he went to
another gate, and found another cross; and he found crosses on all
the gates; and he supposed himself in a dream; but he comforted
himself, and at last he entered the city, and found the city also was
“garnysshed” with the cross. Then he went to the “sellers of breed,”
and when he showed his money, they were surprised, and said one
to another, that “this yonge man” had found some old treasure; and
when Malchus saw them talk together, he was afraid lest they should
take him before the emperor, and prayed them to let him go, and
keep both the money and the bread; but they asked who he was, for
they were sure he had found a treasure of the “olde emperours,” and
they told him if he would inform them they would divide it, “and
kepe it secret.” But Malchus was so terrified he could not speak; then
they tied a cord round his neck, and drove him through the middle of
the city; and it was told that he had found an ancient treasure, and
“all the cite assembled aboute hym;” and he denied the charge, and
when he beheld the people he knew no man there; and he supposed
they were carrying him before the emperor Decius, but they carried
him to the church before St. Martin and Antipater, the consul; and
the bishop looked at the money, and marvelled at it, and demanded
where he had found the hidden treasure; and he answered, that he
had not found it, that it was his own, and that he had it of his
kinsmen. Then the judge said his kinsmen must come and answer
for him; and he named them, but none knew them; and they
deemed that he had told them untruly, and the judge said, how can
we believe that thou hadst this money of thy friends, when we read
“that it is more than CCC.lxxii. yere syth it was made,” in the time of
Decius, the emperor, how can it have come to thee, who art so
young, from kinsmen so long ago; thou wouldst deceive the wise
men of Ephesus: I demand, therefore, that thou confess whence
thou hadst this money. Then Malchus kneeled down, and demanded
where was Decius, the emperor; and they told him there was no
such emperor then in the world whereat Malchus said he was greatly
confused that no man believed he spoke the truth, yet true it was
that he and his fellows saw him yesterday in that city of Ephesus.
Then the bishop told the judge that this young man was in a
heavenly vision, and commanded Malchus to follow him, and to show
him his companions. And they went forth, and a great multitude of
the city with them towards the cave; and Malchus entered first into
the cave, and the bishop next, “and there founde they amonge the
stones the lettres sealed with two seales of syluer,” and then the
bishop read them before all the people; and they all marvelled, “and
they sawe the sayntes syttynge in the caue, and theyr visages lyke
unto roses flouryng.” And the bishop sent for the emperor to come
and see the marvels. And the emperor came from Constantinople to
Ephesus, and ascended the mountain; and as soon as the saints saw
the emperor come, “their vysages shone like to the sonne,” and the
emperor embraced them. And they demanded of the emperor that
he would believe the resurrection of the body, for to that end had
they been raised; and then they gave up the ghost, and the emperor
arose and fell on them weeping, “and embraced them, and kyssed
them debonayrly.” And he commanded precious sepulchres of gold
and silver to bury their bodies therein. But the same night they
appeared to the emperor, and demanded of him to let their bodies lie
on the earth, as they had lain before, till the general resurrection;
and the emperor obeyed, and caused the place to be adorned with
precious stones. And all the bishops that believed in the resurrection
were absolved.[227]
In the breviary of the church of Salisbury, there is a prayer for the
27th of July, beseeching the benefit of the resurrection through the
prayers of the seven sleepers, who proclaimed the eternal
resurrection. Bishop Patrick,[228] who gives us the prayer, says, “To
show the reader in what great care the heads of the Romish church
had in those days of men’s souls, how well they instructed them, and
by what fine stories their devotions were then conducted, I cannot
but translate the history of these seven sleepers, as I find it in the
Salisbury breviary; which, if it had been designed to entertain youth
as the history of the Seven Champions, might have deserved a less
severe censure; but this was read in the church to the people, as
chapters are out of the bible, and divided into so many lessons.” He
then gives the story of the seven sleepers as it stands in the
breviary, and adds, that there was no heresy about the resurrection
in the days of Theodotian, and that if any had a mind to see the
ground of their prayer in the breviary, and the “stuff” of the legend
of the seven sleepers, they might consult “Baronius’s notes upon the
Roman Martyrology, July 27.”
It appears then, that the ecclesiastics of the church of Salisbury
were among the “moderns” of Alban Butler, “who imagined” of the
seven sleepers as related in the legend, and so imagining, taught the
“stuff,” as bishop Patrick calls it, to their flocks. Yet Alban Butler
weeps over the Reformation, which swept the “imaginations” of his
“moderns” away, and he would fain bring us back to the religion of
the imaginers.

FLORAL DIRECTORY.
Purple Loosestrife. Lythrum Salicaria.
Dedicated to St. Pantaleon.

[227] Golden Legend.


[228] In his “Reflections on the Devotions of the Romish Church.”

July 28.
Sts. Nazarius and Celsus, A. D. 68. St. Victor, Pope, A. D.
201. St. Innocent I. Pope, A. D. 417. St. Sampson, A. D.
564.

Musical Prodigies.

There is at present in Berlin, a boy, between four and five years


old, who has manifested an extraordinary precocity of musical talent.
Carl Anton Florian Eckert, the son of a sergeant in the second
regiment of Fencible Guards, was born on the 7th of December,
1820. While in the cradle, the predilection of this remarkable child for
music was striking, and passages in a minor key affected him so
much as to make tears come in his eyes. When about a year and a
quarter old, he listened to his father playing the air “Schone Minka”
with one hand, on an old harpsichord: he immediately played it with
both hands, employing the knuckles in aid of his short and feeble
fingers. He continued afterwards to play every thing by the ear. He
retains whatever he hears in the memory, and can tell at once
whether an instrument is too high or too low for concert pitch. It was
soon observed that his ear was sufficiently delicate to enable him to
name any note or chord which might be struck without his seeing it.
He also transposes with the greatest facility into any key he pleases,
and executes pieces of fancy extempore. A subscription has been
opened to buy him a pianoforte, as he has got tired of the old
harpsichord, and two able musicians have undertaken to instruct
him.[229]
Eckert was pre-rivalled in England by the late Mr. Charles Wesley,
the son of the rev. Charles Wesley, and nephew to the late rev. John
Wesley, the founder of the religious body denominated methodists.
The musical genius of Charles Wesley was observed when he was
not quite three years old; he then surprised his father by playing a
tune on the harpsichord readily, and in just time. Soon afterwards he
played several others. Whatever his mother sang, or whatever he
heard in the streets, he could, without difficulty, make out upon this
instrument. Almost from his birth his mother used to quiet and
amuse him with the harpsichord. On these occasions, he would not
suffer her to play only with one hand, but, even before he could
speak, would seize hold of the other, and put it upon the keys. When
he played by himself, she used to tie him by his back-string to the
chair, in order to prevent his falling. Even at this age, he always put
a true bass to every tune he played. From the beginning he played
without study or hesitation. Whenever, as was frequently the case,
he was asked to play before a stranger, he would invariably inquire in
a phrase of his own, “Is he a musiker?” and if he was answered in
the affirmative, he always did with the greatest readiness. His style
on all occasions was con spirito; and there was something in his
manner so much beyond what could be expected from a child, that
his hearers, learned or unlearned, were invariably astonished and
delighted.
When he was four years old, Mr. Wesley took him to London; and
Beard, who was the first musical man who heard him there, was so
much pleased with his abilities, that he kindly offered his interest
with Dr. Boyce to get him admitted among the king’s boys. This,
however, his father declined, as he then had no thoughts of bringing
him up to the profession of music. He was also introduced among
others to Stanley and Worgan. The latter in particular, was extremely
kind to him, and would frequently entertain him by playing on the
harpsichord. The child was greatly struck by his bold and full manner
of playing, and seemed even then to catch a spark of his fire. Mr.
Wesley soon afterwards returned with him to Bristol; and when he
was about six years old, he was put under the tuition of Rooke, a
very good-natured man, but of no great eminence, who allowed him
to run on ad libitum, whilst he sat by apparently more to observe
than to control him. Rogers, at that time the oldest organist in
Bristol, was one of his first friends. He would often sit him on his
knee, and make the boy play to him, declaring, that he was more
delighted in hearing him then himself. For some years his study and
practice were almost entirely confined to the works of Corelli,
Scarlatti, and Handel; and so rapid was his progress, that, at the age
of twelve or thirteen, it was thought that no person was able to excel
him in performing the compositions of these masters. He was
instructed on the harpsichord by Kelway, and in the rules of
composition by Dr. Boyce. His first work, “A Set of Six Concertos for
the Organ or Harpsichord,” published under the immediate inspection
of that master, as a first attempt, was a wonderful production; it
contained fugues which would have done credit to a professor of the
greatest experience and the first eminence. His performance on the
organ, and particularly his extempore playing on that sublime
instrument, was the admiration and delight of all his auditors.

The present Mr. Samuel Wesley, brother of the preceding, and


born in 1766, also gave a very early indication of musical genius.
When only three years of age, he could play on the organ; and,
when eight years old, attempted to compose an oratorio. Some of
the airs which he wrote for the organ were shown to Dr. Boyce, and
occasioned the doctor to say, “This boy unites, by nature, as true a
bass as I can do by rule and study.” Mr. Wesley’s compositions are in
the highest degree masterly and grand; and his extempore
performance of fugues on the organ astonishing. He produces from
that solemn instrument all the grand and serious graces of which it is
capable. His melodies, though struck out on the instant, are sweet
and varied, and never common-place; his harmony is appropriate,
and follows them with all the exactness and discrimination of the
most studious master; his execution, which is very great, is always
sacrificed to the superior charms of expression.[230]
To this be it added, that the intellectual endowments of Mr.
Samuel Wesley equal his musical talents, and that the amiable and
benevolent qualities of his nature add lustre to his acquirements. He
is a man of genius without pretension, and a good man without
guile.

FLORAL DIRECTORY.

Mountain Groundsel. Senecio montanus.


Dedicated to St. Innocent.

[229] The Parthenon, a new musical work typolithographied, notices this


precocious musician on the authority of the German papers.
[230] These anecdotes of the present Mr. Samuel Wesley and his
deceased brother, Charles, are from the “Biographical Dictionary of
Musicians,” a work before quoted, and praised as a most pleasant book.

July 29.
St. Martha V. Sts. Simplicius and Faustinus, brothers,
and Beatrice, their sister, A. D. 303. St. William, Bp. A.
D. 1234. St. Olaus, or Olave, king of Norway, A. D.
1030. St. Olaus, king of Sweden.
WATER IN WARM WEATHER.

Fountains and Pumps.

By the process of boring, springs may be reached more


expeditiously and economically than by the old method of well
digging. The expense of boring from one to two hundred feet deep is
little more than one-fourth of digging, seventy feet is less than a
fourth, thirty feet is less than a fifth, and from ten to twenty feet it is
not so much as a sixth. In 1821, the water for the fountain at
Tottenham High Cross, represented in the engraving, was obtained
by boring to a depth of one hundred and five feet, at the expense of
the parish, for public accommodation. The water rises six feet above
the surface, and flowing over a vase at the top of the column into a
basin, as represented in the engraving, it pours from beneath. The
boring for this spring and the fountain were suggested by Mr.
Mathew, who first obtained water in Tottenham, by that method, and
introduced the practice there. The pillar was designed by Messrs.
Mathew and Chaplin, and executed by Mr. Turner of Dorset-street,
Fleet-street, the well known manufacturer of the cast iron pumps;
and not to withhold from him any of “his blushing honours,” be it
noted that he was till lately a common-councilman of the ward of
Farringdon Without, where he still maintains his reputation as a
“cunning workman in iron,” and his good name as a good pump-
maker, and as a worthy and respectable man. Public spirit should rise
to the height of giving him, and others of the worshipful company of
pump-makers, more orders. Many places are sadly deficient of
pumps for raising spring-water where it is most wanted. Every body
cries out for it in hot weather, but in cool weather they all forget
their former want; and hot weather comes again and they call out
for it again in vain, and again forget to put up a public pump. At
Pentonville, a place abounding in springs, and formerly abounding in
conduits, all the conduits are destroyed, and the pumps there, in the
midst of that healthy and largely growing suburb, during the hot
days of July, 1825, were not equal to supply a tenth of the demand
for water; they were mostly dry and chained up during the half of
each day without notice, and persons who came perhaps a mile,
went back with empty vessels. So it was in other neighbourhoods.
Well may we account for ill. Mischievous liquors sold, in large
quantities, at some places, for soda water and ginger beer were
drank to the great comfort of the unprincipled manufacturers, the
great discomfort of the consumers’ bowels, and the great gain of the
apothecary.
Were the doings in the New River during summer, or one half of
the wholesale nuisances permitted in the Thames described, the
inhabitants of London would give up their tea-kettles. Health
requires that these practices should be abated, and, above all, a
good supply of spring-water. The water from pumps and fountains
would not only adorn our public streets and squares, but cool the
heated atmosphere, by the surplus water being diverted into the
gutters and open channels. Besides, if we are to have dogs, and a
beast-market in the heart of the metropolis, the poor overheated
animals might by such means slake their thirst from pure and
refreshing streams. The condition wherein sheep and cattle are
driven for many miles before they reach the metropolis, is a disgrace
to the appellation assumed by men who see the cruelty, and have
power to remedy it; “a merciful man is merciful to his beast,” and he
is not a really merciful man who is not merciful to his neighbours’
beasts.
May these wants be quickly supplied. Give us spring water in
summer; and no more let
“Maids with bottles cry aloud for pumps.”
London has but one fountain; it is in the Temple: you pass it on
the way from Essex-street, or “the Grecian” to Garden-court. It is in
the space at the bottom of the first flight of stone steps, within the
railings enclosing a small, and sometimes “smooth shaven green,”
the middle whereof it adorns, surrounded, not too thickly, by goodly
trees and pleasant shrubs. The jet proceeds from a copper pipe in
the middle of a stone-edged basin, and rises to its full height of at
least nine feet, if water from the cock by the hall with which it
communicates is not drawing; when that process is going on the jet
droops, and seems dying away till the drawing ceases, and then the
“Temple Fountain” goes up again “famously.”
There was a fountain in the great square of Lincolns Inn, but it
had ceased to play “in my time.” I only remember the column itself
standing there
“For ornament, not use,”
with its four boys blowing through shells.
In the Kent-road, on the left hand from the Elephant and Castle
towards the Bricklayers Arms, there is a fountain in a piece of water
opposite a recently built terrace. A kneeling figure, the size of life,
blows water through a shell; it is well conceived, and would be a
good ornament were it kept clean and relieved by trees.
A “professional” gentleman who to the “delightful task” of
improving country residences by laying out grounds in beautiful
forms, has added the less “cheerful labour” of embodying others’
theories and practice in an “Encyclopædia of Gardening,” views a
fountain as an essential decoration where the “ancient” style of
landscape is introduced in any degree of perfection.[231] As the first
requisite, he directs attention to the obtaining a sufficiently elevated
source or reservoir of supply for the jets, or projected spouts, or
threads of water. Some are contrived to throw the water in the form
of sheaves, fans, and showers, or to support balls; others to throw it
horizontally or in curved lines, but the most usual form is a simple
opening to throw the jet or spout upright. Mr. L. judiciously rejects a
jet from a naked tube falling from the middle of a basin or canal on a
smooth surface as unnatural, without being artificially grand.
Grandeur was the aim of the “ancient” gardener, and hence he made
a garden “after nature,” look as a garden of nature never did look.
Mr. L. suggests that “the grandest jet of any is a perpendicular
column, issuing from a rocky base on which the water falling
produces a double effect both of sound and visual display.”
In the “Century of Inventions of the Marquis of Worcester,”
explained and illustrated by Mr. Partington, there is mention by the
marquis of “an artificial fountain, to be turned like an hour glass by a
child, in the twinkling of an eye, it yet holding great quantities of
water, and of force sufficient to make snow, ice, and thunder, with
the chirping and singing of birds, and showing of several shapes and
effects usual to fountains of pleasure.” Mr. Partington observes on
this, that “how a fountain of water can produce snow, ice, thunder,
and the singing of birds, is not easy to comprehend.”
Sir Henry Wotton discoursing on architecture remarks thus:
—“Fountains are figured, or only plain watered works; of either of
which I will describe a matchless pattern. The first, done by the
famous hand of Michael Angelo da Buonaroti, is the figure of a
sturdy woman, washing and winding linen clothes; in which act she
wrings out the water that made the fountain; which was a graceful
and natural conceit in the artificer, implying this rule, that all designs
of this kind should be proper.[232] The other doth merit some larger
expression: there went a long, straight, mossie walk of competent
breadth, green and soft under foot, listed on both sides with an
aqueduct of white stone, breast-high, which had a hollow channel on
the top, where ran a pretty trickling stream; on the edge whereof
were couched very thick, all along, certain small pipes of lead, in
little holes; so neatly, that they could not be well perceived, till by
the turning of a cock, they did sprout over interchangeably, from side
to side, above man’s height, in forms of arches, without any
intersection or meeting aloft, because the pipes were not exactly
opposite; so as the beholder, besides that which was fluent in the
aqueduct on both hands in his view, did walk as it were under a
continual bower and hemisphere of water, without any drop falling
on him; an invention for refreshment, surely far excelling all the
Alexandrian delicacies, and pnuematicks of Hero.”[233] An invention
of greater solace could not have been desired in the canicular days,
by those who sought shelter from the heat; nor more coveted by any
than by him, who is constrained to supply the “every-day” demand
of “warm” friends for this little work—no “cool” task!

FLORAL DIRECTORY.

Red Chironia. Chironia Centaureum.


Dedicated to St. Martha.

[231] Mr. Loudon’s “Encyclopædia of Gardening,” a book of practical and


curious facts, with hundreds of interesting engravings, is a most useful
volume to any one who has a garden, or wishes to form one.
[232] Any one possessing a figure of this fountain designed by Michael
Angelo, and probably seen by Wotton during his travels in Italy, will much
oblige the editor by lending it to him for the purpose of being copied and
inserted in the Every-Day Book.
[233] Reliq. Wotton.

July 30.
Sts. Abden and Sennen, A. D. 250. St. Julitta, A. D.
303.

Witchcraft.

On Tuesday, the 30th of July, 1751, Thomas Colley, William


Humbles, and Charles Young, otherwise Lee, otherwise Red Beard,
were tried at Hertford for the murder of Ruth Osborne, by drowning
her in a pond at Marlston-green, in the parish of Tring. The trial is
exceedingly curious. It appeared that William Dell, the town crier of
Hamel-Hempstead, on the 18th of April preceding, was desired by
one Nichols, who gave him a piece of paper and fourpence, to cry
the words at the market-place that were wrote thereon, which he
accordingly did. The paper was as follows:—“This is to give notice,
that on Monday next, a man and woman are to be publicly ducked at
Tring, in this county, for their wicked crimes.”
Matthew Barton, the overseer of Tring, on hearing that this had
been cried at Winslow, Leighton-Buzzard, and Hamel-Hempstead, in
order to prevent the outrage, and believing them to be very honest
people, sent them into the workhouse. On the Monday, a large mob
of 5,000 people and more, assembled at Tring; but Jonathan
Tomkins, master of the workhouse, in the middle of the night, had
removed them into the vestry-room adjoining the church. The mob
rushed in and ransacked the workhouse, and all the closets, boxes,
and trunks; they pulled down a wall, and also pulled out the
windows and window-frames. Some of the mob perceiving straw
near at hand said, let us get the straw, and set fire to the house, and
burn it down. Some cried out and swore, that they would not only
burn the workhouse down, but the whole town of Tring to ashes.
Tomkins being apprehensive that they would do so told them where
the two unhappy people were, they immediately went to the vestry-
room, broke it open, and took the two people away in great triumph.
John Holmes deposed, that the man and woman were separately
tied up in a cloth or sheet; that a rope was tied under the arm-pits of
the deceased, and two men dragged her into the pond; that the men
were one on one side of the pond, and the other on the other; and
they dragged her sheer through the pond several times; and that
Colley, having a stick in his hand, went into the pond, and turned the
deceased up and down several times.
John Humphries deposed, that Colley turned her over and over
several times with the stick; that after the mob had ducked her
several times, they brought her to the shore, and set her by the
pond side, and then dragged the old man in and ducked him; that
after they had brought him to shore, and set him by the pond side,
they dragged the deceased in a second time; and that Colley went
again into the pond, and turned and pushed the deceased about
with his stick as before; that then she being brought to shore again,
the man was also a second time dragged in, and underwent the
same discipline as he had before; and being brought to shore, the
deceased was a third time dragged into the pond; that Colley went
into the pond again, and took hold of the cloth or sheet in which she
was wrapt, and pulled her up and down the pond till the same came
from off her, and then she appeared naked; that then Colley pushed
her on the breast with his stick, which she endeavoured with her left
hand to catch hold of, but he pulled it away, and that was the last
time life was in her. He also deposed, that after Colley came out of
the pond, he went round among the people who were the spectators
of this tragedy, and collected money of them as a reward for the
great pains he had taken in showing them sport in ducking the old
witch, as he then called the deceased.
The jury found the prisoner Colley—guilty.

The reporter of the trial states, from the mouth of John Osborne,
the following particulars not deposed to in court, namely: that as
soon as the mob entered the vestry-room, they seized him and his
wife, and Red Beard carried her across his shoulders, like a calf,
upwards of two miles, to a place called Gubblecut; where not finding
a pond they thought convenient, they then carried them to Marlston-
green, and put them into separate rooms in a house there; that they
there stripped him naked, and crossed his legs and arms, and bent
his body so, that his right thumb came down to his right great toe,
and his left thumb to his left great toe, and then tied each thumb
and great toe together; that after they had so done, they got a cloth,
or an old sheet, and wrapped round him, and then carried him to the
Mere on the green, where he underwent the discipline as has been
related in the course of the trial. What they did with his wife he
could not say, but he supposed they had stripped her, and tied her in
the same manner as himself, as she appeared naked in the pond
when the sheet was drawn from off her, and her thumbs and toes
tied as his were. After the mob found the woman was dead, they
carried him to a house, and put him into a bed, and laid his dead
wife by his side; all which he said he was insensible of, having been
so ill-used in the pond, as not to have any sense of the world for
some time; but that he was well assured it was so, a number of
people since informing him of it who were present. His wife, if she
had lived till Michaelmas, would have been seventy years of age; he
himself was but fifty-six.
The infatuation of the people in those parts of Hertfordshire was
so great, in thinking that these people were a witch and a vizard,
that when any cattle died, it was always said that Osborne and his
deceased wife had bewitched them. And even after the trial, a great
number of people in that part of the country thought the man a
vizard, and that he could cast up pins as fast as he pleased. Though
a stout able man of his age, and ready and willing to work, yet none
of the farmers thereabouts would employ him, ridiculously believing
him to be a vizard, so that the parish of Tring were obliged to
support him in their workhouse after his wife’s death.
So far is reported by the editor of the trial.

On the 24th of August, 1751, Colley was hung at Gubblecut-


cross, and afterwards in chains. Multitudes would not be spectators
of his death; yet “many thousands stood at a distance to see him
die, muttering that it was a hard case to hang a man for destroying
an old wicked woman that had done so much mischief by her
withcraft.” Yet Colley himself had signed a public declaration the day
before, wherein he affirmed his conviction as a dying man, that there
was no such a thing as a witch, and prayed that the “good people”
might refrain from thinking that they had any right to persecute a
fellow-creature, as he had done, through a vain imagination, and
under the influence of liquor: he acknowledged his cruelty, and the
justice of his sentence.[234]
The pond wherein this poor creature lost her life was in mud and
water together not quite two feet and a half in depth, and yet her
not sinking was deemed “confirmation strong as proof of holy writ”
that she was a witch. Ignorance is mental blindness.

FLORAL DIRECTORY.

White Mullen. Verbuscum Lychnitis.


Dedicated to St. Julitta.

[234] Gent. Mag. xxi. 378.

July 31.
St. Ignatius, of Loyola, A. D. 1556. St. John Columbini, A.
D. 1367. St. Helen, of Sweden, A. D. 1160.

St. Ignatius Loyola—Founder of the Jesuits.


St. Ignatius Loyola—Founder of the
Jesuits.
Ignatius was born in 1495, in the castle of Loyola in Guipuscoa, a
part of Biscay adjoining the Pyrenees. In his childhood he was
pregnant of wit, discreet above his years, affable and obliging, with a
choleric disposition, and an ardent passion for glory. Bred in the
court of Ferdinand V., under the duke of Najara, his kinsman and
patron, as page to the king, he was introduced into the army,
wherein he signalized himself by dexterous talent, personal courage,
addiction to licentious vices and pleasures, and a taste for poetry; he
at that time composed a poem in praise of St. Peter. In 1521, he
served in the garrison of Pampeluna, against the French who
besieged it: in resisting an attack, he mounted the breach sword-in-
hand; a piece of stone struck off by a cannon ball from the ramparts
bruised his left leg, while the ball in its rebound broke his right.[235]
Dr. Southey in a note to his recently published “Tale of Paraguay,”
cites the Jesuit Ribadeneira’s account of this accident to Ignatius
from his life of him in the “Actæ Sanctorum,” where it is somewhat
more at length than in the English edition of Ribadeneira’s “Lives of
the Saints,” which states that St. Peter appeared to Ignatius on the
eve of his feast, with a sweet and gracious aspect, and said that he
was come to cure him. “With this visitation of the holy apostle,” says
Ribadeneira, “Ignatius grew much better, and not long after
recovered his perfect health: but, as he was a spruce young gallant,
desirous to appear in the most neat and comely fashion, he caused
the end of a bone which stuck out under his knee, and did
somewhat disfigure his leg, to be cut off, that so his boot might sit
more handsomely, as he himself told me, thinking it to be against his
honour that such a deformity should be in his leg: nor would he be
bound while the bone was sawed off.” Father Bouhours, also a Jesuit,
and another biographer of Ignatius, says, that one of his thighs
having shrunk from the wound, lest lameness should appear in his
gait, he put himself for many days together upon a kind of rack, and
with an engine of iron violently stretched and drew out his leg, yet
he could never extend it, and ever after his right leg remained
shorter than his left.
————When long care
Restored his shattered leg and set him free,
He would not brook a slight deformity,
As one who being gay and debonair,
In courts conspicuous, as in camps must be:
So he forsooth a shapely boot must wear;
And the vain man, with peril of his life,
Laid the recovered limb again beneath the knife.
Long time upon the bed of pain he lay
Whiling with books the weary hours away.
And from that circumstance, and this vain man,

You might also like