100% found this document useful (2 votes)
83 views45 pages

Buy Ebook Clearly Visual Basic: Programming With Microsoft Visual Basic 2010, Second Edition Diane Zak - Ebook PDF Cheap Price

The document provides links to various eBooks related to Microsoft Visual Basic and C#, including titles by Diane Zak and Tony Gaddis. It emphasizes the availability of instant digital products in multiple formats such as PDF, ePub, and MOBI on ebookluna.com. Additionally, it includes information about copyright and the publisher's rights regarding the content of the eBooks.

Uploaded by

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

Buy Ebook Clearly Visual Basic: Programming With Microsoft Visual Basic 2010, Second Edition Diane Zak - Ebook PDF Cheap Price

The document provides links to various eBooks related to Microsoft Visual Basic and C#, including titles by Diane Zak and Tony Gaddis. It emphasizes the availability of instant digital products in multiple formats such as PDF, ePub, and MOBI on ebookluna.com. Additionally, it includes information about copyright and the publisher's rights regarding the content of the eBooks.

Uploaded by

haraesbutcon
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/ 45

Get the full ebook with Bonus Features for a Better Reading Experience on ebookluna.

com

Clearly Visual Basic: Programming with Microsoft


Visual Basic 2010, Second Edition Diane Zak -
eBook PDF

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

OR CLICK HERE

DOWLOAD NOW

Download more ebook instantly today at 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
Other documents randomly have
different content
Fig. 119.—Sterile gauze held in
place over nipples by means of
adhesive strips and tapes. (From
photograph taken at Bellevue
Hospital.)

The Care of the Breasts. There is a wide difference of opinion


about the proper care of the breasts, also, but here again, although
the details vary, the ultimate objects of the care are always the same,
namely: to facilitate the baby’s nursing, promote the mother’s
comfort and prevent breast abscesses. These ends are usually
accomplished by keeping the nipples clean and intact and by giving
support and rest to heavy, painful breasts.
The patient who has cared for her nipples during the latter part of
pregnancy will usually have little or no trouble with them during the
period of lactation, if the care is continued. But this attention is
imperative.
It is very generally customary to have the nipples bathed before
and after each nursing with a saturated solution of boracic acid, in
either water or alcohol, using sterile pledgets and forceps, and to
keep them clean between nursings by applying sterile gauze. This
gauze may be held in place by means of a breast binder or by tapes
tied through the ends of narrow strips of adhesive plaster, four being
applied to each breast. (Fig. 119.) Strips of adhesive plaster about five
inches long are folded over at one end, two adhesive surfaces being
in contact for about an inch. Through a hole in the folded end a
narrow tape or bobbin is tied and the strips applied to the breast,
beginning at the margin of the areola and extending outward. The
free ends of the tapes are tied over squares of sterile gauze, between
nursings, and untied to expose the nipple at nursing time.
Lead shields are sometimes used to protect the healthy nipple and
not infrequently are applied to cracked nipples, being held in place
by means of a breast binder. The secretion of milk which escapes into
the shield is acted upon by the metal and the result is a lead wash
which continuously bathes the nipple. The shields should be
scrubbed with sapolio and boiled once daily.
Another method, and one widely employed, is to anoint the nipple
after nursing with sterile albolene or a paste of sterile bismuth and
castor oil, and apply squares of sterile paraffin paper. These bits of
paper are pressed into place and held for a moment by the nurse’s
hand, the warmth of which softens and moulds them to the breast
after which they remain in place. In some instances the bismuth and
castor oil paste is wiped off, with a sterile pledget, before nursing and
in others it is not.
In some hospitals, neither gauze nor paper is used, the nipples
being protected by putting sterile night-gowns on the patients.
The purpose of all of these methods is to keep the nipples clean,
and here again the patient must be cautioned against infecting
herself. No amount of care on the nurse’s part will protect the patient
if she touches her nipples with her fingers.
The nurse will appreciate the reason for all of this painstaking care
if she calls to mind the fact that the breast tissues are highly vascular
and excessively active at this time and therefore very susceptible to
infection, and also that the baby’s suckling is often very vigorous and
accompanied by a good deal of chewing and gnawing of the nipples.
Unless the nipples have been toughened, and sometimes even when
they have, the skin becomes abraded or cracked as a result of the
baby’s suckling, thus creating a portal of entry for infecting
organisms, in addition to the milk ducts which lead back into the
breast tissues. Unless the nipples are kept clean, constantly, they
may become infected by organisms from the baby’s mouth or on the
patient’s hands, bedding or gown with a breast abscess as a result.
The important thing, then, is to keep the nipples clean and not allow
anything unsterile, excepting the baby’s mouth, to come in contact
with them at any time.
Fig. 120.—Protecting cracked nipples by having
the baby nurse through a shield. (From
photograph taken at Johns Hopkins Hospital.)

It is sometimes the practice to swab the baby’s mouth with boric


soaked cotton or gauze before each nursing, but many doctors hold
that this is injurious to the delicate mucous lining of the baby’s
mouth. The opinions for and against this routine seem to be about
equally prevalent.
If the nipples become painful or cracked, one
can easily understand that continued suckling
would only aggravate the condition and increase
the danger of infection. But the baby must nurse,
if possible, and so in the majority of cases a
nipple shield is used (Figs. 120–121) as a
protection, and after nursing the fissures or
abraded areas are painted with bismuth and
castor oil paste; compound tincture of benzoin;
balsam of Peru; argyrol, silver nitrate or
sometimes only alcohol. The application is made
Fig. 121.—Nipple with sterile swabs prepared by twisting a wisp of
shield used in cotton about the end of a toothpick. If the crack
Fig. 120. or abrasion is extensive enough to cause
bleeding, even nursing through a shield is
sometimes, but not necessarily discontinued, while the other
treatment is the same as for a nipple that does not bleed.
Sound, uninjured nipples, then, are to be kept clean and protected
from infection and those which are abraded or cracked are to be kept
clean and also protected against further injury.
Lactation. About the third or fourth day after delivery, when milk
replaces colostrum, the breasts become swollen, engorged and often
very painful, and not infrequently, a hard, sensitive lump or “cake”
may be felt. The growing tendency, now, is merely to support these
heavy breasts by means of a binder which has straps passing over the
shoulders, in order to hold them up without making pressure (Fig.
122) and to apply ice caps or hot compresses to the painful areas. It
used to be customary to massage and pump caked breasts, to apply
pressure and various kinds of lotions or ointments. Though one, or
all of these measures are still employed, in some cases, the general
practice is to avoid manipulating the breasts but to empty them
regularly by the baby’s nursing; support them and allow Nature to
make an adjustment between the amount secreted and the amount
withdrawn.

Fig. 122.—A simple method of


supporting heavy breasts by
means of three folded towels;
one fastened about the waist,
one over each shoulder, crossing
front and back.

Free purging is sometimes employed and the amount of fluids


reduced until the engorgement and discomfort subside. This happy
issue is practically always reached if the baby nurses regularly and
satisfactorily, as there is a spontaneous adjustment between the
amount secreted by the mother and that withdrawn by the baby. But
as abscesses may follow in the wake of caked breasts, particularly if
the nipples are sore, it is of great importance that the nurse watch
closely for the first evidence of painful lumps. The prompt
application of a supporting bandage and ice bags (Fig. 123) or hot
compresses will, in the majority of cases, give speedy and complete
relief. So widely is this believed that many doctors regard the care of
the breasts, including the prevention of breast abscesses, as a
nursing question, entirely, and conversely are likely to regard the
occurrence of a breast abscess as an evidence of careless nursing.

Fig. 123.—Ice caps held in place


on painful breasts by straight
binder with darts pinned in
under breasts and supported by
shoulder straps of muslin
bandage.
Certain it is that breast abscesses are almost never seen where the
nurses have this sense of responsibility, and habitually watch the
breasts closely and promptly use support and either heat or cold
when the breasts become heavy and sensitive.
There are innumerable bandages and methods for supporting
heavy breasts, any one of which is efficacious so long as it meets the
two chief requirements: to lift the breasts, suspending their weight
from the shoulders, and, while fitting snugly below to avoid making
pressure at any point, particularly over the nipples. One of the most
satisfactory and widely used supports is the Y-bandage, (Figs. 124,
125, 126), another, the Indian binder (Fig. 127.)

Fig. 124.—Modified Richardson “Y” binder made


of two strips of soft muslin, full width of material
and 44 inches long, folded into strips of same
width as distance from margin of patient’s breast
to outer part of areola. One strip is folded in the
middle at right angles and pinned to one end of
the other strip as indicated. (Figs. 124, 125, 126,
with captions, are from The Maternity Hospital,
Cleveland, by courtesy of Miss Calvin
MacDonald.)

The nurse must on no account massage or pump engorged breasts


on her own responsibility, for there is a good deal of evidence to
show that any such manipulation tends to increase the amount of the
secretion and this in turn increases the engorgement and pain. It is
possible, too, that massage may bruise the breasts and thus make
them more susceptible to infection.
Mastitis. When infection occurs, the swollen, painful breasts may
grow hot and red, the patient may complain of chilliness and have a
slight fever, with or without there being an abscess. Even then the
general treatment is most frequently found to consist of support; ice
or heat; catharsis and restricted fluids, though in some cases the
breasts are pumped and nursing is discontinued.

Fig. 125.—Bandage in Fig. 124


applied. The long arm of binder
is placed under patient’s
shoulders, one end of the Y being
brought around the top of the
breasts and the other around the
lower part, toward the nurse,
crossed at right angles under the
arm and pinned to long arm of
bandage as indicated in Fig. 126.
The nipples are covered with
sterile gauze and the upper and
lower parts of the Y fastened
with a safety pin between the
breasts. The remaining length of
the long arm is brought across
the breasts and fastened with a
safety-pin to the opposite side.
When the baby nurses this pin is
removed as well as the one
between the breasts. The entire
binder should be snug and held
in place by means of shoulder
straps, pinned front and back.

When the inflammation so far progresses as to require that the


breast be opened and drained, the subsequent nursing care will be
outlined by the doctor to meet the needs of each case. It is a painful
operation and often a serious one, for the destruction of breast tissue
may be extensive enough to render the breasts valueless as milk-
producing organs. The healing is slow and altogether the occurrence
is a most lamentable one.

Fig. 126.—Y bandage in Fig. 125 seen from the


opposite side.

The nurse’s part in preventing this complication is cleanliness and


gentleness in her attentions; unremitting watchfulness; immediate
application of a suspensory bandage and either heat or cold, upon
the first sign of engorgement and prompt reporting to the doctor.
Fig. 127.—Indian Binder used at The Montreal
Maternity Hospital for supporting heavy breasts.
The tapering ends tie in a knot in front.

If the patient’s nipples have not been toughened during pregnancy


or if flat or retracted nipples have not been satisfactorily brought out,
it may be necessary for the nurse to employ the treatment to these
ends which were described in the chapter on pre-natal care. In the
meantime the baby may have to nurse through a shield until the
nipple is brought out prominently enough for him to grasp it well.
Stripping. Sometimes in cases of depressed nipples, which the
baby cannot grasp, or when the baby is too feeble, to nurse at the
breast, milk is withdrawn from the breast by means of so-called
“stripping.” The nurse should scrub her hands thoroughly with hot
water and soap and dry them on a sterile towel before beginning. The
breast is grasped by placing the thumb and forefinger of the right
hand on the areola on opposite sides of the nipple but well below it.
The nipple is then raised from the breast by a quick, lifting and
rolling motion of the thumb and finger, accompanied by slight
pressure. A sterile medicine glass should be held in position to
receive the milk which spurts from the nipple, but the glass should
not touch the breast. (Fig. 128.)

Fig. 128.—Position of thumb and finger below


nipple on areola, in stripping breasts. (From
photograph taken at The Long Island College
Hospital.)
There is a knack about stripping and it requires practice, but those
doctors who advocate it feel that it empties the breast, when this is
necessary, with less disturbance than that caused by pumping, and as
the milk is projected directly from the nipple into the sterile glass,
without any of it running over the nipple or breast as may happen in
pumping, it has the additional advantage of always being sterile.
Extreme gentleness must be used; the openings of the milk ducts
must not be touched by the fingers, and the thumb and finger must
not press deeply enough to reach the glandular tissue itself. If done
properly stripping neither stimulates nor bruises the breast tissue
nor does it cause the patient even temporary discomfort.
Abdominal Binders and Bed Exercises. There is
considerable difference of opinion about the advantage of using
abdominal binders upon the puerperal patient while she is in bed,
and the nurse will accordingly care for the patients of some doctors
who use them and for those of others who do not.
The application of a moderately snug binder for the first day or
two is a fairly common practice, for multiparæ, particularly, are often
made very uncomfortable by the sudden release of tension on their
flabby abdominal walls; a discomfort which a binder will relieve. And
during the first few days after the patient gets up and walks about,
she is sometimes given great comfort by a binder that is put on as she
lies on her back, and is adjusted snugly about her hips and the lower
part of her abdomen.
But the continued use of a binder after the first day or two, while
the patient is still in bed, is not as general as it formerly was. Many
women ask for binders in the belief that they help to “get the figure
back” to its original outline, and some doctors feel that the use of the
binder is helpful in restoring the tone to the abdominal muscles,
which amounts to about the same thing. Both the straight swathe
and the Scultetus binder are used for this purpose and they are put
on in the usual manner; snugly and with even pressure, but not tight
enough to bind.
Those doctors who disapprove of the binder believe that it
interferes with involution and, by making pressure, tends to push the
uterus back and cause a retro-position, in addition to retarding
instead of promoting a return of normal tone to the abdominal
muscles.
Accordingly, they instruct their patients to take exercises, instead
of wearing binders, and they have these exercises started while the
patient is still in bed. Their adoption, and the rate at which they are
increased, are entirely dependent upon the individual patient’s
condition, for they must never be continued to the point of fatigue.
There are, therefore, no definite rules laid down, concerning these
exercises, beyond a description of the positions and movements
themselves, and their sequence.
Those which are taught to the patients at the Long Island College
Hospital are so simple, and evidently productive of such happy
results that they offer excellent examples of this form of treatment.
They are, of course, taken only by the doctor’s order, but the nurse’s
intelligent supervision increases their effectiveness.

Fig. 129.

Figs. 129 to 135, inclusive, are bed exercises taken


during the puerperium.
For description see text. (From photographs
taken at The Long
Island College Hospital.)

The general purpose of these exercises is to strengthen the


abdominal muscles, thus helping to prevent a large, pendulous
abdomen; to increase the patient’s general strength and tone, just as
exercise benefits the average person; to promote involution; to
prevent retro-version and in a measure, increase intestinal tone and
thus relieve constipation. To accomplish these much to be desired
ends the exercises must be taken with moderation and judgment;
started slowly; increased very gradually and constantly adapted to
the strength of the individual patient. Otherwise they may do more
harm than good. In the average, uncomplicated case in which the
patient is doing well, she usually starts the chin-to-chest exercise
from twelve to twenty-four hours after delivery. She should lie flat on
her back and raise her head until her chin rests upon her chest. (Fig.
129.) If she rests her hand upon her abdomen, she will feel for herself
that the abdominal muscles contract, and accordingly will be
disposed to continue the exercises with more interest and confidence
than she otherwise might. The movement is repeated twenty-five
times, morning and evening, every day, and continued as long as the
patient is in bed.

Fig. 130.
Fig. 131.

The familiar, deep-breathing exercise is ordinarily started on the


third or fourth day. The patient should lie flat, with her arms at her
sides, then extend them straight out from the shoulders (Fig. 130),
raise them above her head (Fig. 131) and return them to the original
position. This is repeated ten times morning and evening, daily, as
long as the patient is in bed.

Fig. 132.

The one-leg-flexion exercises are not done by patients with


perineal stitches, but in other cases they are usually started about the
fifth day. The thigh is flexed sharply on the abdomen and leg on
thigh (Fig. 132), then extended and lowered to the bed. This is
repeated ten times, with each leg, morning and evening for one, or
possibly two days.
The next exercise replaces the one-leg-flexion and is started after
the latter has been done for one or two days, according to the
strength of the patient, and it in turn is continued for only one or two
days. Both thighs are sharply flexed on abdomen and legs on thighs
(Fig. 133), then extended and lowered but not far enough for the
heels to rest upon the bed before being flexed again. This is repeated
ten times morning and evening.

Fig. 133.

Fig. 134.

Next is the exercise for which the leg-flexion exercises prepare the
patient, and which are discontinued when this one is adopted. It is
started, as a rule, about the seventh day, or three or four days before
the patient gets up. Both legs are slowly lifted to a position at right
angles to the body (Fig. 134) and slowly lowered, but not far enough
for the heels to touch the bed (Fig. 135), and the movement repeated.
As this exercise requires a good deal of effort, it must be taken up
very gradually, as follows: The legs should be raised on the first day,
once in the morning and twice in the evening; second day, three
times in the morning and four times in the evening; third day, five
times in the morning and six times in the evening and so on, if the
patient is not fatigued, until the exercise is repeated ten times each
morning and evening. It is continued for several months.

Fig. 135.

The knee chest position (Fig. 136) is intended to counteract the


tendency toward retroversion, from which so many women suffer
after childbirth. It is usually started about the seventh day and the
patient begins by remaining in that position for a moment or two,
gradually lengthening the time to about five minutes each morning
and evening for about two months.
Fig. 136.—Knee chest position.

Fig. 137.—Walking on all fours. (From a


photograph taken at the Long Island College
Hospital.)

Walking on all fours is violent exercise and has to be taken up very


gradually. Some patients are able to attempt it on the first day out of
bed, if they have been taking the other exercises, but as a rule it is not
started until the second or third day. The patient’s clothes should be
free from all constrictions; the knees should be held stiff and straight
with the feet widely separated, to allow a rush of air into the vagina,
and the entire palmar surface of the hands should rest flat on the
floor. (Fig. 137.) The patient should start by taking only a few steps
each morning and evening, gradually lengthening the walk to five
minutes twice daily and continuing it for about two months.
It is believed that as the patient walks in this position the uterus
and rectum rub against each other producing something the same
result as would be obtained by massage. The effect of the exercise is
to promote involution and diminish the tendency toward
constipation and retroversion, apparently preventing malposition
entirely in a large percentage of cases. Though not widely used, its
beneficial effects are unquestioned by those doctors who employ it.
In taking a general survey of the young mother and her needs, we
realize that in a broad sense she is not ill, in so far as no pathological
condition exists. But she is in a transitional state and may become
acutely or chronically ill if not carefully watched and nursed. In
general her mental, physical and nervous forces must be conserved
and increased, and this requires thoughtful and devoted attention
from the nurse. She must be scrupulously clean in her care of the
nipples and perineum, and in order to be able promptly to inform the
doctor of any departure from the normal in the patient’s condition,
the nurse’s watchfulness should embrace regular observations upon
the following:

1. The patient’s general condition; the amount and character of


her sleep; her appetite; her nervous and mental condition.
2. The temperature, pulse and respiration.
3. The height and consistency of the fundus.
4. The quantity, color and odor of the lochia.
5. The persistence and severity of the after-pains.
6. The condition of the perineum.
7. The condition of the nipples and breasts.
8. The functions of the bladder and bowels.
If all goes well and there are no complications, the patient will
usually be able to assume full charge of her baby by the sixth or
eighth week, and practically return to her customary mode of living,
with the difference that she now has the care of a baby which she did
not have before. The care of that baby requires certain, definite care
of herself, as a nursing mother, which will be described in detail in
the next chapter.
To sum up the general principles of nursing the young mother
during the puerperium, we find that just as during pregnancy and
labor, the nurse must first be familiar with the normal changes that
occur in order that she may recognize the abnormal. Then, as before,
the nurse’s care of the individual patient must rest unfailingly upon a
foundation of cleanliness in order to prevent infection; watchfulness,
which implies ability to recognize normal changes and unfavorable
symptoms; adjustment to the methods of the attending physician
and to all of the circumstances surrounding the patient, and the
wisest and tenderest consideration for her patient as an individual.
CHAPTER XVI
THE NURSING MOTHER

Not infrequently the nurse remains with her patient after the end
of the puerperium, and therefore she may have the care of the
mother and baby for several weeks, or even months. The most
valuable single service which she can perform in this capacity is to
help in making it possible for the mother to nurse her baby at the
breast. For both the nurse and the mother must realize that the
breast-fed baby is much more likely to live through the difficult first
year, and is markedly less susceptible to disease and infection than is
the bottle-fed baby.
The first step is to convince the young mother of what it means to
her baby and her obligation to try to nurse him, since, excepting
under very rare and unusual conditions, she can nurse him if she
wants to enough to make the necessary effort and sacrifice.
The important contra-indications for attempting breast-feeding
are retracted nipples, tuberculosis, eclampsia, severe heart or kidney
disease and certain acute infectious diseases such as typhoid fever.
It seldom happens that the mother who has had average prenatal
care, followed by good care during and after delivery, is unable to
nurse her baby if she orders her life in the way that is known to be
necessary to promote and maintain lactation. The first essential is
her real desire to nurse her baby; next, her appreciation of the
continuous care of herself that is necessary and third, her whole-
hearted willingness to take this care for her baby’s sake.
It is safe to say that if the doctor and the nurse and the patient all
want the baby to nurse at the breast, and all do everything in their
power to make this possible, they will almost invariably succeed. This
assertion can scarcely be made too positively, and the nurse should
never lose sight of the fact that if the baby is not breast-fed he is
being defrauded, and in the vast majority of cases, because of
insufficient effort on the part of the doctor, nurse or patient, or all
three.
A favorable frame of mind and state of good nutrition in the
mother are the two indispensable factors in establishing breast-
feeding and in maintaining the secretion of an adequate supply of
breast-milk. These conditions, in turn, are both affected by her
general mode of living, as long as the baby nurses.
Women with happy, cheerful dispositions usually nurse their
babies satisfactorily, while those who worry and fret are likely to
have an insufficient supply of milk, or milk of a poor quality. And in
addition to this sustained influence, the temporary effect of a fit of
temper; of fright; grief; anxiety or any marked emotional disturbance
is frequently injurious to the quality of milk that previously has been
satisfactory. Actual poisons are created by such emotions and may
affect the baby so unfavorably as to make it advisable to give him
artificial food, for the time being, and empty the breasts by stripping
or pumping, before he resumes breast feeding.
A mother’s lack of faith in her ability to nurse is so detrimental in
its effect that she must be assured over and over, that she can nurse
her baby if she will persevere. If the nursing does not go well at first
she must not give up, but must continue to put the baby to the
breasts regularly, as this is the best means of stimulating them to
activity. His feeding should be supplemented with modified cow’s
milk, if the breast milk is inadequate, either in amount or quality.
Method of Nursing. The baby should be put to the breast for the
first time between eight and twelve hours after he is born. This gives
the tired mother an opportunity to rest and sleep, and the baby, too,
is benefited by being kept warm and quiet during this interval. His
need for food is not great as yet, nor is there much if any
nourishment available for him.
In preparing to nurse her baby, the mother should turn slightly to
one side, and hold the baby in the curve of her arm so that he may
easily grasp the nipple on that side. She should hold her breast from
the baby’s face with her free hand by placing the thumb above and
fingers below the nipple, thus leaving his nose uncovered, to permit
his breathing freely. (Fig. 138.) The mother and baby should lie in
such positions that both will be comfortable and relaxed, and the
baby will be able to take into his mouth, not only the nipple but the
areola as well, so as to compress the base of the nipple with his jaws
as he extracts the milk by suction.

Fig. 138.—Position of mother


and baby for nursing in bed.

The nurse may have to resort to a number of expedients in


persuading the baby to begin to nurse, for he does not always take
the breast eagerly at first. He must be kept awake and sometimes
suckling will be encouraged by patting or stroking his cheek. Or if his
head is drawn away from the breast, a little, he will sometimes take a
firmer hold and begin to nurse. Moistening the nipple by expressing
a few drops of colostrum or with sweetened water may stimulate the
baby’s appetite and thus prompt him to nurse.
The young mother must be prepared to find very discouraging the
early attempts to induce the baby to nurse, but if the nurse will help
her to persevere in making regular attempts she will almost certainly
succeed.
During the first two or three days the baby obtains only colostrum,
while nursing, but the regular suckling is extremely important, not
alone for the sake of getting him into the habit of nursing but for the
sake of stimulating the breasts to secrete milk.
Moreover, the irritation of the nipples so definitely promotes
involution of the uterus that this process goes on more rapidly in
women who nurse their babies than in those who do not. If the
nipples are not sufficiently prominent for the baby to grasp them, a
shield will have to be used while they are being brought out. But the
shield should be discarded as soon as possible for it is the baby’s
suckling that produces the physiological effects. If a shield is used, it
should be washed and boiled after each use and kept, between
nursings, in a sterile jar or a solution of boracic acid.
The length of the nursing periods and the intervals between them
have to be adjusted to the needs and condition of each baby; his
weight, vigor, the rapidity with which he nurses, the character of his
stools and his general condition, all of which will be considered in
connection with the care of the baby. The intervals between nursings
are measured from the beginning of one feeding to the beginning of
the next, and are fairly uniform for babies of the same age and
weight. The length of the nursing period itself is usually from ten to
twenty minutes.

Fig. 139.—The Nursing Mother.


(By permission from a pastel by
Gari Melchers.)

The average baby nurses about every six hours during the first two
days, or four times in twenty-four hours. According to one schedule
he will nurse every three hours during the day for about three
months, beginning with the third day, and at 10 p.m. and 2 a.m., or
seven times in twenty four hours. From the third to the sixth month
he nurses every three hours during the day and at ten o’clock at
night, or six times in twenty-four hours, and from that time until he
is weaned he should nurse at four hour intervals during the day and
at ten o’clock at night, or five times daily, as follows:
Day Night

First and second days 6 12 6 12


First three months 6 9 12 3 6 10 2 a. m.
Third to sixth month 6 9 12 3 6 10
After the sixth month 6 10 2 6 10
It is becoming more and more common to omit night feedings
after 10 p.m., even during the first three months, with the average
baby who is in good condition. When this practice is adopted the
baby not only seems to do as well as he normally should, but to
benefit by the long digestive rest during the night. Certainly the
mother profits by the unbroken sleep which this makes possible.
As a rule the baby should nurse from one side, only, at each
nursing, emptying the breasts alternately, but if there is not enough
milk in one breast for a complete feeding both breasts may be used at
one nursing. Neither the mother nor the baby should be permitted to
sleep while he is at the breast, but he should pause every four or five
minutes to keep from feeding too rapidly.
After the mother sits up, she may occupy a low, comfortable chair
while nursing the baby. She should lean slightly forward and raise
the knee upon which the baby rests by placing her foot on a stool,
supporting his head in the curve of her arm, and holding her breast
from his face, just as she did while in bed. (Fig. 139.) She should
nurse him in a quiet room where she will not be disturbed nor
interrupted and where the baby and her breasts will be protected
from drafts or from being chilled. Many women prefer always to lie
down when nursing the baby.
Before the nurse leaves her patient she should teach her how to
care for her nipples, including the preparation of boric solution; the
importance of washing her hands before bathing her nipples, and of
keeping the breasts covered with clean gauze between nursings.
PERSONAL HYGIENE OF THE NURSING MOTHER

The personal hygiene of the nursing mother should be virtually a


continuation of that which is advisable during the latter part of the
puerperium; a normal, tranquil kind of life which is unfailingly
regular in its daily routine.
But this is not quite as easy as it sounds, for during the
puerperium the young mother is still something of a patient and is
regarded as such, while during the months that follow she is simply a
nursing mother, who must live sanely and moderately for her baby’s
sake, and at the same time take her place among people who are not
under compulsion to place any special restrictions upon their daily
lives. It is much easier to take precautions and follow directions for a
few days or weeks, while the situation is novel, than it is to persist
month after month without help or encouragement. The young
mother’s family often fails to appreciate the difficulty of her problem
and for this reason she is sometimes unable to care for herself, as she
should, with the result that she cannot nurse her baby successfully.
As long as the nurse remains with her patient, therefore, she must
try to impress upon both the patient and the members of her
household that the most important single factor in the care of the
new baby is the sustained and regular care which the nursing mother
should take of herself. For it must be remembered constantly that it
is not alone breast feeding, but satisfactory breast feeding that
nourishes and builds and protects the baby. Unsatisfactory breast
milk may be positively injurious, and irregularity and
thoughtlessness in the mother’s mode of living will usually produce
milk of this character.
Therefore, for ten or twelve months after the baby is born, the
mother should discharge her responsibility and obligation to him by
regulating her own life to meet his needs.
Diet. Throughout the entire nursing period the mother’s diet must
be such that it will nourish her and also aid in producing milk which
will meet the baby’s needs. His needs are that the daily demands of
his growing body shall be supplied and that he shall be given those
materials which will build a sound body, with resistance against
disease and infection.
So important is this matter of nutrition, and the principles upon
which it rests, that it is discussed at considerable length in the
succeeding chapter. At this point, however, it may be stated briefly
that the most valuable article in the nursing mother’s dietary is milk,
and that to this should be added eggs and the vegetables which are
designated as “leafy,” and fresh fruits, particularly oranges. These
foods are rich in the materials which are essential to the baby’s
nutrition, good health, and resistance.
She should have a generous, simple, nourishing mixed diet, then,
consisting largely of milk, eggs, and leafy vegetables. She must
steadily guard against indigestion for if her digestion is deranged the
baby is almost sure to suffer. Rich and highly seasoned foods must be
avoided, as well as alcohol, strong tea and coffee or any articles of
food or drink that might upset her.
It becomes apparent that although the expectant mother does not
have to “eat for two,” the nursing mother does, in certain respects.
She should augment the nourishment provided by her three regular
meals, by taking a glass of milk, cocoa or some beverage made of
milk, during the morning, afternoon and before retiring.
The morning and afternoon lunches had better be taken about an
hour and a half after breakfast and luncheon, respectively, in order
not to impair the appetite for the meals which follow.
It is very important that the nursing mother shall take her meals
with clock-like regularity and enjoy them, but at the same time she
must guard against overeating, for fear of deranging her digestion.
She must drink water freely, partly for the sake of promoting
intestinal activity.
Bowels. The nursing mother’s bowels must move freely and
regularly every day, but she should not take cathartics nor even
enemata without a doctor’s order.
She will usually be able to establish the habit of a daily movement
by taking exercise, eating bulky fruit and vegetables, drinking an
abundance of water and regularly attempting to empty her bowels,
every day, preferably immediately after breakfast.
Rest and Exercise. The nursing mother will not thrive, nor will
the baby, unless she has adequate rest and sleep and takes at least a
moderate amount of daily exercise in the open air. She should have

You might also like