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

Starting Out with C++: Early Objects 9th Edition by Tony Gaddis (eBook PDF) instant download

The document provides information about the eBook 'Starting Out with C++: Early Objects 9th Edition' by Tony Gaddis, available for download in PDF format. It includes a comprehensive table of contents outlining various chapters covering topics such as programming basics, functions, classes, and object-oriented programming. Additional links to other related eBooks by the same author are also provided.

Uploaded by

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

Starting Out with C++: Early Objects 9th Edition by Tony Gaddis (eBook PDF) instant download

The document provides information about the eBook 'Starting Out with C++: Early Objects 9th Edition' by Tony Gaddis, available for download in PDF format. It includes a comprehensive table of contents outlining various chapters covering topics such as programming basics, functions, classes, and object-oriented programming. Additional links to other related eBooks by the same author are also provided.

Uploaded by

popliruncki6
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 47

Starting Out with C++: Early Objects 9th Edition

by Tony Gaddis (eBook PDF) install download

https://ebookluna.com/product/starting-out-with-c-early-
objects-9th-edition-by-tony-gaddis-ebook-pdf/

Download more ebook from https://ebookluna.com


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

(eBook PDF) Starting Out with Java Early Objects 6th


Edition by Tony Gaddis

https://ebookluna.com/product/ebook-pdf-starting-out-with-java-early-
objects-6th-edition-by-tony-gaddis/

ebookluna.com

(eBook PDF) Starting Out with C++: Early Objects 9th


Edition

https://ebookluna.com/product/ebook-pdf-starting-out-with-c-early-
objects-9th-edition/

ebookluna.com

Starting out with Visual C# 4th Edition by Tony Gaddis


(eBook PDF)

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

ebookluna.com

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


Tony Gaddis

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

ebookluna.com
(eBook PDF) Starting Out With Visual Basic 8th Edition by
Tony Gaddis

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

ebookluna.com

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


Tony Gaddis

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

ebookluna.com

(eBook PDF) Starting Out with Java: Early Objects 5th


Edition

https://ebookluna.com/product/ebook-pdf-starting-out-with-java-early-
objects-5th-edition/

ebookluna.com

(eBook PDF) Starting Out with C++ from Control Structures


to Objects 9th Edition

https://ebookluna.com/product/ebook-pdf-starting-out-with-c-from-
control-structures-to-objects-9th-edition/

ebookluna.com

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


Edition Tony Gaddis - eBook PDF

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

ebookluna.com
start·ng out wi h >>>

EARLY OBJECTS
T DIT ON
"

Preface xv

Chapter 1 Introduction to Computers and Programming 1


Chapter 2 Introduction to C++ 27
Chapter 3 Expressions and Interactivity 77
Chapter 4 Making Decisions 155
Chapter 5 Looping 243
Chapter 6 Functions 323
Chapter 7 Introduction to Classes and Objects 407
Chapter 8 Arrays 507
Chapter 9 Searching, Sorting , and Algorithm Analysis 603
Chapter 10 Pointers 645
Chapter 11 More about Classes and Object -Oriented Programming 703
Chapter 12 More on ( -Strings and the string Class 815
Chapter 13 Advanced File and 1/ 0 Operations 853
Chapter 14 Recursion 915
Chapter 15 Polymorphism and Virtual Functions 949
Chapter 16 Exceptions, Templates, and the Standard Template Library (STL) 987
Chapter 17 Linked Lists 103 7
Chapter 18 Stacks and Queues 1085
Chapter 19 Binary Trees 1125

Appendix A: The ASCII Character Set 1155


Appendix B: Operator Precedence and Associativity 1159
Appendix C: Answers to Checkpoints 1161
Appendix D: Answers to Odd -Numbered Review Questions 1201
Index 1221

V
This page intentionally left blank
Preface xv

CHAPTER 1 Introduction to Computers and Programming 1

1.1 Why Program? 1


1.2 Computer Systems: Hardware and Software 3
1.3 Programs and Programming Languages 8
1.4 What Is a Program Made of? 13
1.5 Input, Processing, and Output 17
1.6 The Programming Process 18
1.7 Tying It All Together: Hi! It 's Me 23

CHAPTER 2 Introduction to C++ 27

2.1 The Parts of a C++ Program 2 7


2.2 The cout Object 31
2.3 The# i ncludeDirect ive 36
2.4 Variables and the Assignment Statement 37
2.5 Literals 39
2.6 Identifiers 41
2.7 Integer Data Types 43
2.8 Floating-Point Data Types 48
2.9 The char Data Type 52
2.10 TheC++str i ngClass 56
2.11 The bool Data Type 57
2.12 Determining the Size of a Data Type 58
2.13 More on Variable Assignments and Initialization 59
2.14 Scope 61
2.15 Arithmetic Operators 62
2.16 Comments 66
2.17 Programming Style 67
2.18 Tying It All Together: Smile! 69
vii
v iii Contents

CHAPTER 3 Expressions and Interactivity 77


3 .1 ThecinObject 77
3 .2 Mathematical Expressions 84
3 .3 Data Type Conversion and Type Casting 92
3.4 Overflow and Underflow 98
3 .5 Named Constants 99
3 .6 Multiple and Combined Assignment 102
3 .7 Formatting Output 106
3 .8 Working with Characters and Strings 116
3 .9 More Mathematical Library Functions 130
3 .10 Random Numbers 132
3 .11 Focus on Debugging: Hand Tracing a Program 136
3 .12 Green Fields Landscaping Case Study- Part 1 138
3 .13 Tying It All Together: Word Game 141

CHAPTER 4 Making Decisions 155

4.1 Relational Operators 155


4.2 The if Statement 161
4.3 Theif/elseStatement 170
4.4 The if /else if Statement 175
4.5 Menu-Driven Programs 183
4.6 Nested i f Statements 185
4.7 Logical Operators 189
4.8 Validating User Input 198
4.9 More about Blocks and Scope 200
4.10 More about Characters and Strings 203
4.11 The Conditional Operator 209
4.12 The switch Statement 213
4.13 Enumerated Data Types 222
4.14 Focus on Testing and Debugging: Validating Output Results 225
4.15 Green Fields Landscaping Case Study- Part 2 227
4.16 Tying It All Together: Fortune Teller 232

CHAPTER 5 Looping 243

5 .1 Introduction to Loops: The whi le Loop 243


5 .2 Using the while Loop for Input Validation 250
5.3 The Increment and Decrement Operators 253
5.4 Counters 258
5 .5 Keeping a Running Total 260
5 .6 Sentinels 263
5 .7 The do-while Loop 265
Contents ix

5 .8 The for Loop 271


5 .9 Focus on Software Engineering: Deciding Which Loop to Use 277
5 .10 Nested Loops 279
5 .11 Breaking Out of a Loop 281
5 .12 Using Files for Data Storage 285
5 .13 Focus on Testing and Debugging: Creating Good Test Data 301
5 .14 Central Mountain Credit Union Case Study 304
5 .15 Tying It All Together: What a Colorful World 308

CHAPTER 6 Function s 323

6.1 Modular Programming 323


6.2 Defining and Calling Functions 324
6.3 Function Prototypes 332
6.4 Sending Data into a Function 333
6.5 Passing Data by Value 338
6.6 The return Statement 342
6.7 Returning a Value from a Function 343
6.8 Returning a Boolean Value 349
6.9 Using Functions in a Menu-Driven Program 351
6.10 Local and Global Variables 355
6.11 Static Local Variables 362
6.12 Default Arguments 364
6.13 Using Reference Variables as Parameters 368
6.14 Overloading Functions 378
6.15 The exit() Function 382
6.16 Stubs and Drivers 385
6.17 LittleLottoCaseStudy 387
6.18 Tying It All Together: Glowing Jack-o-lantern 392

CHAPTER 7 Introduction to Classes and Objects 407

7.1 Abstract Data Types 407


7.2 Object-Oriented Programming 409
7.3 Introduction to Classes 411
7.4 Creating and Using Objects 414
7.5 Defining Member Functions 416
7.6 Constructors 423
7.7 Destructors 429
7.8 Private Member Functions 432
7.9 Passing Objects to Functions 435
7.10 Object Composition 442
7.11 Focus on Software Engineering: Separating Class Specification, Implementation ,
and Client Code 446
x Contents

7.12 Structures 453


7.13 More about Enumerated Data Types 465
7.14 Home Software Company OOP Case Study 469
7.15 Introduction to Object-Oriented Analysis and
Design 476
7.16 Screen Contro l 486
7.17 Tying It All Together: Yoyo Animation 491

CHAPTER 8 Arrays 507

8.1 Arrays H old Multiple Values 507


8.2 Accessing Array Elements 509
8.3 Inputting and Displaying Array Data 511
8.4 Array Initialization 518
8.5 The Range-Based for loop 525
8.6 Processing Array Contents 528
8.7 Using Parallel Arrays 539
8.8 The typede f Statement 543
8.9 Arrays as Function Arguments 543
8.10 Two-Dimensional Arrays 553
8.11 Arrays with Three or More Dimensions 560
8.12 Vectors 563
8.13 Arrays of Objects 575
8.14 National Commerce Bank Case Study 585
8.15 Tying It All Together: Rock, Paper, Scissors 587

CHAPTER 9 Searching, Sorting , and Algorithm Analysis 603

9 .1 Introduction to Search Algorithms 603


9.2 Searching an Array of Objects 610
9.3 Introduction to Sorting Algorithms 613
9.4 Sorting an Array of Objects 621
9.5 Sorting and Searching Vectors 624
9.6 Introduction to Analysis of Algorithms 627
9.7 Case Studies 635
9.8 Tying It All Together: Secret Messages 635

CHAPTER 10 Pointers 645


10.1 Pointers and the Address Operator 645
10.2 Pointer Variables 647
10.3 The Relationship Between Arrays and
Pointers 651
Contents xi

10.4 Pointer Arithmetic 655


10.5 Initializing Pointers 656
10.6 Comparing Pointers 659
10. 7 Pointers as Funct ion Parameters 661
10.8 Pointers to Constants and Constant Pointers 665
10.9 Focus on Software Engineering: Dynamic Memory
Allocation 670
10.10 Focus on Software Engineering: Returning Pointers from
Functions 674
10.11 Pointers to Class Objects and Structures 680
10.12 Focus on Software Engineering: Selecting Members
of Objects 684
10.13 Smart Pointers 686
10.14 Tying It All Together: Pardon Me, Do You Have the Time? 694

CHAPTER 11 More about Classes and Object -Oriented Programming 703

11.1 The th is Pointer and Constant Member Functions 703


11.2 Static Members 708
11.3 Friends of Classes 715
11.4 Memberwise Assignment 720
11.5 Copy Constructors 721
11.6 Operator Overloading 730
11.7 Rvalue References and Move Operations 751
11.8 Function Objects and Lambda Expressions 761
11.9 Type Conversion Operators 770
11.10 Convert Constructors 773
11.11 Aggregation and Composition 776
11.12 Inheritance 782
11.13 Protected Members and Class Access 787
11.14 Constructors, Destructors, and Inheritance 792
11.15 Overr iding Base Class Functions 797
11.16 Tying It All Together: Putting Data on the World Wide Web 800

CHAPTER 12 More on C-Strings and the s t ring Class 815

12.1 C-Strings 815


12.2 Library Functions for Working with C-Strings 820
12.3 Conversions Between Numbers and Strings 829
12.4 Writing Your Own C-String Handling Functions 833
12.5 More about the C++ str i ng Class 839
12.6 Advanced Software Enterprises Case Study 842
12.7 Tying It All Together: Program Execution Environments 844
xii Contents

CHAPTER13 Advanced File and 1/ 0 Operations 853

13.1 Input and Output Streams 853


13.2 More Detailed Error Testing 861
13.3 Member Functions for Reading and Writing Files 865
13.4 Binary Files 877
13.5 Creating Records with Structures 881
13.6 Random -Access Files 886
13. 7 Opening a File for Both Input and Output 893
13.8 Online Friendship Connections Case Study: Object Serialization 898
13.9 Tying It All Together : File Merging and Color-Coded HTML 903

CHAPTER14 Recursion 915

14.1 Intr oduct ion to Recursion 915


14.2 The Recursive Factorial Function 922
14.3 The Recursive gcd Function 924
14.4 Solving Recursively Defined Problems 925
14.5 A Recursive Binary Search Function 927
14.6 Focus on Problem Solving and Program Design: The QuickSort Algorithm 929
14.7 The Towersof Hano i 933
14.8 Focus on Problem Solving: Exhaustive and Enumeration Algorithms 936
14.9 Focus on Software Engineering: Recursion versus Iteration 940
14.10 Tying It All Together : Infix and Prefix Expressions 941

CHAPTER15 Polymorphism and Virtual Functions 949


15.1 Type Compatibi lity in Inheritance Hierarchies 949
15.2 Polymorp hism and Virtual Member Functions 955
15.3 Abstract Base Classes and Pure Virtual Functions 963
15.4 Focus on Object -Oriented Programming : Composition versus Inheritance 969
15.5 Secure Encryption Systems, Inc., Case Study 973
15.6 Tying It All Together : Let's Move It 976

CHAPTER16 Exceptions, Templates, and the Standard Template Library


(STL) 987
16 .1 Exceptions 987
16.2 Function Templates 999
16.3 Class Templates 1007
16.4 Class Templates and Inheritance 1012
16.5 Intr oduct ion to the Standard Templat e Library 1016
16.6 Tying It All Together : Word Transformers Game 1029
Contents x iii

CHAPTER 17 Linked Lists 1037

17.1 Introduction to the Linked List ADT 1037


17.2 Linked List Operations 1043
17.3 A Linked List Template 1055
17.4 Recursive Linked List Operations 1059
17.5 Variations of the Linked List 1067
17.6 The STL list Container 1068
17. 7 Reliable Software Systems, Inc., Case Study 1071
17.8 Tying It All Together: More on Graphics and Animation 1074

CHAPTER 18 Stacks and Queues 1085

18.1 Introduction to the Stack ADT 1085


18.2 Dynamic Stacks 1093
18.3 The STL stack Container 1097
18.4 Introduction to the Queue ADT 1099
18.5 Dynamic Queues 1106
18.6 The STL deque and queue Containers 1109
18.7 Focus on Problem Solving and Program Design: Eliminating Recursion 1112
18.8 Tying It All Together: Converting Postfix Expressions to Infix 1117

CHAPTER 19 Binary Trees 1125

19.1 Definition and Applications of Binary Trees 1125


19.2 Binary Search Tree Operations 1129
19.3 Template Considerations for Binary Search Trees 1145
19.4 Tying It All Together: Genealogy Trees 1145

Appendix A: The ASCII Character Set 1155


Appendix B: Operator Precedence and Associativity 1159
Appendix C: Answers to Checkpoints 1161
Appendix D: Answers to Odd -Numbered Review Questions 1201
Index 1221
xi v Contents

Additional Appendices
The following append ices are located on the book's compan ion web site.

Appendix E: A Brief Introduction to Object -Oriented Programming


Appendix F: Using UMLin Class Design
Appendix G: Multi-Source File Programs
Appendix H: Multiple and Virtual Inheritance
Appendix I: Header File and Library Function Reference
Appendix J: Namespaces
Appendix K: C++ Casts and Run-Time Type Identification
Appendix L: Passing Command Line Arguments
Appendix M: Binary Numbers and Bitwise Operations
Appendix N: Introduction to Flowcharting
Welcome to Starting Out with C++:Early Objects, 9th Edition . This book is intended
for use in a two -term or three -term C++ programming sequence, or an accelerated
one-term course. Students new to programming, as well as those with prior course work
in other languages, will find this text beneficial. The fundamentals of programming
are covered for the novice, while the details, pitfalls, and nuances of the C++ language
are explored in-depth for both the beginner and more exper ienced student . T he book
is written with clear, easy-to -understand language and it covers all the necessary
topics for an introductory programming course. T his text is rich in example programs
that are concise, practica l, and real world oriented, ensuring that the student not only
learns how to implement the features and constructs of C++, but why and when to
use them.

What's New in the Ninth Edition


The New C++ 11 Standard
C++11 is the latest standard version of the C++ language . In previous years, while the
standard was being developed, it was known as C++Ox. In August 2011, it was
approved by the International Standards Organization (ISO), and the name of the
standard was officially changed to C++l l. Most of the popular C++ compilers now
support this standard.
T he new C++ 11 standard was the primary motivat ion behind this edition, which
introduces many of the new language features. H owever, a C++11 compi ler is not
strictly required to use the book . As you progress through the book, you will see
C++ll icons in the marg ins, next to the new features that are introduced . Programs
appearing in sections that are not marked with this icon will still compi le using an
older compiler.

The C++ 11 Topics Introduced in This Edition


• The aut o key word is introduced in Chapter 2 as a way to simplify comp lex
variable definitions . This key word causes the comp iler to infer a variable's data
type from its initializat ion value.

xv
xvi Preface

• Chapter 2 also introduces the new long long i nt and unsigned long long i nt
data types and the LL literal suffix.
• Chapter 5 shows how to pass a str i ng object directly to a file stream object's
open member function, without the need to call the c_s t r () member function.
A discussion of the c_s t r () function sti ll exists for anyone using a legacy
compiler.
• Th e range -based for loop is introduced in Chapter 7 . Thi s new looping
mechanism automatically iterates over each element of an array, vector, or
other collect ion, without the need for a counter variable or a subscr ipt.
• Chapter 7 also introduces strongly typed enums.
• Chapter 8 introduces new ways to initialize variables and shows how a vec t or
can now be initialized with an initia lization list.
• Chapter 10 introduces smart pointers and provides examples of how and why to use
the new uni que_ptr and shared_ptr pointers for safely allocating and working
with dynamic memory .
• Chapter 10 also introduces the move assignment operator, and the null pt r key
word, which is now the standard way of representing a null pointer.
• Chapter 11 discusses move constructors, provides more in depth coverage of
move assignment operators, and introduces lambda expressions .
• Chapter 12 introduces new functions in the C++ 11 string library and discusses
the new overloaded to _stri ng functions for convert ing numeric values to stri ng
ob jects.
• Chapter 15 introduces and demonstrates the use of the new override key word
that helps prevent subtl e over ridin g errors and the new final key word that
prevents a virtua l member function from being overridden .
• Chapter 16 introduces the new C++ 11 functions begi n ( c) and end ( c) to specify
positions within a collection c where an operat ion shou ld begin and end.

What Else is New


This book's pedagogy and clear writing style remain the same as in the previous edition.
However, in addition to upd at ing the book to introduce the new C++l 1 standard,
many improvements have been made to make it even more student -friendly.
• Upd ated Material
Material has been upd ated throughout the book to reflect changes in technology
and in software development environments, as well as to improve clarity and
incorporate best practices in teaching introductory programming . As a resu lt,
new graphics and new or redesigned figures have been added throughout the
book where appropriate and new or impr oved sample programs have been
included in a number of chapters .
• New Material
New materia l has been added on a number of topics. In add ition to introducing
and using new C++ 11 features, this new edition includes new sections on literals,
random numbers, and enumerated data types, as well as improved materia l on
designing classes.
Preface xvii

• New Programming Challenges


New Programming Challenge problems have been added to every chapter.
• Reorganized Chapters
Several chapters have been redesigned to improve student learning . Chapter 5
(Looping) has been reorganized to give st udents more practice using the whi le
loop before introducing do-while and for loops. The Chapter 6 (Fun ctions)
material on defining and calling functions has been reorganized to introduce
function prototypes earl ier and allow main to always be the first function in
a client program .

Organization of the Text


Thi s text teaches C++ in a step -by-step fashion. Each chapte r covers a major set of
topics and builds knowledge as the student progresses through the book . Although
the chapters can be easily taught in their existing sequence, flexibility is provided .
The following dependency diagram (Figur e P-1) suggests possible sequences of
instruct ion .
Chapter 1 covers fundamental hardware, software, and programm ing concepts. The
instructor may choose to skip this chapter if the class has already mastered those topics.
Chapters 2 through 6 cover basic C++ syntax, data types, expressions, selection
str uctures, repetition str uctures, and functions . Each of these chapters builds on the
previous chapter and should be covered in the order presented.
Chapter 7 introduces object -oriented programming . It can be covered any time after
Chapter 6, but before Chapter 11. Instructors who prefer to introduce arrays before
classes can cover Chapter 8 before Chapter 7 . In this case it is only necessary to
postpone Section 8.13 (Arrays of Objects) until Chapter 7 has been covered.
As Figure P-1 illustrates, in the second half of the book Chapters 11, 12, 13, and 14
can be covered in any order. Chapters 11, 15, and 16, however, shou ld be done in
sequence. Instructors who wish to introduce data structures at an earlier point in the
course, without having first covered advanced C++ and OO P features, can cover
Chapter 17 (Linked Lists), followed by Chapters 18 and 19 (Stacks & Queues and
Binary Tr ees), any time after Chapter 14 (Recursion). In this case it is necessary to
simply omit the sections in Chapters 17- 19 that deal with templates and the Standard
Template Library.
xviii Preface

Figure P-1

Chapter1
Introduction

..
Chapters2-6
Basic
Language
Elements

• •
I

Chapter7 Chapter8
OOP Introduction Arrays
I

+
Chapter9
+
Chapter10
Searching, Sorting,
Pointers
and AlgorithmAnalysis
I

• •
I

+ Chapter12
+
Chapter13
Chapter11 Chapter14
Advanced AdvancedFiles
MoreOOP Recursion
Strings and 1/0


Chapter15
Adv.OOP

Chapter17
LinkedLists


Chapter16
Exceptions,
Templates ,
+
Chapter18
Stacksand
I

+
Chapter19
BinaryTrees
and STL Queues
Preface xix

Brief Overview of Each Chapter


Chapter 1: Introduction to Computers and Programming
T his chapter prov ides an introduction to the field of computer science and covers
the fundamentals of hardware , software, operating systems, programming, problem
so lving, and software engineering . The components of programs, such as key words,
variables, operators, and punctuation are covered . The tools of the trade , such as
hierarchy charts and pseudocode, are also presented . T he Tying It All T ogether
sect ion shows students how to use the cout statement to create a personalized
output message. Programm ing Challenges at the end of the chapter help students see
how the same basic input, processing , and output structure can be used to create
multiple programs .

Chapter 2: Introduction to C++


This chapter gets the student started in C++ by introducing the basic parts of a
C++ program , data types, the use of variables and literals, assignment statements,
simple arithmetic operations, program output, and comments . T he C++ s t ring
class is presented and string objects are used from this point on in the book as
the primary method of handling strings. Programm ing sty le conventions are
introduced , and good programming style is modeled here, as it is throughout the
text . The Tying It All T oget her section lets the student play with simple text -
based graphics.

Chapter 3: Expressions and Interactivity


In this chapter the student learns to write programs that input and hand le numer ic,
character, and string data. The use of arithmet ic operators and the creation of
mathemat ica l expressions are covered, with emphasis on operator precedence .
Debugging is introduced, with a section on hand tracing a program . Sections are also
included on using random numbers , on simp le output formatting, on data type
conversion and type casting, and on using library functions that work with numbers.
The Tying It All T ogether section shows students how to create a simple interactive
word game.

Chapter 4: Making Decisions


Here the student learns about relationa l expressions and how to control the flow of a
program with if, if I else , and if I else i f statements . Logical operators, the
cond itional operator, and the swi tch statement are also covered . Applications of these
constructs, such as menu -driven programs , are illustrated . This chapter also introduces
the concepts of blocks and scope and continues the theme of debugging with a section
on validating output results. The Tying It All T ogether section uses random numbers
and branching statements to create a fortune telling game.
xx Preface

Chapter 5: Looping
This chapter introduces, C++'s repetitive control mechanisms . The while loop, do-while
loop, and for loop are presented, along with a variety of methods to control them . These
include using counters, user input, end sentinels, and end-of-file testing. Applications
utilizing loops, such as keeping a running total and performing data validation, are also
covered . The chapte r includes an extensive section on working with files and a section
on creating good test data, continuing the book's emphasis on testing and debugging.
The Tying It All Together section introduces students to Windows commands to create
colorful output and uses a loop to create a multi-colored display .

Chapter 6: Functions
In this chapter the student learns how and why to modularize programs, using both
void and value-returning functions. Parameter passing is covered, with emphasis on
when arguments shou ld be passed by value versus when they need to be passed by
reference. Scope of variables is covered and sections are provided on local versus globa l
variables and on static local variables . Overloaded functions are also introduced and
demonstrated . The Tying It All Together section includes a modular, menu -driven
program that emphasizes the versatility of functions, illustrating how their behavior
can be controlled by the arguments sent to them .

Chapter 7: Introduction to Classes and Objects


In this chapter the text begins to focus on the object-oriented paradigm . Students have used
provided C++ classes since the beginning of the text, but now they learn how to define their
own classes and to create and use objects of these classes. Careful attention is paid to
illustrating which functions belong in a class versus which functions belong in a client
program that uses the class. Good object-oriented practices are discussed and modeled, such
as protecting member data through carefully constructed accessor and mutator functions
and hiding class implementation details from client programs. Once students are comfortable
working with classes and objects, the chapter provides a brief introduction to the topic of
object-oriented analysis and design. The chapter also includes a section on enumerated data
types and a section on structures, which are used in the Tying It All Together section, where
students learn to use screen control techniques to create a yoyo animation .

Chapter 8: Arrays
In this chapter the student learns to create and work with single and multidimensional
arrays. Many examples of array processing are provided, including functions to compute
the sum, average, highest and lowest values in an array . Students also learn to create tables
using two -dimensional arrays, and to analyze array data by row or by column . Programming
techniques using parallel arrays are also demonsrrated, and the student is shown how to
use a data file as an input source to populate an array . The range -based for loop is
introduced as an easy way to iterate through all the elements of an array, and STL vectors
are introduced and compared to arrays. A section on arrays of objects and structures is
located at the end of the chapter, so it can be covered now or saved for later if the instructor
wishes to cover this chapter before Chapter 7. The Tying It All Together section uses
arrays to create a game of Rock, Paper, Scissors between a human player and the computer.
Preface xxi

Chapter 9: Searching, Sorting, and Algorithm Analysis


Here the student learns the basics of searching for information stored in arrays and of
sorting arrays , including arrays of objects. The chapter covers the Linear Search, Binary
Search, Bubble Sort, and Selection Sort algo rithm s and has an optional section on
so rtin g and search ing STL vecto rs. A brief int rod uction to algorithm analysis is
included, and students are shown how to determine which of two algorithms is more
efficient . Thi s chapter's Tying It All T ogether section uses both a table lookup and a
searching algorithm to encode and decode secret messages.

Chapter 10: Pointers


Thi s chapter explains how to use pointers . T op ics include pointer arithmetic,
initialization of pointers , comparison of pointers, pointers and arrays, pointers
and funct ions, dynamic memory allocation , the new null pt r key word, and
more . A new section introduces smart pointers and shows how they can be used
to avoid memory leaks. Th e Tying It All T oget her section demonstrates the use of
pointers to access library data struct ures and fun ctions that ret urn calendar and
wall cloc k time.

Chapter 11: More About Classes and Object -Oriented Programming


This chapter contin ues the study of classes and object-oriented programming, covering
more advanced topics such as inheritan ce and object aggregat ion and compos ition.
Other topics include constant member functions , static members, friends, memberwise
assignment, copy constructors, object type conversion operators, convert constr uctors,
operator overloading, move constr uctors, and move assignment operators . A new
section introduces function objects and the C++ll lambda expressions. The Tying It
All Together section brings together the concepts of inheritance and convert constr uctors
to build a program that formats the contents of an array to form an HTML tab le for
display on a Web site.

Chapter 12: More on (-Strings and the string Class


Thi s chapter covers standard library functions for working with characters and
C-strings, as well as materia l on str i ng class functions , functions in the new C++11
string library, and new overloaded to_st ring functions for converting numeric
values to str i ng objects . Th e Tying It All T ogether section shows students how to
access string -based program environments to obtain information about the computer
and the network on which the program is runnin g.

Chapter 13: Advanced File and 1/ 0 Operations


Thi s chapte r intr oduces more advanced topics for work ing with sequential access
text files and introduces random access and binary files . Various modes for open -
ing files are disc ussed, as well as the many methods for reading and writing their
contents. Th e Tying It All T oget her program app lies many of the techniques
covered in the chapte r to merge two text files into an HTML doc ument for display
on the Web , with different colors used to illustrate which file each piece of data
came from .
xxii Preface

Chapter 14: Recursion


In this chapter recursion is defined and demonstrated . A visual trace of recursive calls
is provided, and recursive applications are discussed . Many recursive algorithms are
presented, includ ing recursive functions for computing factorials, finding a greatest
common denom inator (GCD), performing a binary search, sorting using QuickSort,
and solving the famous Towers of Hanoi problem . For students who need more
challenge, there is a section on exhaustive and enumeration algorithm s. The Tying It
All Together section uses recursion to evaluate prefix expressions .

Chapter 15: Polymorphism and Virtual Functions


The study of classes and object -oriented programming continues in this chapter with
the introduction of more advanced concepts such as polymorphism and virtual
functions. Information is also presented on abstract base classes, pure virtual functions,
type compatibi lity within an inheritance hierarchy, and virtua l inheritance . The Tying
It All Together section illustrates the use of inheritance and polymorphism to display
and animate graphica l images.

Chapter 16: Exceptions, Templates, and the Standard Template


Library (STL)
Here the student learns to develop enhanced error trapping techniques using exceptions.
Discussion then turns to using funct ion and class templates to create gener ic code .
Finally, the student is introduced to the containers, iterators, and algorithms offered by
the Standard Template Library (STL). The Tying It All Together section uses various
conta iners in the Standard Template Librar y to create an educational children's game.

Chapter 17: Linked Lists


This chapter introduces concepts and techniques needed to work with lists. A linked list
ADT is developed, and the student learns how to create and destroy a list, as well as to write
functions to insert, append, and delete nodes, to traverse the list, and to search for a specific
node. A linked list class template is also demonstrated. The Tying It All Together section
brings together many of the most important concepts of OOP by using objeets, inheritance,
and polymorphism in conjunction with the STL list class to animate a collection of images.

Chapter 18: Stacks and Queues


In this chapter the student learns to create and use stat ic and dynamic stacks and queues.
Th e operations of stacks and queues are defined, and templates for each ADT are
demonstrated . The stat ic array -based stack uses exception -handling to handle stack
overflow and und erflow, providing a realistic and natural example of defining, throwing,
and catching except ions . The Tying It All Together section discusses strateg ies for
evaluating postfix expressions and uses a stack to convert a postfix expression to infix.

Chapter 19: Binary Trees


This chapter covers the binary tree ADT and demonstrates many binary tree operat ions.
The student learns to traverse a tree, insert, delete, and replace elements, search for a
particular element, and destroy a tree. The Tying It All Together section introduces a
tree structure versatile enough to create genealogy trees.
Other documents randomly have
different content
Mr. Ruby. Do you want it “Jack Ruby” or “Jack L. Ruby”?
Mr. Herndon. You sign it as you usually sign, but do you want to
read it any further, sir?
Mr. Ruby. I’ll just sign it.
(Mr. Ruby at this time signed the instrument referred to, which
was thereafter signed by witnesses Special Agents Herndon and
Wood.)
Mr. Ruby. Did you get your pants sewed up, Joe?
Mr. Tonahill. It went through to my leg.
Mr. Ruby. That was a pretty rough brawl we had, wasn’t it, Joe?
Mr. Tonahill. Yes.
Mr. Ruby. Joe, I’d appreciate it if you weren’t in the room. Can I
ask you to leave, Joe?
Mr. Tonahill. I’ll be glad to leave, if you want me to, Jack.
Mr. Ruby. As a matter of fact, I prefer Bill Alexander to you,
you’re supposed to be my friend.
Mr. Tonahill. Let the record show that Mr. Ruby says he prefers
Bill Alexander being here during this investigation, who is the
assistant district attorney who asked that a jury give him the death
sentence, to myself, who asked the jury to acquit him, his attorney.
Mr. Herndon. May we proceed?
Mr. Specter. Please do, Mr. Herndon.
Mr. Herndon. Mr. Ruby, as you know, we have a doctor here, and
before we begin anything, I want you to try to relax. I realize that
there is some tension here, and before we proceed any further, I
want to ask you very generally, how do you feel today, right now,
specifically speaking?
Mr. Ruby. Very good, except—may I be very honest?
Mr. Herndon. Of course.
Mr. Ruby. What is the preference of the doctor being here? Is he
supposed to be my doctor, I mean Dr. Beavers?
Mr. Herndon. Mr. Specter, do you want to answer that?
Mr. Specter. Yes; Mr. Ruby, he is here at the request of Mr.
Tonahill, and I believe concurred in, by your chief counsel, Mr.
Fowler.
Mr. Herndon. The reason I asked you about your health, Mr.
Ruby, obviously I don’t want to proceed with this interrogation of the
polygraph type when you obviously may not feel well physically
today. I wouldn’t want to subject you to the examination unless you
felt well enough to take it, and I will ask you some very general
questions about your health in regard to your history in that regard.
Have you every had any respiratory diseases or illnesses such as
asthma or trouble with breathing, Mr. Ruby?
Mr. Ruby. None whatever.
Mr. Herndon. Any sinus condition or trouble?
Mr. Ruby. No.
Mr. Herndon. Have you ever had any heart ailments?
Mr. Ruby. No, sir.
Mr. Herndon. No heart trouble to your knowledge.
Mr. Ruby. [No response.]
Mr. Herndon. Mr. Ruby, have you had any medication of any type
whatsoever today, such as tranquilizers, aspirin, any drugs at all
today?
Mr. Ruby. None whatsoever.
Mr. Herndon. While you’ve been here in custody, have you been
under any medication?
Mr. Ruby. None whatever.
Mr. Specter. Mr. Herndon, at this time I shall administer the oath
to Mr. Ruby.
Mr. Ruby. You want me to stand up?
Mr. Specter. Yes, sir; if you would please. As assistant counsel, I
have the authority under the law to administer an oath to you for
proceedings in the nature of depositions.
Do you solemnly swear that the answers and information you
shall give in this proceeding before the President’s Commission on
the Assassination of President Kennedy will be the truth, the whole
truth, and nothing but the truth?
Mr. Ruby. I do.
Mr. Specter. Have the answers you have heretofore given in
response to the informal questions already asked of you been the
truth, sir?
Mr. Ruby. Repeat that again?
Mr. Specter. Have the answers which you have already given in
response to the informal questions put to you by Mr. Herndon and
others here, are they all true?
Mr. Ruby. Yes, about my health—are all true—yes.
Mr. Specter. All right, Mr. Herndon, will you proceed.
Mr. Herndon. Yes. Thank you.
I understand, Mr. Ruby, that you have had your lunch today, is
that correct? I want to make sure you have had a chance to eat.
Mr. Ruby. Yes, I did.
Mr. Herndon. When did you eat, how long ago?
Mr. Ruby. I would guess approximately 12:30.
Mr. Herndon. You’ve had no digestive problems while you’ve been
here?
Mr. Ruby. No.
Mr. Herndon. Have you had any coffee today—these are
questions that will help us later on?
Mr. Ruby. One early in the morning.
Mr. Herndon. Early in the morning?
Mr. Ruby. Yes.
Mr. Herndon. Did you have more than one cup?
Mr. Ruby. One and a half cups.
Mr. Herndon. That’s your usual amount of coffee you have?
Mr. Ruby. Yes.
Mr. Herndon. Did you have any coffee at lunch, Mr. Ruby?
Mr. Ruby. No, I did not.
Mr. Herndon. Now, Mr. Ruby, have you ever had a——
Mr. Ruby. The reason why I say this, there was some newspaper
items recently that brought up the fact that I was of unsound mind.
Do I sound that way to you at the present time?
Mr. Herndon. I don’t feel that I am qualified at this time to make
any statement in that regard. I’m sure you would understand that
that is something you can’t give in a moment’s notice.
Mr. Ruby. Yes.
Mr. Herndon. Would you care to sit over here, Mr. Ruby, and I will
further explain the test to you.
Mr. Ruby. Surely.
(At this time Mr. Ruby conferred with Mr. Fowler out of the
hearing of this reporter and others in the room.)
Mr. Ruby. All right.
(At this time Mr. Ruby seated himself in the polygraph test chair.)
Mr. Herndon. This is a polygraph chair. The reason it is so
constructed, we want to take advantage of these high arms
[indicating arms on the polygraph chair] so that we can get a better
tracing, and very frankly, Mr. Ruby, I want to give you as best an
examination as I can. So, it’s going to take a little time and I want
you to relax as best you can. I realize you might be a little nervous,
and I will certainly take that into consideration. Let me just briefly,
Mr. Ruby, tell you about the polygraph examination and what we’re
going to do today. I want to proceed by hooking up some of these
pieces of equipment and briefly tell you what it is. Now, may I ask
you to remove the material you have in your pocket, sir, and you
might want to give it to your counsel.
Mr. Specter. Let the record show that Mr. Ruby has removed all
the objects from his upper left-hand pocket.
(After removing objects mentioned, Mr. Ruby handed the same
to Mr. Fowler.)
Mr. Herndon. I gather from looking at your overalls that you don’t
have any restrictive garments or belts or anything underneath on
you which would hinder you or your relaxation?
Mr. Ruby. No, sir.
Mr. Herndon. You are very comfortable?
Mr. Ruby. Yes.
Mr. Herndon. Very fine, Mr. Ruby. Now, Mr. Ruby, there are two
ways I can do this. I can do two things—I can either go ahead and
put this equipment on you right now and describe briefly how it’s
going to work, or if you want, I can go over these first series of
questions and give you some instructions, and then put the
equipment on. Which do you prefer?
Mr. Ruby. Which is the most effective way to get what you want?
Mr. Herndon. Well, I think in view of the fact that we will have
some discussion here, I want to make sure that you perfectly
understand these questions, I will go ahead and give you some basic
instructions about how these questions are going to be asked and
how I want you to answer them.
Mr. Ruby. All right.
Mr. Herndon. And then later on, as I hook you up, I will briefly
describe what this equipment is going to do.
Mr. Ruby. Yes.
Mr. Herndon. The polygraph examination will entail, as Mr.
Specter indicated, just approximately 8 to 9 questions, Mr. Ruby, in
what we call a series. Now, I’m going to go over these questions
with you right now very carefully. I want to make sure that the way I
have them phrased is in such a way that you understand perfectly
what I mean by them. We will discuss the question and you may if
you want to, even answer the question at this time.
Mr. Ruby. I would appreciate it myself.
Mr. Herndon. In other words, I’m going to tell you what the
question is going to be and you shall feel free to answer it “Yes” or
“No.”
Mr. Fowler. Excuse me, sir.
Mr. Herndon. Certainly.
Mr. Fowler. At this time, Jack, I request that in view of the fact
that you’re not hooked up, that you do not answer the question and
reserve those until such time as you will be on the machine.
Mr. Ruby. That’s fine.
Mr. Herndon. Then, we will just discuss the questions.
Mr. Ruby. Do it to your advantage, may I add.
Mr. Herndon. I generally prefer in my practice with the polygraph
to have the gentleman answer the question so that he knows he has
already answered it, and as a matter of record, he knows that that
question is coming along.
Mr. Ruby. Please let me do it, will you? [Addressing Mr. Fowler.]
Mr. Fowler (no response).
Mr. Herndon. I will bow to whatever Mr. Specter or counsel wants
to do in this regard.
Mr. Ruby. Fowler, I hate to dispute with you, but let me do it this
way?
Mr. Fowler. Well, Jack, again, Mr. Alexander is here and again I
tell you this—that the answers to some of these questions could be
absolutely very detrimental to you.
Mr. Ruby. They can’t be.
Mr. Fowler. I’m talking about from a legal standpoint. Now,
morally, I know how you feel and you want to do the best you can
for the Commission.
Mr. Ruby. I will.
Mr. Fowler. But by the same token, this gentleman over here
[referring to Mr. Alexander] represents the State, who at this time is
not representing you. Now, if we could allow Mr. Alexander to have
the benefit of the nature of the questions, with the exception of the
answers—if this is what Jack wants—but I do not want Mr. Alexander
to have the benefit of the answers.
Mr. Specter. The test may be conducted either way. As Mr.
Herndon has explained, he has a slight preference to have the
answers, but the ultimate decision on that is up to Mr. Ruby and his
counsel. The Commission will proceed in either manner.
Mr. Ruby. It’s unfortunate that my attorney, Mr. Fowler, don’t see
as I do. I would like to give every cooperation without the slightest
fraction of interference. That’s why I requested that. You won’t let
me do it that way, huh, Fowler?
Mr. Fowler. I’m requesting that you do not, Jack.
Mr. Herndon. It will be no problem.
(Addressing the court reporter.) Do you have any problem
hearing?
Court Reporter. If Mr. Ruby would talk just a little bit louder it
would be fine.
Mr. Herndon. Mr. Ruby, I have placed all these questions in a form
so that they are very short and concise and can be answered only by
“Yes” or “No,” and that’s the way we have to ask a question during a
polygraph examination, but I’ll go over them with you and give you
an idea of what they’re going to be. During the normal series, I’m
going to ask several questions, of course, which are pertinent to the
Commission’s investigation, but I will also ask you several questions
which more or less just deal with your identity, your background and
your name, so you will have two types of questions that I will ask.
Now, the first question I’m going to ask you under series 1, which is
rather pertinent, and I want you to know that I’m going to ask it,
and I’m going to phrase it as simply as I can.
“Did you know Oswald before November 22, 1963?”
Now, what I mean by “know” is did you have any personal
acquaintance of this individual, any personal acquaintance? Have
you ever seen him, did you have any conversation with him? In
other words, as you would say, “Well, I know that person.”
Mr. Ruby. Should I answer that?
Mr. Fowler. Not now, Jack.
Mr. Herndon. That question will be asked or repeated, and so you
and I will understand what we want, I’ll repeat it. “Did you know
Oswald before November 22, 1963?”
Mr. Ruby. Right.
Mr. Herndon. Another question that I will ask in series 1, after I
get the instrument adjusted, and it will be short and simple and
answerable only by “Yes” or “No.”
“Did you assist Oswald in the assassination?”
Do you understand that question?
Mr. Ruby. Yes; it is very clear.
Mr. Herndon. I tried to make them as short as possible and as
clear as possible. Again, I’m going to ask you just as a matter of
format here, “Did you take any medication this morning?” You have
already answered that question, but that will be one of the questions
I will ask you. I’m also going to ask on series 1, just to give you a
little time to relax here, some of these rather simple questions such
as: “Did you voluntarily request this test?”
Mr. Ruby. Yes.
Mr. Herndon. You have already indicated your answer to that.
And, I will ask a rather obvious question as a matter of identity, “Is
your first name Jack? Is your last name Ruby?” These types of
questions will be asked and I want to make sure I cover each and
every one. I’m going to ask you, “Do you use the middle name
‘Leon’?” I understand you do; is that correct?
Mr. Ruby. No; very rarely, very rarely.
Mr. Herndon. All right, you can answer that as you see fit, when I
ask it on the test. I will ask you this question, and I want to ask this
as a matter of record for me because I interview a lot of people:
“Have you ever been arrested?” Now, what I mean in this regard,
and I’ll probably change that phraseology to “Have you ever been
arrested before? Prior to the shooting, have you ever been
arrested?” Now, what I mean by “arrested,” Mr. Ruby, is were you
ever actually placed under arrest and brought before some type of
magistrate and charged with any crime. That question will also be on
the first examination. Those are the questions I’m going to ask you.
Do you have any questions about them, sir? Are they clear and
concise to you?
Mr. Ruby. When you speak of the last question about a crime,
I’ve never been involved in a crime, so if you’ve been arrested for
selling beer after hours, does that qualify as an answer too?
Mr. Herndon. Well, what I mean by “arrested” is if you were
formally charged with something?
Mr. Ruby. Like a felony?
Mr. Herndon. Well, any type of a formal arrest, wherein you
actually were arrested and charged before a magistrate, of offending
a law that’s on the record, either of a community, a city, or the
State.
Mr. Ruby. You don’t necessarily have to have been found guilty or
anything, just the point of being arrested, is that right?
Mr. Herndon. Now, let me inject this, Mr. Ruby. If these questions
when I ask them, if you have something in doubt in your mind of
how to answer it “Yes” or “No,” just refrain from answering it, and
we’ll go back after the test and discuss it.
Mr. Ruby. Very well.
Mr. Herndon. In other words, I want you to be able to freely and
truthfully say “Yes” or “No” to these questions. If one of them leaves
any area of doubt in your mind and you are hesitant to answer it,
feel free not to say anything, and we will just proceed, and after I
stop the instrument, I will then go over that question with you. All
right, sir?
Mr. Ruby. Yes.
Mr. Herndon. All right, Mr. Ruby, I’ll just briefly hook up the
instrument and I’ll probably run it for a little while just to get it
adjusted to you, and inasmuch as you’ve never had a polygraph
before, I will explain the instrument’s parts to you. You can see here,
Mr. Ruby, I have a rubber tube and I’m going to place that around
your chest, sir. This is what we call the pneumograph and that will
accurately record you respiratory pattern as you inhale and exhale.
Would you be kind enough to raise your arms, sir?
Mr. Ruby (complied with request of Mr. Herndon).
(Reporter’s note: 2:58 p.m.)
Mr. Herndon. Now, as you can see, as you inhale the tube
stretches, and as you exhale it decreases in size and I will have a
tracing of it on the polygraph.
Mr. Ruby. Yes.
Mr. Herndon. During the examination and as we run the test, I
would appreciate it if you would sit perfectly relaxed, rather straight
in the chair, with both of your feet flat on the floor. Now, that will
record, during the interview, the tracing of your breathing, and I
want you for this reason to breathe perfectly normal and perfectly
relaxed. Now, the next thing I want to put on will be on your hand
and I’ll put it on your right hand here. I notice you have one finger
cut off on that hand. What happened there, Mr. Ruby?
Mr. Ruby. Oh, running a nightclub you get involved in various
altercations.
Mr. Herndon. Now, this next component that I want you to see
will be what we call the Galvanic Skin Response, GSR. I’m going to
place these on your fingers, and actually all this simply does,
through these instruments and the electronic processes, is to record
any variance in the electrical conductivity or the resistance of your
skin. It’s helpful to me in this examination. Your hands are very
good. They are not sweating a bit. Is that too tight?
Mr. Ruby. No.
Mr. Herndon. Is it uncomfortable?
Mr. Ruby. No.
Mr. Herndon. All right, Mr. Ruby. Now, neither one of these two
components will you feel at all. That will be no problem at all.
Mr. Ruby. All right.
Mr. Herndon. Now, the next component that I will put on your left
arm, because it’s closer to your heart, and this is the cardiograph
cuff, and this is going to give me an accurate tracing of any relative
changes in your blood pressure. These will just be relative changes.
I won’t be able to necessarily know what your blood pressure is. I
will have relative blood pressure changes, and I will also have on a
chart a change in any heartbeat or heart rate you might have.
Now, I am going to record all these physiological responses as
we discuss the questions, and as you answer them I will have an
indication of what is taking place physiologically, what is going on in
your physical system, and which will assist me in interpreting
whether or not you may be deceiving with regard to the question.
Mr. Ruby. What is your name, please, sir?
Mr. Wood. Wood. I’m with the FBI.
Mr. Ruby. Where is Shanklin, I thought he was supposed to be
here?
Mr. Wood. He is in town but he is not here.
Mr. Ruby. Isn’t Mr. Shanklin the chief?
Mr. Herndon. Do you want to relax your arm, Mr. Ruby? Now, do
you have any questions about what I’ve done so far, Mr. Ruby?
Mr. Ruby. No. Do you want me to relate my story to you now?
Mr. Herndon. No; I want you to sit perfectly still. There will be no
conversation, and I’m going to get the instrument adjusted to you.
That will take only a few minutes, so just sit and try not to move.
I’m not going to ask you any questions at this time. I just want to
adjust the machine to you.
Mr. Specter. Mr. Herndon, have you now covered all the
preliminaries up to the point of asking the questions?
Mr. Herndon. Just about. I will probably repeat some basic
instructions for Mr. Ruby just before we start asking him the
questions.
Mr. Specter. All right, then I think those who are going to leave
should leave now so that we are ready to go as soon as your
instrument is in tune.
May the record show that Mr. Alexander has left the room.
Mr. Fowler. Jack, do you have any objections to Mr. Tonahill
being here?
Mr. Ruby. If Tonahill is going to be here—I don’t believe he’s—I
know Bill Alexander is my friend, so he can stay, but Joe is supposed
to be my friend.
Mr. Fowler. Well, we’re not putting it on that basis, Jack. This is
just purely personal.
Mr. Ruby. Just let me tell you this, Fowler. I have nothing to gain
by Joe being here, because—I have nothing to gain.
Mr. Fowler. All right, all right. Then, we will ask Joe and Mr.
Alexander to step out.
Mr. Ruby. You still want Alexander to step out?
Mr. Fowler. I certainly think so, Jack.
Mr. Ruby (addressing Mr. Alexander who was standing in the
doorway to the examining room). Now, Bill, don’t say I didn’t
request you, now?
Mr. Alexander. I know it, Jack.
Mr. Specter. May the record show that Mr. Alexander and Mr.
Tonahill have just gone out of the room.
Mr. Herndon. Mr. Ruby, it will take me a few moments to get this
adjusted. If you desire to talk to Mr. Fowler, if you can sit still and
talk it will be all right.
(Conference at this time between Mr. Fowler and Mr. Ruby out of
the hearing of the court reporter and others in the room.)
Mr. Herndon. Do you want to sit still now, Mr. Ruby. I’m not going
to ask you any questions. I just want to get everything adjusted at
this time. You will hear a few scratching noises on the paper.
Now, will you take a deep breath, Mr. Ruby, and then relax, sir?
Mr. Ruby (complied with request of Mr. Herndon).
Mr. Herndon. Now, just breathe normally.
Now, if everyone will just be quiet for a few moments. There will
be no questions asked. I just want to get the instrument adjusted.
(Reporter’s note: 3:05 p.m.)
Mr. Herndon (snapped his fingers twice). I made that noise
purposely, Mr. Ruby. Now, I’m going to let you get the feel of that
cuff as I inflate it, and there will be a little bit of pressure put against
your arm. You’ve had your blood pressure taken by a doctor, I’m
sure?
Mr. Ruby. Oh, yes.
Mr. Herndon. You recall that. It will be the same feeling and I will
have to leave it on just for a matter of a few moments, and if you
will sit perfectly still and put your feet flat on the floor and look
straight ahead.
I will now apply a little bit of pressure on that arm. You probably
feel a little pressure. All right, sir?
Mr. Ruby. Yes.
Mr. Herndon. From time to time I may come over and raise and
lower your arm to make sure it’s perfectly relaxed.
Mr. Ruby. That’s all right.
Mr. Herndon. Do you feel your pulse beat?
Mr. Ruby. Yes.
Mr. Herndon. You can see and feel your pulse beat and in a
moment you can see how it records. Very fine, Mr. Ruby. You have
been very cooperative. I don’t think we will have any problem.
Mr. Ruby. You can see the differences of nature—if certain things
are wrong or right, can’t you?
Mr. Herndon. Well, I have to very carefully interpret what I see.
I’m going to take all these things together at a later date into
consideration, and I don’t see any difficulty.
Mr. Ruby. Because—I want my chief to understand this here and
see that.
Mr. Herndon. Are you a little more relaxed now?
Mr. Ruby. Yes.
Mr. Herndon. You seem to be. I don’t want to begin until you feel
you are perfectly relaxed.
Mr. Ruby. Yes; I’m very much relaxed because I have nothing—
I’m not sparring with it, so I must be relaxed.
Mr. Herndon. Very fine. I appreciate your cooperation very much
and you are cooperating with me very well.
In a moment, you can move your hand a little bit to get a little
circulation. You probably felt just a little tingling sensation?
Mr. Ruby. Yes; I felt a little bit of throbbing in these two fingers.
Mr. Herndon. Are they too tight?
Mr. Ruby. No; that’s fine.
Mr. Herndon. I can relax this a little bit on your arm. I just want it
close enough so that they won’t slip, just about like that. I don’t
want this to cause you any discomfort to you. Now, if you are about
ready?
Mr. Ruby. I am ready.
Mr. Herndon. You remember, I’m going to ask you just the
questions that we discussed before and that’s all.
Mr. Ruby. You mean that’s all?
Mr. Herndon. Oh, no; this is just series 1, Mr. Ruby. We’re going
to cover many questions.
Mr. Ruby. All right.
Mr. Herndon. I’m going to go rather deliberately slow on this first
one until you become acquainted with the procedure.
Mr. Ruby. Believe me, I know the answers, so you can ask me as
fast as you like.
Mr. Herndon. During the test, again, if you will keep your feet on
the floor at all times, flat on the floor at all times, and try not to
move. I know it’s hard to sit perfectly still for the 3 to 4 minutes, but
it is to your advantage to try to keep from moving. If you have to
cough or move, I’ll probably observe it and take it into consideration.
During the examination, Mr. Ruby, I know we have other people
in the room, but I would appreciate it if you would just try to
concentrate as if there were just you and me in here and these
questions are coming out and if you know the answer in your own
mind, I want you to truthfully answer them “Yes” or “No.” Do not
give any qualifying statement or additional comments.
Mr. Ruby. All right.
Mr. Herndon. On the other hand, if I come to one of these
questions that you’re not sure whether you want to say “Yes” or
“No,” there is some area in doubt, just don’t say anything and we’ll
go back and discuss it later.
Mr. Ruby. Okay.
Mr. Herndon. If you will, look right over here, look straight ahead
at the wall and relax, and hear my question and give your answer to
it, “Yes” or “No.”
Mr. Ruby. Yes, sir.
Mr. Herndon. I will tell you when I am going to begin. I will tell
you when this particular test is over, but do not relax or move until I
give you the word.
Mr. Ruby. Very well.
Mr. Herndon. As I say, you will hear a little scratching noise and I
will be marking the paper as we proceed.
Mr. Ruby. Can I speak?
Mr. Herndon. Right now if you want to; yes, sir.
Mr. Ruby. Fowler, I beg you to get Bill Alexander and Joe Tonahill
back in here. I tell you. Will you do it, please.
Mr. Fowler. Jack, let’s go on just like it is now. I don’t want you
to have any apprehensions that we’re trying to keep anybody out.
Mr. Ruby. All right.
Mr. Herndon. It’s taking me about a minute to get the instrument
warmed up again here.
All right, I will now put a little pressure on that arm, Mr. Ruby,
and I will let you know when I’m going to begin. Once again, just
answer the questions truthfully, “Yes” or “No.”
(Reporter’s note: 3:10 p.m.)
Mr. Herndon. The test will now begin.
“Is your first name Jack?”
Mr. Ruby. “Yes.”
Mr. Herndon. “Is your last name Ruby?”
Mr. Ruby. “Yes.”
Mr. Herndon. “Did you voluntarily request this test?”
Mr. Ruby. “Yes.”
Mr. Herndon. “Did you know Oswald before November 22, 1963?”
Mr. Ruby. “No.”
Mr. Herndon. “Do you use the middle name ‘Leon’?”
Mr. Ruby (no immediate response). How can I answer that? I
don’t have my driver’s license, but I don’t use it.
Mr. Herndon. All right, just sit still and we will discuss it. “Did you
assist Oswald in the assassination?”
Mr. Ruby. “No.”
Mr. Herndon. “Have you ever been arrested?”
Mr. Ruby. “Yes.”
Mr. Herndon. “Did you take any medication this morning?”
Mr. Ruby. “No.”
Mr. Herndon. “Have you answered all my questions truthfully?”
Mr. Ruby. “Yes.”
Mr. Herndon. This first series is over. If you will just sit still for a
moment, I will release the pressure on your arm, and you may now
move your arm and relax and get the circulation moving.
Mr. Ruby. I’m all right.
Mr. Herndon. That wasn’t too bad, sir; was it?
Mr. Ruby (no response).
(Reporter’s note: 3:12 p.m.)
Mr. Herndon. Mr. Ruby, there are two questions I want to ask you
about on our first series.
I know you couldn’t refrain from laughing and talking about that
middle name of “Leon.” Do you want to further explain that?
Mr. Ruby. Yes; I don’t use it, so hence it’s sort of a remembrance
of a very good friend of mine. I used it on my driver’s license, but
since then it has become a habit of keeping it on my driver’s license,
but I’ve never been called with it and very rarely do I sign papers
that way, but once I stated it on my driver’s license, I had to follow
through with it that way, and that’s the answer to it. Once you have
it on your driver’s license, you have to have it the same way.
Mr. Herndon. Do you like the name “Leon”?
Mr. Ruby. Well, I did more for sentimental reasons, but as I went
along later I sort of dropped it.
Mr. Herndon. Is it actually on your driver’s license, though?
Mr. Ruby. I think it’s Jack L. Ruby. No—Jack Leon Ruby. It’s Jack
Leon Ruby on my driver’s license and that’s something that once you
start with it, and its been years ago, when you renew your license, it
remains the same, but outside of signing papers or contracts or
anything of vital importance, you only find out it’s much simpler to
sign “Jack Ruby.”
Mr. Herndon. All right, Mr. Ruby, and one other question. I would
just like to ask you what went on in your mind when you did answer
the question “Yes” to “Have you ever been arrested?”
Mr. Ruby. Well, the police had taken me—I had been arrested,
because when the police officer said, “Jack, come on, we’re taking
you down,” you’re arrested.
Mr. Herndon. When was this? Are you referring to this current or
some previous time?
Mr. Ruby. Previous to that.
Mr. Herndon. What situation was that?
Mr. Ruby. Well, it was—I was arrested for dancing after curfew.
Some fellows smuggled in intoxicants after hours.
Mr. Herndon. Was this here in your own place or some other
place?
Mr. Ruby. At my own place. No felony crime, nothing serious—
only misdemeanors.
Mr. Herndon. You consider that was a misdemeanor?
Mr. Ruby. Oh, yes; in other words—a $25 fine. I never have been
in any criminal activity.
Mr. Herndon. Very fine. Does your arm feel all right now?
Mr. Ruby. Yes.
Mr. Herndon. Very good. We have finished with the first series.
Mr. Specter. I am now going to ask Mr. Alexander and Mr. Tonahill
to return between now and the time we start on the next test.
May the record show that Mr. Alexander and Mr. Tonahill are
back in the room.
Mr. Herndon. Did the cardiounit disturb you at all other than just
a slight tingling sensation?
Mr. Ruby. In this arm here [indicating left arm]?
Mr. Herndon. Did that bother you before the series No. 1 group?
Mr. Ruby. No; that’s fine.
Mr. Herndon. Mr. Ruby, you are now a veteran of the first series.
You did real well. You cooperated very fine.
Now, we will proceed with series No. 2. I want to go over these
questions with you so that you and I understand precisely and
perfectly what they mean.
Mr. Ruby. All right.
Mr. Herndon. Now, in this series of questions, I am going to ask
as one of the ones which is pertinent in this investigation, “Are you
now a member of the Communist Party?”
Mr. Ruby. No.
Mr. Herndon. You don’t have to answer that if you don’t want to
now, but I’m going to ask you that question, sir.
Mr. Ruby. OK.
Mr. Herndon. You understand what I mean by that—that’s about
as short and sweet as we can get it.
Mr. Ruby. Yes.
Mr. Herndon. I’m going to ask you, “Have you ever been a
member of the Communist Party?”
Mr. Ruby. No.
Mr. Herndon. You understand the difference—one is now and one
is—have been perhaps sometimes in your youth or life—if you were
affiliated with the Communist Party.
Mr. Ruby. Yes; I understand.
Mr. Herndon. I’m going to ask you this question, Mr. Ruby: “Are
you now a member of any group that advocates the violent
overthrow of the United States Government?”
Mr. Ruby. No.
Mr. Herndon. Do you understand that question?
Mr. Ruby. Yes, sir.
Mr. Herndon. I’m going to ask: “Have you ever been a member of
any group that advocates the violent overthrow of the United States
Government?”
Mr. Ruby. No.
Mr. Herndon. It’s very similar, only it’s in the past tense.
Mr. Specter. Mr. Ruby, on those two questions—we can’t go
through all of those groups which advocate the overthrow of the
United States Government, so we are generalizing with respect to
them.
Mr. Ruby. Yes.
Mr. Specter. You have indicated you understand them?
Mr. Ruby. Yes; and my answer is “No—no collaborating.”
Mr. Specter. I don’t think it is necessary to elaborate on that.
Mr. Ruby. No.
Mr. Herndon. All right, in addition to those questions, I’m going to
ask you a relatively simple question as this, that you should be able
to answer “Yes” or “No.” “Were you born in the United States?”
Mr. Ruby. Yes.
Mr. Herndon. “Were you born in Chicago?”
Mr. Ruby. Yes.
Mr. Herndon. Now, this next question I’m going to ask you, you
don’t have to answer it now. You can discuss it with me later or you
can wait and decide what you want to answer to it. “Did you ever
make a false official statement?”
Now, that’s a general question and I realize that, Mr. Ruby, and
when I ask that question, obviously your mind probably went back
to many things. We make a lot of official statements. Now, I’m
asking that question in its broadest terms. In other words, to your
recollection, have you ever made a false official statement?
Mr. Ruby. When you say “official”—for instance, in order to have
a job years ago—I want to explain this to you. In order to work in a
department store, I had to use another name because this other
person would be the right age that I could work, but outside of that,
officials—to any authorities—I haven’t.
Mr. Herndon. Obviously, this department store thing came to your
mind when I asked that question?
Mr. Ruby. Yes.
Mr. Herndon. Well, sir, I’m glad you brought that out so I will
have an understanding that that was in your mind. What I mean
here, however, is something more in the nature of an application for
a license, an application for a permit, an application for insurance—
anything that would come within the jurisdiction of being somewhat
a legal or semilegal form or application?
Mr. Ruby. No.
Mr. Herndon. I want to make sure you understand what I mean
by that question.
Then, I’ll probably ask, I understand you were born in 1911, is
that correct?
Mr. Ruby. Yes.
Mr. Herndon. These are questions of identity—“Were you born in
1911?”
Now, let me see, gentlemen, if we have gone over all the
questions. I have gone over all the questions with Mr. Ruby that I’m
going to ask for this next series.
Mr. Specter. All right, prior to the administration of the second
series, Mr. Alexander and Mr. Tonahill are now leaving the room
again.
May the record show that Mr. Alexander and Mr. Tonahill have
now departed from the room.
(Reporter’s note: 3:20 p.m.)
Mr. Herndon. All right, now just relax. Can I get you a drink of
water or anything, Mr. Ruby?
Mr. Ruby. No; I’m perfectly all right.
Mr. Herndon. All right, very fine. Once again, if you will try to
refrain from moving, simply look straight again, and sit perfectly still
and answer the questions “Yes” or “No.” I again will tell you when I
am going to begin, Mr. Ruby.
Now, are you relaxed? Are you OK?
Mr. Ruby. Yes.
Mr. Herndon. How does your arm feel? I noticed you had a little
bit of pressure there around the cuff. Is the circulation all right?
Mr. Ruby. Fine.
Mr. Herndon. You feel fine?
Mr. Ruby. Yes.
Mr. Herndon. It will take me a moment again here to get the
instrument adjusted. Before I put any pressure on the cuff, Mr. Ruby,
I’m going to just tighten this up just slightly, do you want to move
up just a moment? Does that bind you in any way or is it too tight
[checking tube around Mr. Ruby’s chest]?

You might also like