100% found this document useful (3 votes)
12 views

Programming Logic and Design Comprehensive 6th Edition Joyce Farrelldownload

The document provides information about various ebooks available for download at ebookultra.com, including 'Programming Logic and Design Comprehensive 6th Edition' by Joyce Farrell. It lists additional recommended titles and their download links. The document also includes details about the content and structure of the 'Programming Logic and Design' textbook.

Uploaded by

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

Programming Logic and Design Comprehensive 6th Edition Joyce Farrelldownload

The document provides information about various ebooks available for download at ebookultra.com, including 'Programming Logic and Design Comprehensive 6th Edition' by Joyce Farrell. It lists additional recommended titles and their download links. The document also includes details about the content and structure of the 'Programming Logic and Design' textbook.

Uploaded by

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

Visit https://ebookultra.

com to download the full version and


browse more ebooks or textbooks

Programming Logic and Design Comprehensive 6th


Edition Joyce Farrell

_____ Press the link below to begin your download _____

https://ebookultra.com/download/programming-logic-and-
design-comprehensive-6th-edition-joyce-farrell/

Access ebookultra.com now to download high-quality


ebooks or textbooks
Here are some recommended products for you. Click the link to
download, or explore more at ebookultra.com

Java Programming 7th Edition Joyce Farrell

https://ebookultra.com/download/java-programming-7th-edition-joyce-
farrell/

Java Programming 8th Edition Joyce Farrell

https://ebookultra.com/download/java-programming-8th-edition-joyce-
farrell/

Java Programs to Accompany Programming Logic and Design


7th Edition Jo Ann Smith

https://ebookultra.com/download/java-programs-to-accompany-
programming-logic-and-design-7th-edition-jo-ann-smith/

Microsoft Visual Basic Programs to Accompany Programming


Logic and Design 3rd Edition Jo Ann Smith

https://ebookultra.com/download/microsoft-visual-basic-programs-to-
accompany-programming-logic-and-design-3rd-edition-jo-ann-smith/
Computer programming for teens 1st Edition Mary E. Farrell

https://ebookultra.com/download/computer-programming-for-teens-1st-
edition-mary-e-farrell/

Programming and Problem Solving with C Comprehensive


Comprehensive Edition Nell B. Dale

https://ebookultra.com/download/programming-and-problem-solving-with-
c-comprehensive-comprehensive-edition-nell-b-dale/

Comprehensive Gynecology 6th Edition Gretchen M Lentz

https://ebookultra.com/download/comprehensive-gynecology-6th-edition-
gretchen-m-lentz/

The Haskell Road to Logic Maths and Programming 1st


Edition Kees Doets

https://ebookultra.com/download/the-haskell-road-to-logic-maths-and-
programming-1st-edition-kees-doets/

Logic and Computer Design Fundamentals Third Edition M.


Morris Mano

https://ebookultra.com/download/logic-and-computer-design-
fundamentals-third-edition-m-morris-mano/
Programming Logic and Design Comprehensive 6th
Edition Joyce Farrell Digital Instant Download
Author(s): Joyce Farrell
ISBN(s): 0538744766
Edition: 6
File Details: PDF, 18.81 MB
Year: 2010
Language: english
PROGRAMMING LOGIC
AND DESIGN
COMPREHENSIVE
This page intentionally left blank
SIXTH EDITION

PROGRAMMING LOGIC
AND DESIGN
COMPREHENSIVE

J O Y C E FA R R E L L

Australia • Brazil • Japan • Korea • Mexico • Singapore • Spain • United Kingdom • United States
This is an electronic version of the print textbook. Due to electronic rights restrictions, some third party content may
be suppressed. Editorial review has deemed that any suppressed content does not materially affect the overall
learning experience. The publisher reserves the right to remove content from this title at any time if subsequent rights
restrictions require it. For valuable information on pricing, previous editions, changes to current editions, and
alternate formats, please visit www.cengage.com/highered to search by ISBN#, author, title, or keyword for
materials in your areas of interest.
Programming Logic and Design, © 2011 Course Technology, Cengage Learning
Comprehensive, Sixth Edition
ALL RIGHTS RESERVED. No part of this work covered by the copyright
Joyce Farrell
herein may be reproduced, transmitted, stored or used in any form or by
Executive Editor: Marie Lee any means—graphic, electronic, or mechanical, including but not limited
to photocopying, recording, scanning, digitizing, taping, Web distribution,
Acquisitions Editor: Amy Jollymore
information networks, or information storage and retrieval systems, except
Managing Editor: Tricia Coia as permitted under Section 107 or 108 of the 1976 United States Copyright
Developmental Editor: Dan Seiter Act—without the prior written permission of the publisher.
Content Project Manager: Jennifer Feltri
For product information and technology assistance, contact us at
Editorial Assistant: Zina Kresin Cengage Learning Customer & Sales Support, 1-800-354-9706
Marketing Manager: Bryant Chrzan For permission to use material from this text or product,
Art Director: Marissa Falco submit all requests online at cengage.com/permissions
Further permissions questions can be emailed to
Text Designer: Shawn Girsberger [email protected]
Cover Designer: Cabbage Design Company
Cover Image: iStockphoto Library of Congress Control Number: 2009938501
Print Buyer: Julio Esperas
ISBN-13: 978-0-5387-4476-8
Copy Editor: Michael Beckett
ISBN-10: 0-538-74476-6
Proofreader: Vicki Zimmer
Indexer: Alexandra Nickerson Course Technology
Compositor: Integra 20 Channel Center Street
Boston, MA 02210
USA

Some of the product names and company names used in this book have
been used for identification purposes only and may be trademarks or
registered trademarks of their respective manufacturers and sellers.

Course Technology, a part of Cengage Learning, reserves the right to revise


this publication and make changes from time to time in its content without
notice.

Cengage Learning is a leading provider of customized learning solutions with


office locations around the globe, including Singapore, the United Kingdom,
Australia, Mexico, Brazil, and Japan. Locate your local office at:
www.cengage.com/global

Cengage Learning products are represented in Canada by


Nelson Education, Ltd.

To learn more about Course Technology, visit


www.cengage.com/coursetechnology

Purchase any of our products at your local college store or at our preferred
online store www.ichapters.com

Printed in Canada
1 2 3 4 5 6 7 14 13 12 11 10
Brief Contents
v

Pref ace . . . . . . . . . . . . . . . . . xvi


CHAPTER 1 An Overview of Computers and Programming . . 1
CHAP TER 2 Wo r k in g wi t h Data, Creati ng Modul es,
an d Des ig ni ng Hi gh- Qual i ty Programs . . . . 41
CHAP TER 3 U n der s t an di ng Structure . . . . . . . . . . 92
CHAP TER 4 M ak in g De ci si o ns . . . . . . . . . . . . 133
CHAP TER 5 Lo o pin g . . . . . . . . . . . . . . . . 184
CHAP TER 6 Ar r ays . . . . . . . . . . . . . . . . . 228
CHAP TER 7 F ile Han dli ng and Appl i cati ons . . . . . . 276
CHAPTER 8 Advan ced A rray Concepts, I ndex ed Fi l es,
an d Lin k ed Li st s . . . . . . . . . . . . . 325
CHAPTER 9 Advan ced Mo dul ari zati on Techni ques . . . . 370
CHAPTER 10 Object -Or ient ed Programmi ng . . . . . . . 426
CHAPTER 11 M o re Obje ct - Ori ented Programmi ng
Co n cept s . . . . . . . . . . . . . . . . 469
CHAPTER 12 E ven t -Dr iven GUI Programmi ng,
M u lt it h readi ng , and Ani mati on . . . . . . . 515
CHAPTER 13 Sys t em M o del i ng wi th the UML . . . . . . 550
CHAPTER 14 U s in g Relat i o nal Databases . . . . . . . . 585
APPEN DIX A U n der s t andi ng Numberi ng Sy stems
an d Co m put er Codes . . . . . . . . . . . 637
APPEN DIX B F lo w ch ar t Sy m bol s . . . . . . . . . . . 646
BRIEF CONTENTS

APPEN DIX C St r u ct u res . . . . . . . . . . . . . . . 647


APPEN DIX D So lvin g Dif f icul t Structuri ng Probl ems . . . 649
APPEN DIX E Creat in g Pr int Char ts . . . . . . . . . . 658
vi APPEN DIX F Tw o Var iat io ns o n the Basi c Structures—
c a s e an d d o-while . . . . . . . . . . 660
Glo s s ar y . . . . . . . . . . . . . . . . 666
In dex . . . . . . . . . . . . . . . . . 681
Contents
vii

Pref ace . . . . . . . . . . . . . . . . . xvi

CHAP TER 1 An Over view o f Computers


an d Pro g r am m i 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 . . . . . . . . . . . . 14
Maintaining the Program . . . . . . . . . . . . . . . . . 14
Using Pseudocode Statements and Flowchart Symbols . . . . 15
Writing Pseudocode . . . . . . . . . . . . . . . . . . . 15
Drawing Flowcharts . . . . . . . . . . . . . . . . . . . 17
Repeating Instructions . . . . . . . . . . . . . . . . . . 18
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
Review Questions . . . . . . . . . . . . . . . . . . . . . 32
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . 37

CHAP TER 2 Wo r k in g w i t h Data, Creati ng Modul es,


an d Des igni ng Hi gh- Qual i ty Programs . . . . . . 41
Declaring and Using Variables and Constants . . . . . . . . . 42
CONTENTS

Working with Variables . . . . . . . . . . . . . . . . . . 42


Naming Variables . . . . . . . . . . . . . . . . . . . . 44
Understanding Unnamed, Literal Constants
and their Data Types . . . . . . . . . . . . . . . . . . 45
Understanding the Data Types of Variables . . . . . . . . . 46
viii
Declaring Named Constants. . . . . . . . . . . . . . . . 47
Assigning Values to Variables . . . . . . . . . . . . . . . . 48
Performing Arithmetic Operations . . . . . . . . . . . . . 49
Understanding the Advantages of Modularization . . . . . . . 52
Modularization Provides Abstraction . . . . . . . . . . . . 53
Modularization Allows Multiple Programmers
to Work on a Problem . . . . . . . . . . . . . . . . . . 54
Modularization Allows You to Reuse Your Work . . . . . . . 54
Modularizing a Program . . . . . . . . . . . . . . . . . . 55
Declaring Variables and Constants
within Modules . . . . . . . . . . . . . . . . . . . . . 59
Understanding the Most Common Configuration
for Mainline Logic . . . . . . . . . . . . . . . . . . . . 61
Creating Hierarchy Charts . . . . . . . . . . . . . . . . . 66
Features of Good Program Design . . . . . . . . . . . . . . 68
Using Program Comments . . . . . . . . . . . . . . . . 69
Choosing Identifiers . . . . . . . . . . . . . . . . . . . 71
Designing Clear Statements. . . . . . . . . . . . . . . . 72
Writing Clear Prompts and Echoing Input . . . . . . . . . . 74
Maintaining Good Programming Habits . . . . . . . . . . . 76
Chapter Summary . . . . . . . . . . . . . . . . . . . . . 77
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . 78
Review Questions . . . . . . . . . . . . . . . . . . . . . 82
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . 86

CHAPTER 3 U n der s t an ding St ructure . . . . . . . . . . 92


Understanding Unstructured Spaghetti Code . . . . . . . . . 93
Understanding the Three Basic Structures . . . . . . . . . . 95
Using a Priming Input to Structure a Program . . . . . . . 103
Understanding the Reasons for Structure . . . . . . . . . 110
Recognizing Structure . . . . . . . . . . . . . . . . . . 111
Structuring and Modularizing Unstructured Logic . . . . . . 115
Chapter Summary . . . . . . . . . . . . . . . . . . . . 121
Key Terms . . . . . . . . . . . . . . . . . . . . . . . 122
Review Questions . . . . . . . . . . . . . . . . . . . . 123
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 127
CONTENTS

CHAP TER 4 M ak in g Deci si o ns . . . . . . . . . . . . 133


Evaluating Boolean Expressions to Make Comparisons . . . 134
Using Relational Comparison Operators . . . . . . . . . . 137
Avoiding a Common Error with Relational Operators . . . . 141
Understanding AND Logic . . . . . . . . . . . . . . . . 141
Nesting AND Decisions for Efficiency . . . . . . . . . . 144 ix
Using the AND Operator . . . . . . . . . . . . . . . . 146
Avoiding Common Errors in an AND Selection. . . . . . . 148
Understanding OR Logic . . . . . . . . . . . . . . . . . 150
Writing OR Decisions for Efficiency . . . . . . . . . . . 152
Using the OR Operator . . . . . . . . . . . . . . . . . 153
Avoiding Common Errors in an OR Selection . . . . . . . 155
Making Selections within Ranges . . . . . . . . . . . . . 159
Avoiding Common Errors When Using Range Checks . . . 162
Understanding Precedence When Combining
AND and OR Operators . . . . . . . . . . . . . . . . . 166
Chapter Summary . . . . . . . . . . . . . . . . . . . . 169
Key Terms . . . . . . . . . . . . . . . . . . . . . . . 170
Review Questions . . . . . . . . . . . . . . . . . . . . 171
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 177

CHAP TER 5 Lo o pin g . . . . . . . . . . . . . . . . 184


Understanding the Advantages of Looping . . . . . . . . . 185
Using a Loop Control Variable. . . . . . . . . . . . . . . 186
Using a Definite Loop with a Counter . . . . . . . . . . 187
Using an Indefinite Loop with a Sentinel Value . . . . . . 188
Understanding the Loop in a Program’s Mainline Logic. . . 190
Nested Loops . . . . . . . . . . . . . . . . . . . . . . 192
Avoiding Common Loop Mistakes . . . . . . . . . . . . . 196
Mistake: Neglecting to Initialize the
Loop Control Variable . . . . . . . . . . . . . . . . . 197
Mistake: Neglecting to Alter the
Loop Control Variable . . . . . . . . . . . . . . . . . 198
Mistake: Using the Wrong Comparison with the
Loop Control Variable . . . . . . . . . . . . . . . . . 200
Mistake: Including Statements Inside the Loop
that Belong Outside the Loop . . . . . . . . . . . . . 201
Using a for Loop . . . . . . . . . . . . . . . . . . . . 206
Common Loop Applications . . . . . . . . . . . . . . . . 208
Using a Loop to Accumulate Totals . . . . . . . . . . . 208
Using a Loop to Validate Data . . . . . . . . . . . . . . 211
Limiting a Reprompting Loop . . . . . . . . . . . . . . 213
CONTENTS

Validating a Data Type . . . . . . . . . . . . . . . . . 215


Validating Reasonableness and Consistency of Data . . . . 216
Chapter Summary . . . . . . . . . . . . . . . . . . . . 217
Key Terms . . . . . . . . . . . . . . . . . . . . . . . 218
Review Questions . . . . . . . . . . . . . . . . . . . . 219
x
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 223

CHAPTER 6 Ar r ays . . . . . . . . . . . . . . . . . 228


Understanding Arrays and How They Occupy
Computer Memory . . . . . . . . . . . . . . . . . . . 229
How Arrays Occupy Computer Memory . . . . . . . . . . 229
Manipulating an Array to Replace Nested Decisions . . . . . 232
Using Constants with Arrays . . . . . . . . . . . . . . . 240
Using a Constant as the Size of an Array . . . . . . . . . 240
Using Constants as Array Element Values . . . . . . . . 241
Using a Constant as an Array Subscript . . . . . . . . . 241
Searching an Array . . . . . . . . . . . . . . . . . . . 242
Using Parallel Arrays . . . . . . . . . . . . . . . . . . . 246
Improving Search Efficiency. . . . . . . . . . . . . . . 251
Searching an Array for a Range Match . . . . . . . . . . . 254
Remaining within Array Bounds . . . . . . . . . . . . . . 258
Using a for Loop to Process Arrays . . . . . . . . . . . 261
Chapter Summary . . . . . . . . . . . . . . . . . . . . 262
Key Terms . . . . . . . . . . . . . . . . . . . . . . . 263
Review Questions . . . . . . . . . . . . . . . . . . . . 264
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 268

CHAPTER 7 F ile Han dlin g and Appl i cati ons . . . . . . 276


Understanding Computer Files . . . . . . . . . . . . . . 277
Organizing Files . . . . . . . . . . . . . . . . . . . . 278
Understanding the Data Hierarchy . . . . . . . . . . . . . 279
Performing File Operations . . . . . . . . . . . . . . . . 280
Declaring a File . . . . . . . . . . . . . . . . . . . . 280
Opening a File . . . . . . . . . . . . . . . . . . . . . 281
Reading Data From a File . . . . . . . . . . . . . . . . 281
Writing Data to a File . . . . . . . . . . . . . . . . . . 283
Closing a File . . . . . . . . . . . . . . . . . . . . . 283
A Program that Performs File Operations . . . . . . . . . 283
Understanding Sequential Files and Control Break Logic . . . 286
Understanding Control Break Logic . . . . . . . . . . . 287
Merging Sequential Files . . . . . . . . . . . . . . . . . 293
Master and Transaction File Processing . . . . . . . . . . 303
CONTENTS

Random Access Files . . . . . . . . . . . . . . . . . . 311


Chapter Summary . . . . . . . . . . . . . . . . . . . . 313
Key Terms . . . . . . . . . . . . . . . . . . . . . . . 314
Review Questions . . . . . . . . . . . . . . . . . . . . 316
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 320
xi
CHAP TER 8 Advan ced A rray Concepts, I ndex ed Fi l es,
an d Lin k ed Li st s . . . . . . . . . . . . . 325
Understanding the Need for Sorting Records . . . . . . . . 326
Understanding How to Swap Two Values . . . . . . . . . . 327
Using a Bubble Sort . . . . . . . . . . . . . . . . . . . 329
Sorting a List of Variable Size . . . . . . . . . . . . . . 337
Refining the Bubble Sort to Reduce Unnecessary
Comparisons. . . . . . . . . . . . . . . . . . . . . 341
Refining the Bubble Sort to Eliminate Unnecessary
Passes . . . . . . . . . . . . . . . . . . . . . . . 343
Other Sorts . . . . . . . . . . . . . . . . . . . . . . 345
Using Multidimensional Arrays . . . . . . . . . . . . . . 345
Using Indexed Files and Linked Lists. . . . . . . . . . . . 352
Using Indexed Files . . . . . . . . . . . . . . . . . . 352
Using Linked Lists . . . . . . . . . . . . . . . . . . . 354
Chapter Summary . . . . . . . . . . . . . . . . . . . . 357
Key Terms . . . . . . . . . . . . . . . . . . . . . . . 358
Review Questions . . . . . . . . . . . . . . . . . . . . 359
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 364

CHAPTER 9 Advan ced Mo dul ari zati on Techni ques . . . . 370


Using Methods with No Parameters . . . . . . . . . . . . 371
Creating Methods that Require a Single Parameter . . . . . 374
Creating Methods that Require Multiple Parameters . . . . . 379
Creating Methods that Return a Value . . . . . . . . . . . 381
Using an IPO Chart . . . . . . . . . . . . . . . . . . . 387
Passing an Array to a Method . . . . . . . . . . . . . . . 388
Overloading Methods. . . . . . . . . . . . . . . . . . . 395
Avoiding Ambiguous Methods . . . . . . . . . . . . . . . 398
Using Predefined Methods . . . . . . . . . . . . . . . . 401
Method Design Issues: Implementation Hiding, Cohesion,
and Coupling . . . . . . . . . . . . . . . . . . . . . 403
Understanding Implementation Hiding . . . . . . . . . . 403
Increasing Cohesion . . . . . . . . . . . . . . . . . . 404
Reducing Coupling . . . . . . . . . . . . . . . . . . . 405
Understanding Recursion . . . . . . . . . . . . . . . . . 407
CONTENTS

Chapter Summary . . . . . . . . . . . . . . . . . . . . 411


Key Terms . . . . . . . . . . . . . . . . . . . . . . . 413
Review Questions . . . . . . . . . . . . . . . . . . . . 415
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 419

xii CHAPTER 10 Object -Or ient ed Programmi ng . . . . . . . 426


Principles of Object-Oriented Programming . . . . . . . . . 427
Classes and Objects . . . . . . . . . . . . . . . . . . 427
Polymorphism . . . . . . . . . . . . . . . . . . . . . 430
Inheritance . . . . . . . . . . . . . . . . . . . . . . 431
Encapsulation . . . . . . . . . . . . . . . . . . . . . 432
Defining Classes and Creating Class Diagrams . . . . . . . 433
Creating Class Diagrams . . . . . . . . . . . . . . . . 435
The Set Methods . . . . . . . . . . . . . . . . . . . . 438
The Get Methods. . . . . . . . . . . . . . . . . . . . 440
Work Methods . . . . . . . . . . . . . . . . . . . . . 440
Understanding Public and Private Access . . . . . . . . . 442
Organizing Classes . . . . . . . . . . . . . . . . . . . 446
Understanding Instance Methods . . . . . . . . . . . . . 447
Understanding Static Methods . . . . . . . . . . . . . . 453
Using Objects . . . . . . . . . . . . . . . . . . . . . . 455
Chapter Summary . . . . . . . . . . . . . . . . . . . . 459
Key Terms . . . . . . . . . . . . . . . . . . . . . . . 460
Review Questions . . . . . . . . . . . . . . . . . . . . 462
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 466

CHAPTER 11 M o re Object - Ori ented Programmi ng


Co n cept s . . . . . . . . . . . . . . . . 469
An Introduction to Constructors . . . . . . . . . . . . . . 470
Constructors with Parameters . . . . . . . . . . . . . . 473
Overloading Class Methods and Constructors. . . . . . . 473
Understanding Destructors . . . . . . . . . . . . . . . . 476
Understanding Composition . . . . . . . . . . . . . . . . 478
Understanding Inheritance . . . . . . . . . . . . . . . . 479
Understanding Inheritance Terminology . . . . . . . . . 481
Accessing Private Members of a Parent Class . . . . . . 484
Using Inheritance to Achieve Good Software Design . . . . 490
One Example of Using Predefined Classes:
Creating GUI Objects . . . . . . . . . . . . . . . . . . 491
Understanding Exception Handling. . . . . . . . . . . . . 493
Drawbacks to Traditional Error-Handling Techniques . . . . 493
The Object-Oriented Exception Handling Model . . . . . . 495
CONTENTS

Using Built-in Exceptions and Creating Your Own


Exceptions. . . . . . . . . . . . . . . . . . . . . . 498
Reviewing the Advantages of Object-Oriented
Programming . . . . . . . . . . . . . . . . . . . . . 499
Chapter Summary . . . . . . . . . . . . . . . . . . . . 500
Key Terms . . . . . . . . . . . . . . . . . . . . . . . 502 xiii
Review Questions . . . . . . . . . . . . . . . . . . . . 503
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 508

CHAPTER 12 E ven t -Dr iven GUI Programmi ng,


M u lt it h readi ng , and Ani mati on . . . . . . . 515
Understanding Event-Driven Programming . . . . . . . . . 516
User-Initiated Actions and GUI Components. . . . . . . . . 519
Designing Graphical User Interfaces . . . . . . . . . . . . 523
The Interface Should Be Natural and Predictable . . . . . 523
The Interface Should Be Attractive, Easy to Read, and
Nondistracting . . . . . . . . . . . . . . . . . . . . 524
To Some Extent, It’s Helpful If the User Can
Customize Your Applications. . . . . . . . . . . . . . 524
The Program Should Be Forgiving . . . . . . . . . . . . 525
The GUI Is Only a Means to an End . . . . . . . . . . . 525
The Steps to Developing an Event-Driven Application . . . . 526
Creating Storyboards. . . . . . . . . . . . . . . . . . 527
Defining the Storyboard’s Objects in
an Object Dictionary . . . . . . . . . . . . . . . . . 527
Defining Connections Between the User Screens . . . . . 528
Planning the Logic . . . . . . . . . . . . . . . . . . . 529
Understanding Multithreading . . . . . . . . . . . . . . . 535
Creating Animation. . . . . . . . . . . . . . . . . . . . 537
Chapter Summary . . . . . . . . . . . . . . . . . . . . 540
Key Terms . . . . . . . . . . . . . . . . . . . . . . . 541
Review Questions . . . . . . . . . . . . . . . . . . . . 542
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 546

CHAPTER 13 Sys t em M o del i ng wi th the UML . . . . . . 550


Understanding the Need for System Modeling . . . . . . . 551
What is the UML? . . . . . . . . . . . . . . . . . . . . 552
Using Use Case Diagrams . . . . . . . . . . . . . . . . 554
Using Class and Object Diagrams . . . . . . . . . . . . . 560
Using Sequence and Communication Diagrams . . . . . . . 564
Using State Machine Diagrams . . . . . . . . . . . . . . 566
Using Activity Diagrams . . . . . . . . . . . . . . . . . 567
Exploring the Variety of Random
Documents with Different Content
INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.

1.F.5. Some states do not allow disclaimers of certain implied


warranties or the exclusion or limitation of certain types of damages.
If any disclaimer or limitation set forth in this agreement violates the
law of the state applicable to this agreement, the agreement shall be
interpreted to make the maximum disclaimer or limitation permitted
by the applicable state law. The invalidity or unenforceability of any
provision of this agreement shall not void the remaining provisions.

1.F.6. INDEMNITY - You agree to indemnify and hold the Foundation,


the trademark owner, any agent or employee of the Foundation,
anyone providing copies of Project Gutenberg™ electronic works in
accordance with this agreement, and any volunteers associated with
the production, promotion and distribution of Project Gutenberg™
electronic works, harmless from all liability, costs and expenses,
including legal fees, that arise directly or indirectly from any of the
following which you do or cause to occur: (a) distribution of this or
any Project Gutenberg™ work, (b) alteration, modification, or
additions or deletions to any Project Gutenberg™ work, and (c) any
Defect you cause.

Section 2. Information about the Mission


of Project Gutenberg™
Project Gutenberg™ is synonymous with the free distribution of
electronic works in formats readable by the widest variety of
computers including obsolete, old, middle-aged and new computers.
It exists because of the efforts of hundreds of volunteers and
donations from people in all walks of life.

Volunteers and financial support to provide volunteers with the


assistance they need are critical to reaching Project Gutenberg™’s
goals and ensuring that the Project Gutenberg™ collection will
remain freely available for generations to come. In 2001, the Project
Gutenberg Literary Archive Foundation was created to provide a
secure and permanent future for Project Gutenberg™ and future
generations. To learn more about the Project Gutenberg Literary
Archive Foundation and how your efforts and donations can help,
see Sections 3 and 4 and the Foundation information page at
www.gutenberg.org.

Section 3. Information about the Project


Gutenberg Literary Archive Foundation
The Project Gutenberg Literary Archive Foundation is a non-profit
501(c)(3) educational corporation organized under the laws of the
state of Mississippi and granted tax exempt status by the Internal
Revenue Service. The Foundation’s EIN or federal tax identification
number is 64-6221541. Contributions to the Project Gutenberg
Literary Archive Foundation are tax deductible to the full extent
permitted by U.S. federal laws and your state’s laws.

The Foundation’s business office is located at 809 North 1500 West,


Salt Lake City, UT 84116, (801) 596-1887. Email contact links and up
to date contact information can be found at the Foundation’s website
and official page at www.gutenberg.org/contact

Section 4. Information about Donations to


the Project Gutenberg Literary Archive
Foundation
Project Gutenberg™ depends upon and cannot survive without
widespread public support and donations to carry out its mission of
increasing the number of public domain and licensed works that can
be freely distributed in machine-readable form accessible by the
widest array of equipment including outdated equipment. Many
small donations ($1 to $5,000) are particularly important to
maintaining tax exempt status with the IRS.

The Foundation is committed to complying with the laws regulating


charities and charitable donations in all 50 states of the United
States. Compliance requirements are not uniform and it takes a
considerable effort, much paperwork and many fees to meet and
keep up with these requirements. We do not solicit donations in
locations where we have not received written confirmation of
compliance. To SEND DONATIONS or determine the status of
compliance for any particular state visit www.gutenberg.org/donate.

While we cannot and do not solicit contributions from states where


we have not met the solicitation requirements, we know of no
prohibition against accepting unsolicited donations from donors in
such states who approach us with offers to donate.

International donations are gratefully accepted, but we cannot make


any statements concerning tax treatment of donations received from
outside the United States. U.S. laws alone swamp our small staff.

Please check the Project Gutenberg web pages for current donation
methods and addresses. Donations are accepted in a number of
other ways including checks, online payments and credit card
donations. To donate, please visit: www.gutenberg.org/donate.

Section 5. General Information About


Project Gutenberg™ electronic works
Professor Michael S. Hart was the originator of the Project
Gutenberg™ concept of a library of electronic works that could be
freely shared with anyone. For forty years, he produced and
distributed Project Gutenberg™ eBooks with only a loose network of
volunteer support.
Project Gutenberg™ eBooks are often created from several printed
editions, all of which are confirmed as not protected by copyright in
the U.S. unless a copyright notice is included. Thus, we do not
necessarily keep eBooks in compliance with any particular paper
edition.

Most people start at our website which has the main PG search
facility: www.gutenberg.org.

This website includes information about Project Gutenberg™,


including how to make donations to the Project Gutenberg Literary
Archive Foundation, how to help produce our new eBooks, and how
to subscribe to our email newsletter to hear about new eBooks.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookultra.com

You might also like