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

Programming Logic & Design, Comprehensive 9th edition Joyce Farrell - eBook PDF instant download

The document provides information on the 9th edition of 'Programming Logic and Design' by Joyce Farrell, available as an eBook PDF. It includes links for downloading the book and other related programming resources. The content covers various programming concepts and structures, including chapters on decision making, looping, and object-oriented programming.

Uploaded by

thoddabilval
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
55 views

Programming Logic & Design, Comprehensive 9th edition Joyce Farrell - eBook PDF instant download

The document provides information on the 9th edition of 'Programming Logic and Design' by Joyce Farrell, available as an eBook PDF. It includes links for downloading the book and other related programming resources. The content covers various programming concepts and structures, including chapters on decision making, looping, and object-oriented programming.

Uploaded by

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

Programming Logic & Design, Comprehensive 9th

edition Joyce Farrell - eBook PDF pdf download

https://ebooksecure.com/download/programming-logic-design-
comprehensive-9th-edition-ebook-pdf/

Download more ebook from https://ebooksecure.com


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

Programming Logic and Design, Comprehensive 9th Edition


Joyce Farrell - eBook PDF

https://ebooksecure.com/download/programming-logic-and-design-
comprehensive-9th-edition-ebook-pdf/

Java Programming 9th Edition Joyce Farrell - eBook PDF

https://ebooksecure.com/download/java-programming-ebook-pdf/

(eBook PDF) Programming Logic & Design Comprehensive


9th Edition

http://ebooksecure.com/product/ebook-pdf-programming-logic-
design-comprehensive-9th-edition/

Java Programming (MindTap Course List), 10th Edition


Joyce Farrell - eBook PDF

https://ebooksecure.com/download/java-programming-mindtap-course-
list-10th-edition-ebook-pdf/
(eBook PDF) Starting Out with Programming Logic and
Design 4th

http://ebooksecure.com/product/ebook-pdf-starting-out-with-
programming-logic-and-design-4th/

Starting Out With Programming Logic and Design, 6e 6th


Edition Tony Gaddis - eBook PDF

https://ebooksecure.com/download/starting-out-with-programming-
logic-and-design-6e-ebook-pdf/

Biochemistry 9th edition. Edition Shawn O. Farrell -


eBook PDF

https://ebooksecure.com/download/biochemistry-ebook-pdf/

(eBook PDF) Digital Logic Circuit Analysis and Design


2nd Edition

http://ebooksecure.com/product/ebook-pdf-digital-logic-circuit-
analysis-and-design-2nd-edition/

Introduction to Java Programming, Comprehensive Version


10th edition- eBook PDF

https://ebooksecure.com/download/introduction-to-java-
programming-comprehensive-version-ebook-pdf/
Joyce Farrell

COMPREHENSIVE

Programming
Logic & Design

Ninth Edition
Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-300
Buy. Rent. Access.

Access student data files and other study


tools on cengagebrain.com.

For detailed instructions visit


http://solutions.cengage.com/ctdownloads/

Store your Data Files on a USB drive for maximum efficiency in


organizing and working with the files.

Macintosh users should use a program to expand WinZip or PKZip archives.


Ask your instructor or lab coordinator for assistance.

Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-300
PROGRAMMING LOGIC
AND DESIGN
COMPREHENSIVE

Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-300
Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-300
NINTH EDITION

PROGRAMMING LOGIC
AND DESIGN
COMPREHENSIVE

JOYCE FARRELL

Australia • Brazil • Japan • Korea • Mexico • Singapore • Spain • United Kingdom • United States
Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-300
Programming Logic and Design, © 2018 Cengage Learning®
Comprehensive
ALL RIGHTS RESERVED. No part of this work covered by the
Ninth Edition
copyright herein may be reproduced or distributed in any form
Joyce Farrell
or by any means, except as permitted by U.S. copyright law,
Senior Product Director: without the prior written permission of the copyright owner.
Kathleen McMahon
For product information and technology assistance, contact us at
Product Team Leader: Kristin McNary
Cengage Learning Customer & Sales Support, 1-800-354-9706
Associate Product Manager: Kate Mason
For permission to use material from this text or product,
Senior Content Developer: Alyssa Pratt submit all requests online at www.cengage.com/permissions
Senior Content Project Manager: Further permissions questions can be emailed to
permissionrequest@cengage.com
Jennifer Feltri-George
Manufacturing Planner: Julio Esperas
Art Director: Diana Graham Library of Congress Control Number: 2016959742
Production Service/Composition: ISBN: 978-1-337-10207-0
SPi Global
Cover Photo: Cengage Learning
Colormos/Photodisc/Getty Images 20 Channel Center Street
Boston, MA 02210
USA

Unless otherwise noted all items © Cengage Learning.

Cengage Learning is a leading provider of customized learning


solutions with employees residing in nearly 40 different coun-
tries and sales in more than 125 countries around the world.
Find your local representative at www.cengage.com.

Cengage Learning products are represented in Canada by


Nelson Education, Ltd.

To learn more about Cengage Learning Solutions, 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


Print Number: 01   Print Year: 2018

Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-300
Brief Contents
v

Pref ace ������� ��� �� ��� ��� ��� ���� �� ��� ��� ��� ������ ��� ��� xvi

CHAPTER 1 An Over view of Computers and Programmi ng ��� 1


CHAPTER 2 Elem en t s o f H i gh- Qual i ty Programs ����� ��� ���� ��� 38
CHAPTER 3 U n der s t an din g Structure ����� � ����� ��� ��� ��� ���� ��� 87
CHAPTER 4 M akin g Decis ions ������ ��� ��� ��� � ����� ��� ��� ��� ���� � 124
CHAPTER 5 Lo o pin g ������ � �� ��� ������ ��� ��� ��� � ����� ��� ��� ��� ���� � 176
CHAPTER 6 Ar r ays �� ������ � �� ��� ������ ��� ��� ��� � ����� ��� ��� ��� ���� � 227
CHAPTER 7 F ile Han dlin g and Appl i cati ons����� ��� ��� ��� ���� � 272
CHAPTER 8 Advan ced Dat a Handl i ng Concepts  ��� � �� � �� � �� � �� 321
CHAPTER 9 Advan ced M o dul ari z ati on Techni ques ����� ���� � 366
CHAPTER 10 Object -Or ien t ed Programmi ng ����� ��� ������ ��� �� 420
CHAPTER 11 M o re Object -Ori ented Programmi ng
Co n cept s ������ ��� �� ��� ��� ��� ���� �� ��� ��� ��� ������ ��� �� 464
CHAPTER 12 Even t -Dr iven G UI Programmi ng,
M u lt it h readin g, and Ani mati on�� ��� ��� ������ ��� �� 507
APPENDIX A U n der s t an din g Numberi ng Sy stems
an d Co m pu t er Codes����� ��� ��� ��� ��� ��� ������ ��� �� 539
APPENDIX B So lvin g Dif f icu l t Structuri ng Probl ems  ��� ��� �� 547
Glo s s ar y ��� �� � ��� �� ��� ��� ��� ��� ��� ��� ��� ��� ���� �� ��� �� 556
In dex������ �� ���� ��� ��� �� ��� ��� ��� ���� �� ��� ��� ��� ������ �� 571

Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-300
Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-300
Contents
vii

Pref ace ������� ��� �� ��� ��� ��� ���� �� ��� ��� ��� ������ ��� ��� xvi

CHAPTER 1 An Over view of Computers and Programmi ng ��� 1


Understanding Computer Systems��������������������������������������� 2
Understanding Simple Program Logic ���������������������������������� 5
Understanding the Program Development Cycle��������������������� 8
Understanding the Problem ��������������������������������������������� 8
Planning the Logic ��������������������������������������������������������10
Coding the Program �����������������������������������������������������10
Using Software to Translate the Program into Machine
Language ������������������������������������������������������������������11
Testing the Program �����������������������������������������������������12
Putting the Program into Production��������������������������������13
Maintaining the Program������������������������������������������������14
Using Pseudocode Statements and Flowchart Symbols ���������15
Writing Pseudocode ������������������������������������������������������15
Drawing Flowcharts ������������������������������������������������������17
Repeating Instructions ��������������������������������������������������19
Using a Sentinel Value to End a Program�����������������������������20
Understanding Programming and User Environments ������������23
Understanding Programming Environments�����������������������23
Understanding User Environments�����������������������������������25
Understanding the Evolution of Programming Models������������27
Chapter Summary �����������������������������������������������������������28
Key Terms�����������������������������������������������������������������������29
Exercises �����������������������������������������������������������������������32

CHAPTER 2 Elem en t s o f H i gh- Qual i ty Programs ����� ��� ���� ��� 38


Declaring and Using Variables and Constants�����������������������39
Understanding Data Types ���������������������������������������������39
Understanding Unnamed, Literal Constants�����������������������39
Working with Variables ��������������������������������������������������40
Understanding a Declaration’s Data Type��������������������������41

Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-300
CONTENTS 

Understanding a Declaration’s Identifier ���������������������������42


Assigning Values to Variables �����������������������������������������45
Declaring Named Constants��������������������������������������������46
Performing Arithmetic Operations ��������������������������������������47
The Integer Data Type ���������������������������������������������������50
viii Understanding the Advantages of Modularization �����������������51
Modularization Provides Abstraction��������������������������������52
Modularization Helps Multiple Programmers to Work
on a Problem��������������������������������������������������������������53
Modularization Allows You to Reuse Work��������������������������53
Modularizing a Program ������������������������������������������������54
Declaring Variables and Constants within Modules�����������������58
Understanding the Most Common Configuration
for Mainline Logic�����������������������������������������������������������60
Creating Hierarchy Charts ���������������������������������������������64
Features of Good Program Design��������������������������������������66
Using Program Comments ���������������������������������������������67
Choosing Identifiers������������������������������������������������������69
Designing Clear Statements��������������������������������������������71
Writing Clear Prompts and Echoing Input��������������������������72
Maintaining Good Programming Habits��������������������������������74
Chapter Summary �����������������������������������������������������������75
Key Terms�����������������������������������������������������������������������76
Exercises �����������������������������������������������������������������������79

CHAPTER 3 U n der s t an din g Structure ����� � ����� ��� ��� ��� ���� ��� 87
The Disadvantages of Unstructured Spaghetti Code��������������88
Understanding the Three Basic Structures ��������������������������90
The Sequence Structure ������������������������������������������������90
The Selection Structure��������������������������������������������������91
The Loop Structure ������������������������������������������������������92
Combining Structures ���������������������������������������������������93
Using a Priming Input to Structure a Program�����������������������99
Understanding the Reasons for Structure��������������������������� 106
Recognizing Structure���������������������������������������������������� 107
Structuring and Modularizing Unstructured Logic ��������������� 110
Chapter Summary ��������������������������������������������������������� 115
Key Terms��������������������������������������������������������������������� 115
Exercises ��������������������������������������������������������������������� 117

Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-300
 CONTENTS

CHAPTER 4 M ak in g Decis ions ������ ��� ��� ��� � ����� ��� ��� ��� ���� � 124
The Selection Structure�������������������������������������������������� 125
Using Relational Comparison Operators ���������������������������� 129
Avoiding a Common Error with Relational Operators��������� 133
Understanding AND Logic������������������������������������������������ 134 ix
Nesting AND Decisions for Efficiency ���������������������������� 137
Using the AND Operator ���������������������������������������������� 139
Avoiding Common Errors in an AND Selection������������������ 141
Understanding OR Logic ������������������������������������������������� 143
Writing OR Selections for Efficiency ������������������������������ 145
Using the OR Operator ������������������������������������������������ 147
Avoiding Common Errors in an OR Selection������������������� 147
Understanding NOT Logic������������������������������������������������ 153
Avoiding a Common Error in a NOT Expression ��������������� 154
Making Selections within Ranges ������������������������������������� 155
Avoiding Common Errors When Using Range Checks ������� 157
Understanding Precedence When Combining
AND and OR Operators��������������������������������������������������� 160
Understanding the case Structure ���������������������������������� 163
Chapter Summary ��������������������������������������������������������� 165
Key Terms��������������������������������������������������������������������� 166
Exercises ��������������������������������������������������������������������� 167

CHAPTER 5 Lo o pin g ������ � �� ��� ������ ��� ��� ��� � ����� ��� ��� ��� ���� � 176
Appreciating the Advantages of Looping ��������������������������� 177
Using a Loop Control Variable������������������������������������������ 179
Using a Definite Loop with a Counter������������������������������ 179
Using an Indefinite Loop with a Sentinel Value ���������������� 181
Understanding the Loop in a Program’s Mainline Logic������ 183
Nested Loops ��������������������������������������������������������������� 185
Avoiding Common Loop Mistakes ������������������������������������ 190
Mistake: Failing to Initialize the Loop Control Variable ������ 190
Mistake: Neglecting to Alter the Loop Control Variable������ 191
Mistake: Using the Wrong Type of Comparison When
Testing the Loop Control Variable ������������������������������� 192
Mistake: Including Statements Inside the Loop Body
that Belong Outside the Loop ������������������������������������� 194
Using a for Loop ���������������������������������������������������������� 199
Using a Posttest Loop ��������������������������������������������������� 201
Recognizing the Characteristics Shared
by Structured Loops ���������������������������������������������������� 203

Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-300
CONTENTS 

Common Loop Applications��������������������������������������������� 205


Using a Loop to Accumulate Totals ������������������������������� 205
Using a Loop to Validate Data��������������������������������������� 209
Limiting a Reprompting Loop ��������������������������������������� 209
Validating a Data Type ������������������������������������������������ 212
x Validating Reasonableness and Consistency of Data��������� 213
Comparing Selections and Loops������������������������������������� 214
Chapter Summary ��������������������������������������������������������� 218
Key Terms��������������������������������������������������������������������� 218
Exercises ��������������������������������������������������������������������� 220

CHAPTER 6 Ar r ays �� ������ ��� ��� ������ ��� ��� ��� � ����� ��� ��� ��� ���� � 227
Storing Data in Arrays���������������������������������������������������� 228
How Arrays Occupy Computer Memory��������������������������� 228
How an Array Can Replace Nested Decisions��������������������� 231
Using Constants with Arrays ������������������������������������������� 238
Using a Constant as the Size of an Array������������������������ 238
Using Constants as Array Element Values ���������������������� 239
Using a Constant as an Array Subscript ������������������������� 239
Searching an Array for an Exact Match������������������������������ 240
Using Parallel Arrays������������������������������������������������������ 244
Improving Search Efficiency������������������������������������������ 248
Searching an Array for a Range Match������������������������������ 250
Remaining within Array Bounds���������������������������������������� 255
Understanding Array Size��������������������������������������������� 255
Understanding Subscript Bounds ���������������������������������� 255
Using a for Loop to Process an Array������������������������������ 258
Chapter Summary ��������������������������������������������������������� 260
Key Terms��������������������������������������������������������������������� 261
Exercises ��������������������������������������������������������������������� 261

CHAPTER 7 F ile Han dlin g and Appl i cati ons����� ��� ��� ��� ���� � 272
Understanding Computer Files ���������������������������������������� 273
Organizing Files ��������������������������������������������������������� 274
Understanding the Data Hierarchy������������������������������������ 275
Performing File Operations ��������������������������������������������� 277
Declaring a File Identifier��������������������������������������������� 277
Opening a File������������������������������������������������������������ 278
Reading Data from a File and Processing It��������������������� 278
Writing Data to a File��������������������������������������������������� 281
Closing a File������������������������������������������������������������� 281
Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-300
 CONTENTS

A Program that Performs File Operations������������������������ 282


Understanding Control Break Logic ���������������������������������� 285
Merging Sequential Files ������������������������������������������������ 290
Master and Transaction File Processing ���������������������������� 299
Random Access Files������������������������������������������������������ 308
Chapter Summary ��������������������������������������������������������� 309 xi
Key Terms��������������������������������������������������������������������� 310
Exercises ��������������������������������������������������������������������� 312

CHAPTER 8 Advan ced Dat a Handl i ng Concepts  ��� � �� � �� � �� � �� 321


Understanding the Need for Sorting Data��������������������������� 322
Using the Bubble Sort Algorithm��������������������������������������� 324
Understanding Swapping Values������������������������������������ 324
Understanding the Bubble Sort ������������������������������������� 325
Sorting Multifield Records ���������������������������������������������� 340
Sorting Data Stored in Parallel Arrays ��������������������������� 340
Sorting Records as a Whole������������������������������������������ 341
Other Sorting Algorithms ������������������������������������������������ 342
Using Multidimensional Arrays������������������������������������������ 345
Using Indexed Files and Linked Lists��������������������������������� 351
Using Indexed Files ���������������������������������������������������� 352
Using Linked Lists ������������������������������������������������������ 353
Chapter Summary ��������������������������������������������������������� 356
Key Terms��������������������������������������������������������������������� 357
Exercises ��������������������������������������������������������������������� 358

CHAPTER 9 Advan ced M o dul ari z ati on Techni ques ����� ���� � 366
The Parts of a Method ��������������������������������������������������� 367
Using Methods with no Parameters ���������������������������������� 368
Creating Methods that Require Parameters������������������������ 371
Creating Methods that Require Multiple Parameters ��������� 377
Creating Methods that Return a Value������������������������������� 379
Using an IPO Chart������������������������������������������������������ 384
Passing an Array to a Method������������������������������������������ 386
Overloading Methods������������������������������������������������������ 394
Avoiding Ambiguous Methods ��������������������������������������� 397
Using Predefined Methods ���������������������������������������������� 400
Method Design Issues: Implementation Hiding, Cohesion,
and Coupling��������������������������������������������������������������� 402
Understanding Implementation Hiding ���������������������������� 402
Increasing Cohesion ��������������������������������������������������� 403
Reducing Coupling������������������������������������������������������ 404
Understanding Recursion������������������������������������������������ 405
Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-300
CONTENTS 

Chapter Summary ��������������������������������������������������������� 410


Key Terms��������������������������������������������������������������������� 411
Exercises ��������������������������������������������������������������������� 412

CHAPTER 10 Object -Or ien t ed Programmi ng ����� ��� ������ ��� �� 420
xii
Principles of Object-Oriented Programming������������������������ 421
Classes and Objects ��������������������������������������������������� 421
Polymorphism ������������������������������������������������������������ 424
Inheritance ���������������������������������������������������������������� 426
Encapsulation ������������������������������������������������������������ 426
Defining Classes and Creating Class Diagrams ������������������ 428
Creating Class Diagrams ��������������������������������������������� 430
The Set Methods��������������������������������������������������������� 433
The Get Methods��������������������������������������������������������� 434
Work Methods������������������������������������������������������������ 435
Understanding Public and Private Access��������������������������� 437
Organizing Classes��������������������������������������������������������� 440
Understanding Instance Methods ������������������������������������� 441
Understanding Static Methods������������������������������������������ 447
Using Objects ��������������������������������������������������������������� 448
Passing an Object to a Method ������������������������������������� 449
Returning an Object from a Method ������������������������������� 450
Using Arrays of Objects ���������������������������������������������� 453
Chapter Summary ��������������������������������������������������������� 455
Key Terms��������������������������������������������������������������������� 456
Exercises ��������������������������������������������������������������������� 458

CHAPTER 11 M o re Object -Ori ented Programmi ng


Co n cept s ��������� �� ��� ��� ��� ���� �� ��� ��� ��� ������ ��� �� 464
Understanding Constructors ������������������������������������������� 465
Default Constructors��������������������������������������������������� 466
Non-default Constructors��������������������������������������������� 468
Overloading Instance Methods and Constructors ������������� 469
Understanding Destructors ��������������������������������������������� 472
Understanding Composition��������������������������������������������� 474
Understanding Inheritance ���������������������������������������������� 475
Understanding Inheritance Terminology��������������������������� 478
Accessing Private Fields and Methods
of a Parent Class������������������������������������������������������ 481
Overriding Parent Class Methods in a Child Class������������ 486

Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-300
 CONTENTS

Using Inheritance to Achieve Good Software Design��������� 486


An Example of Using Predefined Classes:
Creating GUI Objects ��������������������������������������������������� 487
Understanding Exception Handling������������������������������������ 488
Drawbacks to Traditional Error-Handling Techniques��������� 489
The Object-Oriented Exception-Handling Model���������������� 491 xiii
Using Built-in Exceptions and Creating
Your Own Exceptions ������������������������������������������������ 493
Reviewing the Advantages of Object-Oriented Programming 494
Chapter Summary ��������������������������������������������������������� 495
Key Terms��������������������������������������������������������������������� 496
Exercises ��������������������������������������������������������������������� 497

CHAPTER 12 Even t -Dr iven G UI Programmi ng,


M u lt it h readin g, and Ani mati on�� ��� ��� ������ ��� �� 507
Understanding Event-Driven Programming ������������������������� 508
User-Initiated Actions and GUI Components������������������������ 511
Designing Graphical User Interfaces��������������������������������� 514
The Interface Should Be Natural and Predictable������������� 514
The Interface Should Be Attractive, Easy to Read,
and Nondistracting ��������������������������������������������������� 515
To Some Extent, It’s Helpful If the User Can Customize
Your Applications������������������������������������������������������ 516
The Program Should Be Forgiving ��������������������������������� 516
The GUI Is Only a Means to an End��������������������������������� 516
Developing an Event-Driven Application������������������������������ 517
Creating Wireframes ��������������������������������������������������� 518
Creating Storyboards��������������������������������������������������� 518
Defining the Storyboard Objects in an Object Dictionary��� 519
Defining Connections Between the User Screens������������� 520
Planning the Logic ������������������������������������������������������ 520
Understanding Threads and Multithreading ������������������������ 525
Creating Animation��������������������������������������������������������� 528
Chapter Summary ��������������������������������������������������������� 531
Key Terms��������������������������������������������������������������������� 532
Exercises ��������������������������������������������������������������������� 533

Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-300
CONTENTS 

APPENDIX A U n der s t an din g Numberi ng Sy stems


an d Co m pu t er Codes����� ��� ��� ��� ��� ��� ������ ��� �� 539

APPENDIX B So lvin g Dif f icu l t Structuri ng Probl ems  ��� ��� �� 547
xiv
Glo s s ar y ��� ��� ��� �� ��� ��� ��� ��� ��� ��� ��� ��� ���� �� ��� �� 556
In dex������ �� ��� ���� ��� �� ��� ��� ��� ���� �� ��� ��� ��� ������ �� 571

Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-300
Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-300
Preface
xvi

Programming Logic and Design, Comprehensive, Ninth Edition, provides the beginning
­programmer with a guide to developing structured program logic. This textbook assumes
no programming language experience. The writing is nontechnical and emphasizes
good programming practices. The examples are business examples; they do not assume
­mathematical background beyond high school business math.
Additionally, the examples illustrate one or two major points; they do not contain so
many features that students become lost following irrelevant and extraneous details. The
examples in this book have been created to provide students with a sound background in
logic, no matter what programming languages they eventually use to write programs. This
book can be used in a stand-alone logic course that students take as a prerequisite to a
­programming course, or as a companion book to an introductory programming text using
any programming language.

Organization and Coverage


Programming Logic and Design, Comprehensive, Ninth Edition, introduces students to
­programming concepts and enforces good style and logical thinking. General programming
concepts are introduced in Chapter 1.
Chapter 2 discusses using data and introduces two important concepts: modularization
and creating high-quality programs. It is important to emphasize these topics early so
that ­students start thinking in a modular way and concentrate on making their programs
­efficient, robust, easy to read, and easy to maintain.
Chapter 3 covers the key concepts of structure, including what structure is, how to
­recognize it, and most importantly, the advantages to writing structured programs. This
chapter’s content is unique among programming texts. The early overview of structure
­presented here provides students a solid foundation for thinking in a structured way.
Chapters 4, 5, and 6 explore the intricacies of decision making, looping, and array
­manipulation. Chapter 7 provides details of file handling so that students can create
­programs that process a significant amount of data.
In Chapters 8 and 9, students learn more advanced techniques in array manipulation and
modularization. Chapters 10 and 11 provide a thorough, yet accessible, introduction to con-
cepts and terminology used in object-oriented programming. Students learn about classes,
objects, instance and static class members, constructors, destructors, inheritance, and the

Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-300
Organization and Coverage P R E FA C E

advantages of object-oriented thinking. Chapter 12 explores some additional


object-oriented programming issues: event-driven GUI programming, multithreading,
and animation.
Two appendices instruct students on working with numbering systems and providing
structure for large programs. xvii
Programming Logic and Design combines text explanation with flowcharts and ­pseudocode
examples to provide students with alternative means of expressing structured logic.
Numerous detailed, full-program exercises at the end of each chapter illustrate the concepts
explained within the chapter, and reinforce understanding and retention of the material
presented.
Programming Logic and Design distinguishes itself from other programming logic books in
the following ways:
•• It is written and designed to be non-language specific. The logic used in this book can
be applied to any programming language.
•• The examples are everyday business examples: no special knowledge of mathematics,
accounting, or other disciplines is assumed.
•• The concept of structure is covered earlier than in many other texts. Students are
exposed to structure naturally, so that they will automatically create properly designed
programs.
•• Text explanation is interspersed with both flowcharts and pseudocode so that ­students
can become comfortable with these logic development tools and understand their ­inter-
relationship. Screen shots of running programs also are included, providing s­ tudents
with a clear and concrete image of the programs’ execution.
•• Complex programs are built through the use of complete business examples. Students
see how an application is constructed from start to finish, instead of studying only
­segments of a program.

Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-300
Features
This text focuses on helping students become better programmers, as well as helping them
understand the big picture in program development through a variety of features. Each
chapter begins with objectives and ends with a list of key terms and a summary; these
xviii useful features will help students organize their learning experience.

Using a Priming Input to Structure a Program

Don’t Do It
FLOWCHARTS, figures, This logic is structured,
but flawed. When the user
and illustrations provide start
inputs the eof value, it will

the reader with a visual incorrectly be doubled and


output.
105
Declarations
learning experience. num originalNumber
num calculatedAnswer

THE DON’T DO IT ICON illustrates


Yes how NOT to do something—for
not eof?
example, having a dead code
path in a program. This icon
input
No
originalNumber
stop provides a visual jolt to the student,
calculatedAnswer =
originalNumber * 2

are NOT to be emulated and making


output
calculatedAnswer students more careful to recognize
problems in existing code.

Figure 3-17 Structured but incorrect solution to the number-doubling problem

tested. Instead, a result is calculated and displayed one last time before the loop-controlling
test is made again. If the program was written to recognize eof when originalNumber is 0,
then an extraneous answer of 0 will be displayed before the program ends. Depending on
the language you are using and on the type of input being used, the results might be worse:
The program might terminate by displaying an error message or the value output might
be indecipherable garbage. In any case, this last output is superfluous—no value should be
doubled and output after the eof condition is encountered.
As a general rule, a program-ending test should always come immediately after an input
statement because that’s the earliest point at which it can be evaluated. Therefore, the best
solution to the number-doubling problem remains the one shown in Figure 3-16—the
structured solution containing the priming input statement.

C9275_Chapter03_hr.indd 105 11/15/16 2:07 PM

Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-300
 F E AT U R E S

Understanding Simple Program Logic

• The instruction myAnswer = myNumber * 2 is an example of a processing operation.


In most programming languages, an asterisk is used to indicate multiplication, so this
instruction means “Change the value of the memory location myAnswer to equal the
value at the memory location myNumber times two.” Mathematical operations are not the
xix
only kind of processing operations, but they are very typical. As with input operations,
the type of hardware used for processing is irrelevant—after you write a program, it can 7
be used on computers of different brand names, sizes, and speeds.
VIDEO LESSONS help • In the number-doubling program, the output myAnswer instruction is an example of an
explain important chapter
output operation. Within a particular program, this statement could cause the output
to appear on the monitor (which might be a flat-panel plasma screen or a smartphone
concepts. Videos are part
display), or the output could go to a printer (which could be laser or ink-jet), or the
output could be written to a disk or DVD. The logic of the output process is the same no
of the text’s MindTap. matter what hardware device you use. When this instruction executes, the value stored
in memory at the location named myAnswer is sent to an output device. (The output
value also remains in computer memory until something else is stored at the same
memory location or power is lost.)

Watch the video A Simple Program.

Computer memory consists of millions of numbered locations where data can be stored. The memory
location of myNumber has a specific numeric address, but when you write programs, you seldom need
to be concerned with the value of the memory address; instead, you use the easy-to-remember name
you created. Computer programmers often refer to memory addresses using hexadecimal notation,
or base 16. Using this system, they might use a value like 42FF01A to refer to a memory address.
Despite the use of letters, such an address is still a number. Appendix A contains information about the
hexadecimal numbering system.

TWO TRUTHS & A LIE


Understanding Simple Program Logic

1. NOTES provide
A program with syntax errors can execute but might produce incorrect
results.
additional information—
2. Although the syntax of programming languages differs, the same program
logic can be expressed in different languages. for example, another
3. Most simple computer programs include steps that location
perform input,in the book that
processing, and output.
expands on a topic, or a
common error to avoid.
a program with no syntax errors can execute, but might produce incorrect results.
The false statement is #1. A program with syntax errors cannot execute;

TWO TRUTHS & A LIE mini quizzes


C9275_Chapter01_hr.indd 7 8/23/16 7:50 PM

appear after each chapter section, with


answers provided. The quiz contains
three statements based on the preceding
section of text—two statements are
true and one is false. Answers give
immediate feedback without “giving away”
answers to the multiple-choice questions
and programming problems later in
the chapter. Students also have the option
to take these quizzes electronically
MindTap.
Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-300
Assessment
PROGRAMMING EXERCISES provide
opportunities to practice chapter material.
These exercises increase in difficulty and
allow students to explore logical program-
xx ming concepts. Most exercises can be
completed using flowcharts, pseudocode,
or both. In addition, instructors can assign
the exercises as programming problems
to be coded and executed in a particular
programming language.
CHAPTER 1 An Overview of Computers and Programming

Exercises

Review Questions
32
1. Computer programs also are known as ____________.
a. data c. software
b. hardware d. information
2. The major computer operations include ____________.
a. input, processing, and output
b. hardware and software
c. sequence and looping
d. CHAPTER 4
spreadsheets, word processing, and data communications Making Decisions

3. Visual Basic, C++, and Java are all examples of computer ____________.
a. operating systems c. hardware
b. programming languages Programming
d. machine languages Exercises
4. A programming language’s rules are its ____________. 1. Assume that the following variables contain the values shown:
a. syntax c.170format numberBig = 100 wordBig = "Constitution"
b. logic d. options numberMedium = 10 wordMedium = "Dance"
numberSmall = 1 wordSmall = "Toy”
5. The most important task of a compiler or interpreter is to ____________.
For each of the following Boolean expressions, decide whether the statement is
a. create the rules for a programming language true, false, or illegal.
b. translate English statements into a language such as Java a. numberBig > numberSmall
c. translate programming language statements into machine languageb. numberBig < numberMedium
d. execute machine language programs to perform useful tasks c. numberMedium = numberSmall
6. Which of the following is temporary, internal storage? d. numberBig = wordBig
a. CPU c. keyboard e. numberBig = "Big"

REVIEW QUESTIONS test b. hard disk d. memory f. wordMedium > wordSmall


g. wordSmall = "TOY"
7. Which of the following pairs of steps in the programming process is in the
student comprehension of the correct order?
h. numberBig <= 5 * numberMedium 1 50
i. numberBig >= 2000
major ideas and techniques a. code the program, plan the logic
b. test the program, translate it into machine language
j. numberBig > numberMedium + numberSmall
k. numberBig > numberMedium AND numberBig < numberSmall
presented. Twenty questions c. put the program into production, understand the problem l. numberBig = 100 OR numberBig > numberSmall
d. code the program, translate it into machine language m. numberBig < 10 OR numberSmall > 10
follow each chapter. n. numberBig = 300 AND numberMedium = 10 OR numberSmall = 1
o. wordSmall > wordBig
p. wordSmall > wordMedium
2. Design a flowchart or pseudocode for a program that accepts two numbers from
a user and displays one of the following messages: First is larger, Second is larger,
Numbers are equal.
C9275_Chapter01_hr.indd 32 11/25/16 6:08 PM

3. Design a flowchart or pseudocode for a program that accepts three numbers from
a user and displays a message if the sum of any two numbers equals the third.

4. Cecilia’s Boutique wants several lists of salesperson data. Design a flowchart or


pseudocode for the following:
a. A program that accepts one salesperson’s ID number, number of items sold
in the last month, and total value of the items and displays data message only
if the salesperson is a high performer—defined as a person who sells more
than 200 items in the month.
b. A program that accepts the salesperson’s data and displays a message only if
the salesperson is a high performer—defined a person who sells more than
200 items worth at least $1,000 in the month.

C9275_Chapter04_hr.indd 170 11/25/16 6:17 PM


Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-300
 ASSESSMENT

PERFORMING MAINTENANCE
Exercises
exercises ask students to modify
working logic based on new
c. Modify the softball program so that it also computes a gross production
requested specifications.
average (GPA) for each player.This
A GPA is calculated by multiplying a player’s
on-base percentage by 1.8, then adding the player’s slugging percentage, and xxi
activity then
mirrors real-world
dividing by four. tasks
that
10. students arechart
Draw the hierarchy likelyand to
design the logic for a program for Arnie’s 85
encounter in their first programming
Appliances. Design a program that prompts the user for a refrigerator model
name and the interior height, width, and depth in inches. Calculate the
jobs.refrigerator capacity in cubic feet by first multiplying the height, width, and
depth to get cubic inches, and then dividing by 1728 (the number of cubic inches
in a cubic foot). The program accepts model names continuously until “XXX” is
entered. Use named constants where appropriate. Also use modules, including
one that displays End of job after the sentinel is entered for the model name.

Performing Maintenance
1. A file named MAINTENANCE02-01.txt is included with your downloadable
student files. Assume that this program is a working program in your
organization and that it needs modifications as described in the comments (lines
that begin with two slashes) at the beginning of the file. Your job is to alter the
program to meet the new specifications.

Find the Bugs

1. Your downloadable files for Chapter 2 include DEBUG02-01.txt, DEBUG02-02.


txt, and DEBUG02-03.txt. Each file starts with some comments that describe
the problem. Comments are lines that begin with two slashes (//). Following the
comments, each file contains pseudocode that has one or more bugs you must
find and correct.

2. Your downloadable files for Chapter 2 include a file named DEBUG02-04.jpg that
contains a flowchart with syntax and/or logical errors. Examine the flowchart,
and then find and correct all the bugs.

Game Zone

1. For games to hold your interest, they almost always include some random,
unpredictable behavior. For example, a game in which you shoot asteroids loses
some of its fun if the asteroids follow the same, predictable path each time you
play. Therefore, generating random values is a key component in creating most

GAME ZONE EXERCISES are included


C9275_Chapter02_hr.indd 85
at the end of each chapter. Students can
11/25/16 6:22 PM

create games as an additional entertaining


way to understand key programming
DEBUGGING EXERCISES are concepts.
included with each chapter because
examining programs critically and
closely is a crucial programming skill.
Students can download these exercises
at www.cengagebrain.com and through
MindTap. These files are also available
to instructors through sso.cengage.com.
Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-300
P R E F A C E MindTap

Other Features of the Text


This edition of the text includes many features to help students become better program-
mers and understand the big picture in program development.
•• Clear explanations. The language and explanations in this book have been refined over
xxii
eight editions, providing the clearest possible explanations of difficult concepts.
•• Emphasis on structure. More than its competitors, this book emphasizes
structure. Chapter 3 provides an early picture of the major concepts of structured
programming.
•• Emphasis on modularity. From the second chapter onwards, students are encouraged
to write code in concise, easily manageable, and reusable modules. Instructors have
found that modularization should be encouraged early to instill good habits and
a clearer understanding of structure.
•• Objectives. Each chapter begins with a list of objectives so that the student knows 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.
•• Chapter summaries. Following each chapter is a summary that recaps the program-
ming concepts and techniques covered in the chapter.
•• Key terms. Each chapter lists key terms and their definitions; the list appears in the
order that the terms are encountered in the chapter. A glossary at the end of the book
lists all the key terms in alphabetical order, along with their working definitions.

MindTap
MindTap is a personalized learning experience with relevant assignments that guide stu-
dents in analyzing problems, applying what they have learned, and improving their think-
ing. MindTap allows instructors to measure skills and outcomes with ease.
For instructors: Personalized teaching becomes yours with a learning path that is built with
key student objectives. You can control what students see and when they see it. You can use
MindTap as-is, or match it to your syllabus by hiding, rearranging, or adding content.
For students: A unique learning path of relevant readings, multimedia, and activities is cre-
ated to guide you through basic knowledge and comprehension of analysis and application.
For both: Better outcomes empower instructors and motivate students with analytics and
reports that provide a snapshot of class progress, the time spent in the course, engagement
levels, and completion rates.
The MindTap for Programming Logic and Design includes coding labs in C11, Java, and
Python, study tools, videos, and interactive quizzing, all integrated into an eReader that
includes the full content of the printed text.

Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-300
Acknowledgments P R E FA C E

Instructor Resources
The following teaching tools are available to the instructor for download through our
Instructor Companion Site at sso.cengage.com.
•• Instructor’s Manual. The Instructor’s Manual follows the text chapter by chapter to
xxiii
assist in planning and organizing an effective, engaging course. The manual includes
learning objectives, chapter overviews, lecture notes, ideas for classroom activities, and
abundant additional resources. A sample course syllabus is also available.
•• PowerPoint Presentations. This text provides PowerPoint slides to accompany each
chapter. Slides are included to guide classroom presentations, and can be made available
to students for chapter review, or to print as classroom handouts.
•• Solutions. Solutions to review questions and exercises are provided to assist with grading.
•• Test Bank®. Cengage Learning Testing Powered by Cognero is a flexible, online system
that allows you to:
•• author, edit, and manage test bank content from multiple Cengage Learning
solutions,
•• create multiple test versions in an instant, and
•• deliver tests from your LMS, your classroom, or anywhere you want.

Additional Options
•• Visual Logic™ software. Visual Logic is a simple but powerful tool for teaching
­ rogramming logic and design without traditional high-level programming language
p
syntax. Visual Logic also interprets and executes flowcharts, providing students with
immediate and accurate feedback.

Acknowledgments
I would like to thank all of the people who helped to make this book a reality, especially
Alyssa Pratt, Jennifer Feltri-George, Kristin McNary, Kate Mason, and all the other
­professionals at Cengage Learning who made this book possible. Thanks, too, to my
­husband, Geoff, and our daughters, Andrea and Audrey, for their support. This book, as
were all its previous editions, is dedicated to them.
–Joyce Farrell

Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-300
Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-300
CHAPTER 1
An Overview
of Computers
and Programming

Upon completion of this chapter, you will be able to:

Describe computer systems


Understand simple program logic
List the steps involved in the program development cycle
Write pseudocode statements and draw flowchart symbols
Use a sentinel value to end a program
Understand programming and user environments
Describe the evolution of programming models

Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-300
CHAPTER 1 An Overview of Computers and Programming

Understanding Computer Systems


A computer system is a combination of all the components required to process and store
data using a computer. Every computer system is composed of multiple pieces of hardware
and software.
2 •• Hardware is the equipment, or the physical devices, associated with a computer.
For example, keyboards, mice, speakers, and printers are all hardware. The devices
are manufactured differently for computers of varying sizes—for example, large
mainframes, laptops, and very small devices embedded into products such as
telephones, cars, and thermostats. The types of operations performed by different-
sized computers, however, are very similar. Computer hardware needs instructions
that control its operations, including how and when data items are input, how they are
processed, and the form in which they are output or stored.
•• Software is computer instructions that tells the hardware what to do. Software is programs,
which are instruction sets written by programmers. You can buy prewritten programs that
are stored on a disk or that you download from the Web. For example, businesses use word-
processing and accounting programs, and casual computer users enjoy programs that play
music and games. Alternatively, you can write your own programs. When you write software
instructions, you are programming. This book focuses on the programming process.
Software can be classified into two broad types:
•• Application software comprises all the programs you apply to a task, such as word-
processing programs, spreadsheets, payroll and inventory programs, and games. When
you hear people say they have “downloaded an app onto a mobile device,” they are
simply using an abbreviation of application software.
•• System software comprises the programs that you use to manage your computer,
including operating systems such as Windows, Linux, or UNIX for larger computers
and Google Android and Apple iOS for smartphones.
This book focuses on the logic used to write application software programs, although many
of the concepts apply to both types of software.
Together, computer hardware and software accomplish three major operations in most programs:
•• Input: Data items enter the computer system and are placed in memory, where they can be
processed. Data items include all the text, numbers, and other raw material that are entered
into and processed by a computer. Hardware devices that perform input operations
include keyboards and mice. In business, many of the data items used are facts and figures
about such entities as products, customers, and personnel. Data, however, also can include
items such as images, sounds, and a user’s mouse or finger-swiping movements.
•• Processing: Processing data items may involve organizing or sorting them, checking
them for accuracy, or performing calculations with them. The hardware component
that performs these types of tasks is the central processing unit, or CPU. Some devices,
such as tablets and smartphones, usually contain multiple processors, and efficiently
using several CPUs requires special programming techniques.
Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-300
Understanding Computer Systems

•• Output: After data items have been processed, the resulting information usually is sent
to a printer, monitor, or some other output device so people can view, interpret, and use
the results. Programming professionals often use the term data for input items, but use
the term information for data items that have been processed and output. Sometimes
you place output on storage devices, such as your hard drive, flash media, or a
cloud-based device. (The cloud refers to devices at remote locations accessed through 3
the Internet.) People cannot read data directly from these storage devices, but the
devices hold information for later retrieval. When you send output to a storage device,
sometimes it is used later as input for another program.
You write computer instructions in a computer programming language such as Visual Basic,
C#, C++, or Java. Just as some people speak English and others speak Japanese, programmers
write programs in different languages. Some programmers work exclusively in one language,
whereas others know several and use the one that is best suited to the task at hand.
The instructions you write using a programming language are called program code; when
you write instructions, you are coding the program.
Every programming language has rules governing its word usage and punctuation. These
rules are called the language’s syntax. Mistakes in a language’s usage are syntax errors. If
you ask, “How the geet too store do I?” in English, most people can figure out what you
probably mean, even though you have not used proper English syntax—you have mixed up
the word order, misspelled a word, and used an incorrect word. However, computers are
not nearly as smart as most people; in this case, you might as well have asked the computer,
“Xpu mxv ort dod nmcad bf B?” Unless the syntax is perfect, the computer cannot interpret
the programming language instruction at all.
Figure 1-1 shows how the statement that displays the word Hello on a single line on a
computer monitor looks in some common programming languages. Notice that the syntax
of some languages require that a statement start with an uppercase letter, while the syntax
of others does not. Notice that some languages end statements with a semicolon, some with
a period, and some with no ending punctuation at all. Also notice that different verbs are
used to mean display, and that some are spelled like their like English word counterparts,
while others like cout and System.out.println are not regular English words. The different
formats you see are just a hint of the various syntaxes used by languages.

Language Statement that displays Hello on a single line


Java System.out.println(“Hello);

C++ cout << “Hello” << endl;

Visual Basic Console.WriteLine(“Hello”);

Python print “Hello”

COBOL DISPLAY “Hello”.

Figure 1-1 Displaying the word Hello in some common programming languages
Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-300
CHAPTER 1 An Overview of Computers and Programming

After you learn French, you automatically know, or can easily figure out, many Spanish words. Similarly,
after you learn one programming language, it is much easier to understand other languages.

4 When you write a program, you usually type its instructions using a keyboard. When you
type program instructions, they are stored in computer memory, which is a computer’s
temporary, internal storage. Random access memory, or RAM, is a form of internal,
volatile memory. Programs that are running and data items that are being used are stored in
RAM for quick access. Internal storage is volatile—its contents are lost when the computer
is turned off or loses power. Usually, you want to be able to retrieve and perhaps modify
the stored instructions later, so you also store them on a permanent storage device, such
as a disk. Permanent storage devices are nonvolatile—that is, their contents are persistent
and are retained even when power is lost. If you have had a power loss while working on
a computer, but were able to recover your work when power was restored, it’s not because
the work was still in RAM. Your system has been configured to automatically save your
work at regular intervals on a nonvolatile storage device—often your hard drive.
After a computer program is typed using programming language statements and stored
in memory, it must be translated to machine language that represents the millions of on/
off circuits within the computer. Your programming language statements are called source
code, and the translated machine language statements are object code.
Each programming language uses a piece of software, called a compiler or an interpreter,
to translate your source code into machine language. Machine language also is called
binary language, and is represented as a series of 0s and 1s. The compiler or interpreter
that translates your code tells you if any programming language component has been used
incorrectly. Syntax errors are relatively easy to locate and correct because your compiler or
interpreter highlights them. If you write a computer program using a language such as C++,
but spell one of its words incorrectly or reverse the proper order of two words, the software
lets you know that it found a mistake by displaying an error message as soon as you try to
translate the program.

Although there are differences in how compilers and interpreters work, their basic function is the
same—to translate your programming statements into code the computer can use. When you use
a compiler, an entire program is translated before it can execute; when you use an interpreter, each
instruction is translated just prior to execution. Usually, you do not choose which type of translation to
use—it depends on the programming language. However, some languages can use both compilers and
interpreters.

After a program’s source code is translated successfully to machine language, the computer
can carry out the program instructions. When instructions are carried out, a program runs,
or executes. In a typical program, some input will be accepted, some processing will occur,
and results will be output.

Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-300
Another Random Scribd Document
with Unrelated Content
[Illustration: RAISING HIS VOICE HE SHOUTED, "LET GO!"]

Now he was putting his faith to the acid test. Woodleigh was in
sole control of the helm. If he failed to carry out his instructions or
misinterpreted the reading of the chart, then goodness only knows
what might happen.

Woodleigh was in his element. It seemed to him that he had


reached the zenith of his ambition to be in charge as navigator of a
large motor-boat in the North Sea. True, he was not out of sight of
land, and the North Sea as pictured by present conditions, with a
maze of sand-banks, buoys, and sea-marks, and a few lightships and
pile-beacons thrown in, hardly coincided with what he imagined it to
be.

The Scoutmaster was sleeping soundly; Peter Stratton was dosing


fitfully on one of the lockers in the cockpit; Roche, as engineer on
duty, was "standing by"; the other Sea Scouts were preparing
breakfast; and Mr. Murgatroyd, gamely determined to recover his
sea-legs, was hanging on to the coaming of the cockpit and
watching the low-lying coast-line.

Before long Woodleigh discovered that making a passage by the


aid of a chart was a comparatively simple matter.... It was merely a
question of going from one buoy to another and noting the name on
each one as he passed it. Even the Maplin, standing like one of
Wells's Martians on its spider-like legs, the lad greeted as an old
friend.

Up through the South-West Reach, across the shoals into the East
Swin, the Olivette made her way.

"The Whitaker Beacon on the port hand," soliloquized the youthful


helmsman. "Good enough; that must be the Swin Spitway buoy I
can see ahead."
His surmise was correct. He starboarded helm on passing the latter
buoy and stood on through the Wallet. The breaking seas on the
Buxey and the tail of the Gunfleet looked formidable, and
Woodleigh, for the first time doubting the advisability of "carrying
on" farther than Mr. Armitage had stipulated, was on the point of
getting one of his companions to rouse the Scoutmaster.

"Must be all right," he decided, giving another glance at the chart.


It was about the twentieth time he had done so in the last two
hours, and the chart, saturated with spray, was to him no longer a
mass of complicated figures, but something more tangible. It was
something on which he depended in order to bring the Olivette
through the intricate channels between the shoals.

The new course, approximately N.N.W., was now dead in the eye of
the wind, and Woodleigh began to experience some of the
discomforts his Scoutmaster had endured during the night. Now it
was broad daylight, and the white-crested masses of water bearing
down upon the boat looked very threatening.

Waves thudded against her bows, throwing cascades of foam not


only against, but completely over, the wheel-house. Now and again,
as the boat's stern was lifted clear of the water, the propeller would
race violently, causing the engineer many anxious moments, until,
with a peculiar sensation, the motor would slow down as the blades
of the screw met with increased resistance.

Mr. Armitage was still sleeping soundly. Even the racket in the
Wallet failed to rouse him; but Stratton, shaking off his lethargy,
climbed into the wheel-house and stood behind the helmsman.

"Where are we now, Woodleigh?" he asked.

"Nearly there—at Brightlingsea," replied the Sea Scout proudly;


"there are the beacons on Colne Point."

"Hadn't we better wake Mr. Armitage?" suggested the Patrol-leader.


"No, don't," said Woodleigh earnestly. "He's dead beat. There's no
difficulty in getting in, and it will be a surprise for him to find out
where we are. Think you'll be able to manage that anchor?"

Peter thought that, with assistance, he could.

"I'll wait till we're in," he decided. "Not much fun stocking an
anchor with the boat jumping about like this. I say, bit of crowd, isn't
it?"

He pointed ahead, where the estuary of the Colne was black with
the hulls of fishing-smacks that had run in on the approach of bad
weather.

"Wind's veering," added Woodleigh. "Look where it is now—almost


dead astern. Guess we've done it just in time."

Within the last ten minutes the wind had shifted from N.N.W. to
S.E., and in consequence Mersea Flats, on the port hand to the
entrance of the river, were a lee shore. Above the noise of the
engine the two Scouts could hear the roar of the breakers upon the
hard sand, for it was now just on low water.

With a sense of elation that he had dared and won through,


Woodleigh gave the wheel half a turn. He was making for port,
running the gauntlet of the bar, and confidence in the boat and in
himself was half the battle.

"We're across the bar, Peter!" he exclaimed joyously, when the


Olivette entered the sheltered waters of the Colne. "Now then, old
son; turn out your merry wreckers and get the anchor cleared away.
Warn Roche as you go; but don't disturb Mr. Armitage if you can
help it."

The clearing away of the heavy anchor, and the securing of the
forelock, was not accomplished in a moment, and, by the time all
was in readiness for letting go, Woodleigh had "opened out" the little
town of Brightlingsea, standing on the northern bank of the creek
that derives its name from the busy yachting and fishing centre.

"Stop!" ordered Woodleigh, addressing the now alert Roche; then,


raising his voice, he shouted: "Let go!"

The roar of the cable through the fair-leads announced that the
voyage of the Olivette, as far as the Milford Sea Scouts were
concerned, was an accomplished fact. It also had the effect of
rousing the Scoutmaster from his slumbers.

The crew, having been "given the tip", watched the expression on
Mr. Armitage's face with ill-concealed amusement.

"What have you anchored for?" he asked. "Where are we?"

"There, sir," replied Woodleigh triumphantly. "We're off


Brightlingsea."

CHAPTER XI
The "Rosalie"

For some moments Mr. Armitage hardly knew what to say. When
his first feelings of astonishment subsided, he felt inclined to
reprimand Woodleigh for disobeying orders. Had the lad made a
blunder the consequences might have been serious—but he hadn't.

"After all," thought the Scoutmaster, "he did very well. Sort of
Nelson touch about that lad. If he acted with deliberate judgment,
and not through a sheer slice of luck, he's cut out for navigating
duties. 'Tany rate, I've had a good sound sleep, but I wouldn't have
slumbered so quietly had I known."

He went on deck. The Olivette was riding to a single anchor in a


land-locked estuary, within a cable's length of Brightlingsea Hard. He
could hardly realize the fact.

"We thought we'd wait till the ebb makes before we run out a
kedge, sir," reported the Patrol-leader; "then she'll ride to her main
anchor and cable."

"Quite right," agreed Mr. Armitage. "What's the time? Eight o'clock.
Any breakfast going?"

There was. From the galley came the first appetizing smell of
grilling bacon. Warkworth, who revelled in the work in the galley,
was preparing a substantial meal, supplemented by coffee.

On his way aft Mr. Armitage touched Woodleigh on the shoulder.

"I've taught you as much as I know myself at this game,


Woodleigh," he declared. "You don't happen to be acquainted with
this part, I suppose?"

"No, sir," replied the youngster. "It's those imaginary cruises we


used to work out on the chart that helped me."

"You ought to have turned me out when you sighted the Maplin,"
continued the Scoutmaster.

"Yes," agreed Woodleigh; "but you were sleeping soundly, sir. I


didn't like to disturb you."

Sitting on one of the lockers of the well was Mr. Murgatroyd,


looking rather tired; but he had lost the greyish hue that
accompanies the horrible sensation of sea-sickness.
"We've arrived, Mr. Murgatroyd," remarked the Scoutmaster
cheerfully. "Sooner than we expected, you see."

"And a jolly little spot it is!" declared the owner. "Who's ready for
breakfast? I'm as hungry as a hunter."

It was a jovial party that gathered round the long, folding table. In
spite of the strenuous passage and the lack of an uninterrupted
night's rest, the Sea Scouts were in high spirits. They realized that
the Olivette had fought a battle with the elements, and that she had
emerged triumphantly out of the ordeal.

"You'll be all right here with a crew who know this part of the
coast," observed Mr. Armitage.

"Rather!" agreed Mr. Murgatroyd. "I wish, though, that some of you
lads could remain, but I know that's out of the question. What are
your plans?"

"We'll pack up and leave you as soon as possible," replied the


Scoutmaster. "We'll catch the first train to Colchester, and then on to
Yarmouth, get aboard the Rosalie fairly early, and then we'll make up
arrears of sleep."

"Why not remain here until to-morrow?" asked the owner of the
Olivette.

"We'd have our rest at the wrong end, so to speak, if we did,"


explained Mr. Armitage. "If we're at our port of departure, we can
get under way directly the weather moderates, which we couldn't do
if the Rosalie were at Yarmouth and we at Brightlingsea."

Breakfast over, the Sea Scouts prepared to evacuate their


temporary floating home. They were sorry to leave the Olivette, but
regrets were tempered by the knowledge that a bigger undertaking
was awaiting them.
Before they went ashore the Olivette was cleaned down and tidied
up, her decks scrubbed, ropes coiled neatly down, and a kedge run
out.

Mr. Murgatroyd shook hands with every member of the crew,


thanking them for the real good time.

"I'll try to follow your example," he said, "and make some sort of a
sailor-man. It's never too late to learn, as I expect I've said before."

"Decent old chap," remarked Peter Stratton, when the Sea Scouts
embarked in a ferry-boat and were taken ashore. "Wonder if the
owner of the Rosalie is anything like him?"

"We won't know until we hand the yacht over," replied the
Scoutmaster. "He's not coming with us. That reminds me, I must
send a wire to our friend the Oxford Scoutmaster."

"Mr. Jackson?" asked Roche.

"Yes," was the reply. "You fellows are doing so well, that I feel out
of it; so, needing someone to keep me company, I invited Mr.
Jackson for the voyage from Yarmouth to Poole. He and I will have a
rare, good, lazy time, sitting on deck and watching you do the
donkey-work."

"I can see you doing that, sir," rejoined Hepburn, laughing.
"Wonder what the Rosalie is like?"

"Possess your soul in patience for another six hours, Alan, and your
curiosity will, I hope, be satisfied," replied Mr. Armitage.

"Now," he added briskly, as the boat ran alongside the Hard,


"Flemming and Woodleigh, you had better be baggage-guard until
we can find some sort of conveyance to get the gear to the station.
I'll go to the post office. Anyone else coming?"
Everyone wanted to send off letters to relatives.

"Hang on a minute, Peter," said Flemming. "I want to scribble a


line. You might post it for me."

"I know a better plan," replied the Patrol-leader. "I'll buy picture
post cards for Woodleigh and you, and you can post them on the
way to the railway station."

About three o'clock in the afternoon the Sea Scouts arrived at


Great Yarmouth. Mr. Armitage was now on familiar ground, and the
Rosalie was quickly located lying alongside a wharf above the swing-
bridge.

At first sight she was not prepossessing.

She was a straight-stemmed craft with a short counter, schooner-


rigged, her masts being set in "tabernacles", or vertical troughs of
wood, to enable them to be lowered in the event of her having to
pass under an immovable bridge. She had been grievously
neglected. Her hull was painted "battleship grey", or rather the paint
had been "slapped on" over her original coat of white. Her teak
topsides and coamings were weather-worn and black with the
combined action of salt water, rain, and sun. Her masts were painted
the same hideous colour as the hull, and someone in a sudden fit of
zeal had commenced scraping one and left the wood partly bare.
The decks were black with dirt and coal-dust, and generally she bore
an air of utter disrespectability.

"The old boat's been in Government service," explained the man in


whose charge she had been left. "Nice li'l ole boat she be, but she's
a regular beast in a seaway. Rolls like a barrel, she do. Here's the
key, sir."

'Tween decks things were more hopeful. Although there was dirt
and dust everywhere, everything was fairly dry.
Right aft, and gained by a companion-ladder from a very small
cockpit, was the main cabin, fitted throughout in teak, and
possessing four sofa berths. In the centre was a large table, while
there was more than 6 feet 6 inches headroom under the deck-
beams. Through the for'ard bulkhead of the saloon were two
doorways, one leading to a small, compact, and well-fitted galley,
the other to a single-berthed sleeping-cabin.

For'ard of these a solid bulkhead ran athwartships, completely


cutting off the engine-room from the owner's quarters.

The engine-room was gained by means of an almost vertical ladder.


In it were two twin motors of 30 horse-power, controlled, when
running, from a "sunk" wheel-house. Opening out of the engine-
room was a spacious forepeak, with folding-cot accommodation for
six persons.

"We've got our work cut out to get shipshape before night,"
declared Mr. Armitage briskly. "All hands to it, and we'll soon break
the back of the job."

The Sea Scouts were told off to their respective tasks. Stratton and
Hepburn tackled the work of scrubbing decks, airing sails, and
overhauling the running-gear. Roche and Flemming took on the
motor-room, running the engines, testing the controls, and seeing
"how things worked", in addition to gauging the contents of the
petrol and oil tanks, and "checking" the engineers' stores.

Woodleigh and Warkworth cleaned out the forepeak and the galley,
while the Scoutmaster toiled like a Trojan in the main cabin.

By six o'clock in the evening the Rosalie was transformed into a


clean and tidy craft, the Sea Scouts' gear was packed away below,
and the galley fires were burning brightly. Half an hour later all
hands sat down to a plentiful meal in the saloon Then, dead tired
with their exertions, they turned in and slept until nearly eight the
next morning.
"No chance of a start to-day," declared Mr. Armitage. "The glass
has risen far too quickly. It means a repetition of the blow, but
possibly from another quarter."

"Would it be too rough outside, sir?" asked Hepburn. "The


caretaker told me that the Rosalie was out in all weathers during the
war, winter and summer."

"It may not be too rough for the yacht," replied Mr. Armitage, "but
it may be too rough for us. Remember it's the human element that
counts. We don't know the Rosalie. She, no doubt, has her
peculiarities, which her former crew understood. We don't. We have
to find them out. See what I mean?"

"I suppose, sir," said Flemming, "that in your opinion we aren't


equal to the task."

"Not at all," declared the Scoutmaster. "Otherwise I wouldn't have


undertaken the contract. You are healthy, well-developed lads, but
you aren't equal to full-grown experienced men. Therefore I have to
be careful not to run unnecessary risks. We'll set canvas and see
what the gear's like. That requires practice, I can assure you."

"In case we have to stow sails in a hurry," added Stratton.

"Precisely," agreed Mr. Armitage. "Nothing afloat looks so bad as a


raw crew struggling ineffectually at stowing canvas. You should
know exactly what's what, which rope is which, so that you could
find them in the dark."

The sails were in excellent condition and the running-gear good.


For an hour the Sea Scouts practised hoisting and stowing staysail,
foresail, and mainsail, until Mr. Armitage expressed himself satisfied.

"Now," he continued, addressing Roche and Flemming, the two


engineers, "we'll run the engines. We can spare you, Woodleigh, if
necessary, but the Rosalie's twin engines ought to be less trouble
than the Olivette's single one, because the controls are worked from
the deck. Hallo! This for me?"

The last sentence was addressed to a telegraph-boy standing on


the quayside with an orange-coloured envelope in his hand.

"Mr. Armitage," replied the messenger.

The Scoutmaster read the telegram. "No reply, thanks," he said.

The wire was from Mr. Jackson to say that he was leaving Liverpool
Street at eight.

"He'll be here just after twelve," said the Scoutmaster. "It's now
twenty past eleven, so Warkworth and Hepburn can go to the station
to meet him and bring him along. By Jove! It's piping up. We'll be
lucky if we are able to start to-morrow."

CHAPTER XII
The Squall

"There are worse things than being weather-bound with a crew of


Sea Scouts," observed Mr. Jackson that same evening. "You've a
lively lot of lads, Armitage, and they keep you amused, I'm sure."

"They're not so dusty," admitted Mr. Armitage modestly. He was


reluctant to "spout" over the merits of the lads he had himself
trained. "I've had inexperienced crews in the old R.N.V.R. days, and
managed to lick 'em into shape, and in their initial stages they
weren't equal to these lads, yet we had to go to sea with them and
stand a chance of knocking up against Fritz in addition."

"To say nothing of bumping on a mine," added the Oxford


Scoutmaster.

Mr. Armitage nodded assent.

"And the danger still exists," he continued. "I haven't said anything
to my youngsters, because I didn't consider it advisable. But the fact
remains that there are stray floating mines that can hardly be seen
owing to their being smothered with barnacles and weeds. And
they'll be knocking around for years, I'm afraid."

"There wouldn't be much left of the Rosalie if she struck one,"


commented Mr. Jackson.

"No, indeed," agreed his companion. "There would be one


consolation—we wouldn't know anything about it. However, the
North Sea is wide, so we can but trust in Providence."

"What do you make of the weather?" asked Mr. Jackson.

Mr. Armitage glanced aloft. In the twilight the dark clouds were not
scudding so rapidly as they had done earlier in the day.

"Change of wind, I fancy," he replied. "Glass is rising slowly. One


hardly knows what to make of the weather nowadays, and the
forecasts in the paper are generally hopelessly wrong. Well, shall we
turn in? If there's any chance of making a passage to-morrow, we'll
start."

At 5 a.m. all hands turned out, bathed, and had breakfast. It was
still blowing fairly fresh, but the wind had veered through west and
was now practically nor'-west.
"Off-shore wind," observed the Scoutmaster. "We'll be all right as
far as Harwich, so get busy."

The Sea Scouts needed no second bidding. Roche and Flemming,


donning overalls, dived below to the engine-room. The others,
assisted by Mr. Jackson, set to work to lower the masts to allow the
Rosalie to pass under the bridge.

Precisely at eight o'clock the Red Ensign was hoisted, the warps
cast off, and the yacht, under power, started on her long voyage.

By the time she had taken to traverse the long stretch of river that
enters the North Sea at Gorleston, Peter Stratton had made himself
acquainted with Rosalie's steering capabilities, in spite of the fact
that navigation was rather complicated owing to the number of
fishing-boats under way in the narrow channel.

"Look out for the tide setting across the pierheads," cautioned the
Scoutmaster.

The North Sea was not looking at its best. Although the wind was
off shore, there was a nasty "lop" off the entrance to the harbour.
Even the lightship was pounding heavily, cascades of water pouring
through her hawse-pipes as she lifted to the waves; sailing-coasters
were rolling badly in spite of their reduced canvas; and tramps, with
trysails set to steady them, were lurching along, leaving a long,
almost horizontal trail of smoke far to leeward.

"Thick out there," observed Hepburn. "As bad as we had round the
Maplins. We're rolling a bit too."

There was no doubt about it, the Rosalie could and did roll. With
the wind abeam her decks were soon wet. It was almost impossible
for the crew to move without holding on, and, except for the small
wheel-house, there was no protection on deck from the wind and
spray.
"We'll see what a little canvas will do," said Mr. Armitage. "She's
stiff enough. Up with trysail and mainsail, lads."

Quickly the canvas bellied to the quartering wind, and, as the


sheets were hove taut, the Rosalie no longer rolled like a barrel. The
disconcerting motion gave place to a rhythmic glide as she lifted
gracefully to the waves.

"A good ten or eleven knots," declared Mr. Armitage. "She's as stiff
as a house. We'll have the foresail set and stop the engines."

This was done. Although the speed fell off to a bare five knots, the
yacht was carrying her tide and simply waltzing past the shore.

"Give me sail for pleasure any old day," declared Mr. Jackson.
"Petrol's all very well if you're in a hurry, but when all's said and
done canvas wants a lot of beating."

The Sea Scouts revelled in the situation. With the breeze being true
and in their favour, they could lie on the deck and enjoy the view, as
the Rosalie slipped past Lowestoft and made short work of it
towards Southwold. Close in under the land they were no longer
subjected to clouds of spray, and the tardy appearance of the sun
gave a finishing touch to their enjoyment.

There was no immediate hurry. They had plenty of time to cover


the fifty odd miles between Yarmouth and Harwich, where Mr.
Armitage had decided to put in for the night. A series of short
passages was preferable to making a direct run across to the
Forelands with the prospect of finding themselves off Dover in the
dark, and the Scoutmaster knew from experience the effect of
carrying on and depriving the crew of a much-needed rest. If
occasion demanded, he would be equal to it, but he preferred
otherwise.

So the Rosalie held on, passing close to Aldborough, and giving the
low-lying Orfordness a wide berth, and at 5 p.m., without having had
to touch a single sheet from the time canvas had been set, Hepburn
reported a lightship on the port bow.

"That's the Cork," said Stratton, consulting the chart. "We're


getting near Harwich. Any tea going, Woodleigh? Now's our chance
before we stow canvas."

Mr. Armitage, after glancing to windward, gave Hepburn directions


as to the course.

"We'll leave you to it, Alan," he said. "If you want anything, give a
hail. We'll keep your tea hot."

The rest of the crew went below, where a sumptuous meal was
being served in the main cabin, leaving Hepburn in the wheel-house.

Woodleigh had provided his companions (and incidentally himself)


with a generous and wholesome repast. He rather prided himself
upon his skill as a cook at sea, and he certainly did himself justice.

Hungry as hunters, the two Scoutmasters and five boys seated


themselves round the swing table, and Mr. Armitage began pouring
out tea, while Woodleigh served out a helping of cold veal and ham
pie.

Suddenly, just as everyone was settling down to his tea, the


Rosalie, which had hitherto been heeling at an almost constant
angle, lurched violently to leeward. Stratton, Flemming, and
Warkworth, their chairs slipping from under them, rolled in a heap
upon the floor, while Mr. Jackson, in a vain endeavour to prevent
himself from being pitched across the cabin, subsided heavily upon
the table. It tilted under his weight, and the next moment everything
that had been placed upon it slithered on the struggling trio of
prostrate Sea Scouts.

There was no time to waste in contemplating the scene of chaos.


The yacht was well down on her beam ends. In a thrice Mr. Armitage
dashed up the companion-ladder and gained the deck.

A violent squall, its approach unnoticed by Hepburn in the


sheltered wheel-house, had swept down upon the Rosalie. The first
intimation the young helmsman had was finding the yacht heel until
half a dozen planks of her deck were awash. It was only by holding
on to the spokes of the wheel that he saved himself from being
thrown heavily against the plate-glass window.

"Luff!" shouted the Scoutmaster, as he hauled himself along by the


weather-rail towards the wheel-house.

Hepburn was already endeavouring to luff, but, although he put the


helm hard-a-port, the yacht showed no tendency to fly up into the
wind. Pinned down by the closely-set staysail, she simply lay over
and refused to recover.

Literally sliding to leeward until he stood knee-deep in water


against the lee rail, Mr. Armitage cast of the staysail sheet. The
heavy triangular canvas slatted in the wind, the sheet block flogging
to and fro in a manner that resisted all attempts on the part of the
Scoutmaster to secure it. The while the sail was making a noise like
the cracking of a gigantic whip.

Relieved of the tremendous pressure, the Rosalie recovered from


her dangerous list, but it was not until Mr. Armitage, assisted by
Stratton and Roche, who had followed him on deck, had lowered
and stowed the staysail that the yacht came up head to wind.

"That was a nasty one!" exclaimed Mr. Armitage breathlessly. "Start


the motors, Roche—sharp as you can!"

Not a little scared, the rest of the crew lowered and secured the
mainsail, while the Rosalie, under bare poles, fell broadside on to the
waves, which in a very short time had assumed huge and
threatening proportions. It was an off-shore squall, and none the
less dangerous on that account, and until Roche and Flemming got
the motors going the Rosalie had a particularly bad time.

It was raining heavily. Already the shore, although less than two
miles away, was blotted out. The wind shrieked through the rigging,
blinding showers of spray enveloped the wheel-house, and solid
masses of water pounded the heaving, slippery deck.

In ten minutes the squall was over. The sun shone brightly, and
although the waves ran high they were no longer dangerous, while
dead to windward lay the secure harbour of Harwich.

"Why didn't you luff when you saw it coming, Alan?" asked Mr.
Armitage.

"I did, sir, but she wouldn't answer," said Hepburn.

"I'm to blame," soliloquized the Scoutmaster. "That's a lesson never


to leave the deck with only a youngster in charge. I ought to have
known that the Rosalie's canvas is only an auxiliary to her motors,
and not the motors to the canvas. She's not built as a sailing-craft,
and she won't go about under sail alone. So in future I'll bear that in
mind."

Twenty minutes later the Rosalie moored alongside a barge in a


basin on the Felixstowe side of the harbour, and her crew had an
opportunity of investigating the damage.

The saloon presented a picture of utter chaos. The floor was


literally paved with fragments of crockery, cemented with jam,
marmalade, and greasy gravy. On this conglomeration of debris the
cushions on the windward bunk had been hurled, together with the
contents of a bookcase which had been wrenched from its
fastenings by the abnormal list.

In the galley things were almost as bad, but the fo'c'sle came off
lightly. That was mainly owing to the methodical stowing of gear by
the lads themselves, and the few kit-bags that had been dislodged
were quickly replaced.

It was rough luck to have to set to work to clear up after a long


day's run, but the Sea Scouts tackled the job manfully and
cheerfully, and in less than an hour and a half the Rosalie 'tween
decks was reduced to a state of order.

"We were not the only craft in that squall, sir," reported Stratton.
"There's a tug coming in with two dismasted boats."

The two Scoutmasters and the rest of the Sea Scouts hurried on
deck. Passing the entrance to the basin was a fussy little steamer
towing two large "bawleys". One of the latter showed about ten feet
of mast ending in a jagged stump. The other's mast had been
snapped off close to the deck, and evidently her crew had been
compelled to cut the sails and wreckage clear. The first boat was
more fortunate, for her spars and canvas were lashed to her deck.

"Hard lines," commented Mr. Armitage; "but those fellows' plight


rather vindicates us. If two professionally-manned fishing-boats are
dismasted without warning, we were fortunate in merely being
thrown on our beam ends without losing any of our deck-gear. Now,
lads, turn in. Glass is rising slowly, and the sky's red. With luck, we'll
be in Dover to-morrow night."

CHAPTER XIII
A Find on the Gunfleet
The Scoutmaster's prognostics of a fine day were justified. Up at
dawn, the crew of the Rosalie found the sky was cloudless; not a
ripple disturbed the harbour, while the smoke from a couple of
destroyers getting up steam rose almost vertically in the still air.

The only fly in the ointment was what would be termed in


Admiralty communiqués "low visibility". Without being actually foggy,
the weather was hazy, so that from the Felixstowe side, where the
Rosalie lay, it was only just possible to discern the outlines of the
town and dockyard of Harwich.

"Morning mists," remarked optimist Roche. "It'll clear when the


sun's up properly."

"Let's hope so," added Mr. Armitage.

He had no great desire to grope his way across the Thames


estuary in thick weather, trusting to the aid of a compass to thread
his course between the numerous sand-banks. The Rosalie's
compass did not possess a deviation-card, and one or two bearings
that the Scoutmaster had already taken showed an error of from half
to one and a half points.

"Starboard's duty watch," observed Mr. Armitage, when the yacht


had drawn clear of the basin. "Stratton, you take the helm. How's
the tide?"

"One hour's flood, sir," replied the Patrol-leader promptly.

"Right-o! that will give us a chance to cut across most of the


banks," continued the Scoutmaster. "Keep her sou' by east; I'm
trying to make the N.E. Gunfleet buoy."

Clear of Harwich harbour, the Rosalie settled down on the given


compass-course. Even in the open sea the water was as smooth as
glass, but the mist showed no tendency to disperse. If anything, it
grew thicker, patches of vapour drifting slowly over the placid
surface, rendering the range of visibility a matter of anything from a
quarter to two miles.

With both engines going at easy speed—Mr. Armitage never


believed in giving the motors full throttle except in cases of necessity
—the yacht was doing a good eight and a half knots, leaving a clean
wake astern.

"Bit of a difference to the Olivette," remarked Peter Stratton to


Roche.

The latter, having finished with the engines for the time being, was
exchanging the fume-laden atmosphere of the motor-room for the
pure, early morning air of the North Sea.

"Aye," agreed Dick. "She'd be able to go up the Thames without


scooping half the water out of the river and chucking it over the
banks. And she's a clinking pair of motors—easy to start and very
little vibration. Pre-war engines," he added, with a supreme
contempt for anything built in these days of dear labour and inferior
material.

"Getting on all right?" inquired the Scoutmaster, as he entered the


wheel-house and glanced at the compass. "Steady, Peter, you're half
a point out."

"It's jolly awkward steering by compass," remarked Stratton, as he


swung the yacht back to the correct bearing.

"It is," agreed Mr. Armitage; "especially when you've no fixed


object to steer by except the lubber's line. But be careful. I don't
want to miss the North-East Gunfleet if I can help it."

By this time the low-lying Essex shore was lost in a haze. According
to the chart, the Naze was three miles away on the starboard
quarter, but as far as visibility went it might have been fifty. Not a
buoy nor another vessel was in sight. The limited horizon was
unbroken.

"It's pretty thick ahead," said the Scoutmaster, rubbing the


moisture from the lenses of his binoculars. "Keep a good look-out,
Woodleigh; we ought to be somewhere near the buoy by this time."

"Something white ahead," reported Woodleigh, who, as look-out,


was perched "in the eyes" of the yacht.

"Broken water," declared the Scoutmaster, peering through the


mist. "It's a tide-rip over the edge of the Gunfleet. We've missed the
buoy, and if we carry on we'll pile ourselves up on the sand. Port
helm, Stratton; that's right; keep her at that."

Mr. Armitage consulted the chart.

"See anything of a red lighthouse on piles, Woodleigh?" he asked.


"It ought to be in that direction."

The Sea Scout looked in the direction indicated, but could


distinguish nothing in the shape of a building.

"There's sand showing on our starboard beam, sir," he reported, as


the mist temporarily dispersed. "I can hear a dog bark."

"So can I," agreed Mr. Armitage. "A dog on board a fishing-smack,
most likely. See anything of a boat?"

"No, sir," replied the look-out.

The Scoutmaster levelled his glasses upon what looked to the


naked eye like a short, weed-covered stump on the edge of the
sands. The binoculars revealed it to be a dog sitting on its haunches
and yelping and barking dolorously.

"How did it get there, I wonder?" asked Roche.


"Lighthouse-keeper's dog, perhaps," hazarded Stratton.

"Stand in a little closer," ordered the Scoutmaster. "Give a cast with


the lead, Woodleigh."

The sounding gave six fathoms.

"Good enough," declared Mr. Armitage, again referring to the chart.


"The Gunfleet is fairly steep-to on this side. Give her half-speed,
Peter."

By means of the throttle-levers in the wheel-house speed could be


varied without the necessity for Roche to be below. At a modest four
knots the Rosalie groped her way towards the north-western edge of
the sand-bank known as the Gunfleet.

"There's the lighthouse," declared Mr. Armitage, indicating a


lobster-pot-like building perched upon several massive piles. A partial
lifting of the mist revealed its outlines a good two miles away. "If
your theory's right, Stratton, the dog stands a good chance of being
drowned before it can regain the lighthouse. The tide's making
pretty rapidly."

"We must rescue it, sir," declared Stratton.

"Certainly," agreed Mr. Armitage. "Carry on, Peter. I'll take the
wheel whilst you are gone."

There was no necessity for the Patrol-leader to turn out the port
watch. Already the "watch below" had heard the news and were on
deck.

Quickly the dinghy was cleared away, the davits swung out, and
the boat prepared for lowering. Directly the Rosalie lost way
Stratton, Warkworth, and Hepburn jumped into her. Peter steered
and the others rowed, pulling lustily at the tough ash oars until the
dinghy almost leapt through the water.

You might also like