rent-now

Rent More, Save More! Use code: ECRENTAL

5% off 1 book, 7% off 2 books, 10% off 3+ books

9780763710637

Programming and Problem Solving With C++

by ; ;
  • ISBN13:

    9780763710637

  • ISBN10:

    0763710636

  • Format: Paperback
  • Copyright: 1999-08-01
  • Publisher: Jones & Bartlett Learning
  • Purchase Benefits
  • Free Shipping Icon Free Shipping On Orders Over $35!
    Your order must be $35 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • eCampus.com Logo Get Rewarded for Ordering Your Textbooks! Enroll Now
List Price: $82.95

Summary

Programming & Problem Solving with C++ provides the most accessible introduction to C++ & object-oriented programming for beginning students. With its straightforward & disciplined programming style, this text is free of intricate language features, promotes good programming habits, & provides clear examples, complete case studies, & numerous end-of-chapter exercises. The first half of the text gives students a solid foundation in algorithm development & functional decomposition design methodology. The second half builds on the foundation, exploring ADTs, the C++ classes, encapsulation, information hiding, & object-oriented software development.

Table of Contents

Overview of Programming and Problem Solving
1(46)
Overview of Programming
2(8)
What Is Programming?
2(1)
How Do We Write a Program?
3(5)
Theoretical Foundations: Binary Representation of Data
8(2)
What is a Programming Language?
10(6)
Background Information: Compilers and Interpreters
13(3)
What Is a Computer?
16(9)
Background Information: PCs, Workstations, and Mainframes
19(5)
Background Information: The Origins of C++
24(1)
Ethics and Responsibilities in the Computing Profession
25(5)
Software Piracy
26(1)
Privacy of Data
27(1)
Use of Computer Resources
28(1)
Software Engineering
29(1)
Problem-Solving Techniques
30(6)
Ask Questions
30(1)
Look for Things That Are Familiar
31(1)
Solve by Analogy
31(1)
Means-Ends Analysis
32(1)
Divide and Conquer
33(1)
The Building-Block Approach
34(1)
Merging Solutions
34(1)
Mental Blocks: The Fear of Starting
35(1)
Algorithmic Problem Solving
36(1)
Problem-Solving Case Study: An Algorithm for a Company Payroll
36(5)
Summary
41(6)
Quick Check
42(1)
Exam Preparation Exercises
43(1)
Programming Warm-up Exercises
44(1)
Case Study Follow-Up
45(2)
C++ Syntax and Semantics, and the Program Development Process
47(54)
The Elements of C++ Programs
48(25)
C++ Program Structure
48(3)
Syntax and Semantics
51(1)
Theoretical Foundations: Metalanguages
52(1)
Syntax Templates
53(3)
Naming Program Elements: Identifiers
56(1)
Matters of Style: Using Meaningful, Readable Identifiers
57(1)
Data and Data Types
58(1)
Background Information: Data Storage
58(3)
Naming Elements: Declarations
61(4)
Matters of Style: Capitalization of Identifiers
65(1)
Taking Action: Executable Statements
66(6)
Beyond Minimalism: Adding Comments to a Program
72(1)
Program Construction
73(8)
Blocks (Compound Statements)
75(3)
The C++ Preprocessor
78(1)
An Introduction to Namespaces
79(2)
More About Output
81(2)
Creating Blank Lines
81(1)
Inserting Blanks Within a Line
82(1)
Program Entry, Correction, and Execution
83(3)
Entering a Program
83(1)
Compiling and Running a Program
84(2)
Finishing Up
86(1)
Problem-Solving Case Study: Contest Letter
86(5)
Testing and Debugging
91(1)
Summary
92(9)
Quick Check
93(2)
Exam Preparation Exercises
95(3)
Programming Warm-up Exercises
98(1)
Programming Problems
99(1)
Case Study Follow-Up
100(1)
Numeric Types, Expressions, and Output
101(52)
Overview of C++ Data Types
102(1)
Numeric Data Types
103(2)
Integral Types
103(1)
Floating-Point Types
104(1)
Declarations for Numeric Types
105(2)
Named Constant Declarations
105(1)
Software Engineering Tip: Using Names Constants Instead of Literals
106(1)
Variable Declarations
106(1)
Simple Arithmetic Expressions
107(5)
Arithmetic Operators
107(3)
Increment and Decrement Operators
110(2)
Compound Arithmetic Expressions
112(6)
Precedence Rules
112(1)
Type Coercion and Type Casting
113(4)
May We Introduce: Blaise Pascal
117(1)
Function Calls and Library Functions
118(5)
Value-Returning Functions
118(2)
Library Functions
120(2)
Void Functions
122(1)
Formatting the Output
123(8)
Integers and Strings
123(3)
Floating-Point Numbers
126(3)
Matters of Style: Program Formatting
129(2)
Additional string Operations
131(6)
The length and size Functions
131(1)
The find Function
132(2)
The substr Function
134(2)
Software Engineering Tip: Understanding Before Changing
136(1)
Problem-Solving Case Study: Map Measurements
137(4)
Testing and Debugging
141(1)
Summary
142(11)
Quick Check
142(3)
Exam Preparation Exercises
145(3)
Programming Warm-up Exercises
148(3)
Programming Problems
151(1)
Case Study Follow-Up
152(1)
Program Input and the Software Design Process
153(58)
Getting Data into Programs
154(11)
Input Streams and the Extraction Operator (>>)
155(3)
The Reading Marker and the Newline Character
158(2)
Reading Character Data with the get Function
160(2)
Theoretical Foundations: More About Functions and Arguments
162(1)
Skipping Characters with the ignore Function
162(1)
Reading String Data
163(2)
Interactive Input/Output
165(2)
Noninteractive Input/Output
167(1)
File Input and Output
167(8)
Files
168(1)
Using Files
168(4)
An Example Program Using Files
172(2)
Run-Time Input of File Names
174(1)
Input Failure
175(2)
Software Design Methodologies
177(1)
What Are Objects?
178(1)
Object-Oriented Design
179(2)
Functional Decomposition
181(11)
Modules
182(3)
Implementing the Design
185(6)
A Perspective on Design
191(1)
Software Engineering Tip: Documentation
191(1)
Problem-Solving Case Study: Stretching a Canvas
192(8)
Background Information: Programming on Many Scales
198(2)
Testing and Debugging
200(2)
Testing and Debugging Hints
201(1)
Summary
202(9)
Quick Check
203(1)
Exam Preparation Exercises
204(2)
Programming Warm-up Exercises
206(2)
Programming Problems
208(1)
Case Study Follow-Up
209(2)
Conditions, Logical Expressions, and Selection Control Structures
211(64)
Flow of Control
212(2)
Selection
213(1)
Conditions and Logical Expressions
214(15)
The bool Data Type
214(1)
Background Information: Before the bool Type
215(1)
Logical Expressions
216(8)
May We Introduce: George Boole
224(1)
Precedence of Operators
225(2)
Software Engineering Tip: Changing English Statements into Logical Expressions
227(1)
Relational Operators with Floating-Point Types
228(1)
The If Statement
229(7)
The If-Then-Else Form
229(3)
Blocks (Compound Statements)
232(1)
Matters of Style: Braces and Blocks
233(1)
The If-Then Form
234(2)
A Common Mistake
236(1)
Nested If Statements
236(5)
The Dangling else
240(1)
Testing the State of an I/O Stream
241(2)
Problem-Solving Case Study: Warning Notices
243(6)
Testing and Debugging
249(15)
Testing in the Problem-Solving Phase: The Algorithm Walk-Through
249(4)
Testing in the Implementation Phase
253(6)
The Test Plan
259(1)
Tests Performed Automatically During Compilation and Execution
260(2)
Testing and Debugging Hints
262(2)
Summary
264(11)
Quick Check
264(1)
Exam Preparation Exercises
265(3)
Programming Warm-up Exercises
268(3)
Programming Problems
271(3)
Case Study Follow-Up
274(1)
Looping
275(50)
The While Statement
276(2)
Phases of Loop Execution
278(2)
Loops Using the While Statement
280(12)
Count-Controlled Loops
280(2)
Event-Controlled Loops
282(6)
Looping Subtasks
288(4)
How to Design Loops
292(4)
Designing the Flow of Control
292(2)
Designing the Process Within the Loop
294(1)
The Loop Exit
295(1)
Nested Logic
296(11)
Designing Nested Loops
300(2)
Theoretical Foundations: Analysis of Algorithms
302(5)
Problem-Solving Case Study: Average Income by Gender
307(6)
Testing and Debugging
313(4)
Loop-Testing Strategy
313(1)
Test Plans Involving Loops
314(1)
Testing and Debugging Hints
315(2)
Summary
317(8)
Quick Check
318(1)
Exam Preparation Exercises
318(3)
Programming Warm-up Exercises
321(1)
Programming Problems
322(2)
Case Study Follow-Up
324(1)
Functions
325(66)
Functional Decomposition with Void Functions
326(6)
When to Use Functions
327(1)
Writing Modules as Void Functions
327(4)
May We Introduce: Charles Babbage
331(1)
An Overview of User-Defined Functions
332(4)
Flow of Control in Function Calls
332(1)
Function Parameters
333(3)
Syntax and Semantics of Void Functions
336(8)
Function Call (Invocation)
336(1)
Function Declarations and Definitions
337(3)
Local Variables
340(1)
The Return Statement
341(2)
Matters of Style: Naming Void Functions
343(1)
Header Files
343(1)
Parameters
344(10)
Value Parameters
345(1)
Reference Parameters
346(4)
An Analogy
350(1)
Matching Arguments with Parameters
350(3)
Theoretical Foundations: Argument-Passing Mechanisms
353(1)
Designing Functions
354(9)
Writing Assertions as Program Comments
356(2)
Matters of Style: Function Preconditions and Postconditions
358(1)
Documenting the Direction of Data Flow
358(2)
Matters of Style: Formatting Function Headings
360(1)
Software Engineering Tip: Conceptual Versus Physical Hiding of a Function Implementation
361(2)
Problem-Solving Case Study: Comparison of Furniture-Store Sales
363(9)
Testing and Debugging
372(4)
The assert Library Function
374(2)
Testing and Debugging Hints
376(1)
Summary
376(15)
Quick Check
377(1)
Exam Preparation Exercises
378(5)
Programming Warm-up Exercises
383(2)
Programming Problems
385(5)
Case Study Follow-Up
390(1)
Scope, Lifetime, and More on Functions
391(70)
Scope of Identifiers
392(11)
Scope Rules
395(4)
Variable Declarations and Definitions
399(1)
Namespaces
400(3)
Lifetime of a Variable
403(2)
Initializations in Declarations
404(1)
Interface Design
405(6)
Side Effects
406(3)
Global Constants
409(1)
May We Introduce: Ada Lovelace
409(2)
Value-Returning Functions
411(12)
Boolean Functions
416(3)
Matters of Style: Naming Value-Returning Functions
419(1)
Interface Design and Side Effects
420(1)
When to Use Value-Returning Functions
421(1)
Background Information: Ignoring a Function Value
421(2)
Problem-Solving Case Study: Reformat Dates
423(12)
Software Engineering Tip: Control Abstraction, Functional Cohesion, and Communication Complexity
434(1)
Problem-Solving Case Study: Starship Weight and Balance
435(11)
Testing and Debugging
446(4)
Stubs and Drivers
447(2)
Testing and Debugging Hints
449(1)
Summary
450(11)
Quick Check
451(1)
Exam Preparation Exercises
452(3)
Programming Warm-up Exercises
455(2)
Programming Problems
457(2)
Case Study Follow-Up
459(2)
Additional Control Structures
461(32)
The Switch Statement
462(6)
May We Introduce: Admiral Grace Murray Hopper
466(2)
The Do-While Statement
468(3)
The For Statement
471(3)
The Break and Continue Statements
474(3)
Guidelines for Choosing a Looping Statement
477(1)
Problem-Solving Case Study: Monthly Rainfall Averages
478(6)
Testing and Debugging
484(1)
Testing and Debugging Hints
484(1)
Summary
485(8)
Quick Check
485(1)
Exam Preparation Exercises
486(2)
Programming Warm-up Exercises
488(1)
Programming Problems
489(2)
Case Study Follow-Up
491(2)
Simple Data Types: Built-In and User-Defined
493(84)
Built-In Simple Types
494(8)
Integral Types
496(4)
Floating-Point Types
500(2)
Additional C++ Operators
502(9)
Assignment Operators and Assignment Expressions
503(2)
Increment and Decrement Operators
505(1)
Bitwise Operators
505(1)
The Cast Operation
506(1)
The sizeof Operator
507(1)
The ?: Operator
507(1)
Operator Precedence
508(3)
Working with Character Data
511(9)
Character Sets
511(2)
C++ char Constants
513(2)
Programming Techniques
515(5)
More on Floating-Point Numbers
520(12)
Representation of Floating-Point Numbers
520(3)
Arithmetic with Floating-Point Numbers
523(1)
Implementation of Floating-Point Numbers in the Computer
524(6)
Background Information Practical Implications of Limited Precision
530(1)
Software Engineering Tip Choosing a Numeric Data Type
531(1)
User-Defined Simple Types
532(11)
The Typedef Statement
532(1)
Enumeration Types
533(8)
Named and Anonymous Data Types
541(1)
User-Written Header Files
542(1)
More on Type Coercion
543(4)
Type Coercion in Arithmetic and Relational Expressions
544(1)
Type Coercion in Assignments, Argument Passing, and Return of a Function Value
545(2)
Problem-Solving Case Study: Finding the Area Under a Curve
547(8)
Problem-Solving Case Study: Rock, Paper, Scissors
555(10)
Testing and Debugging
565(3)
Floating-Point Data
565(1)
Coping with Input Errors
566(1)
Testing and Debugging Hints
567(1)
Summary
568(9)
Quick Check
569(1)
Exam Preparation Exercises
570(2)
Programming Warm-up Exercises
572(1)
Programming Problems
573(1)
Case Study Follow-Up
574(3)
Structured Types, Data Abstraction, and Classes
577(86)
Simple Versus Structured Data Types
578(1)
Records (C++ Structs)
579(10)
Accessing Individual Components
582(1)
Aggregate Operations on Structs
583(2)
More About Struct Declarations
585(2)
Hierarchical Records
587(2)
Unions
589(1)
Data Abstraction
590(2)
Abstract Data Types
592(4)
Theoretical Foundations: Categories of Abstract Data Type Operations
595(1)
C++ Classes
596(10)
Matters of Style: Declaring Public and Private Class Members
599(1)
Classes, Class Objects, and Class Members
600(1)
Built-in Operations on Class Objects
601(2)
Class Scope
603(1)
Information Hiding
604(2)
Specification and Implementation Files
606(10)
The Specification File
606(2)
The Implementation File
608(5)
Compiling and Linking a Multifile Program
613(3)
Guaranteed Initialization with Class Constructors
616(5)
Invoking a Constructor
617(1)
Revised Specification and Implementation Files for TimeType
618(2)
Guidelines for Using Class Constructors
620(1)
Problem-Solving Case Study: Manipulating Dates
621(13)
Problem-Solving Case Study: Birthday Calls
634(10)
Testing and Debugging
644(5)
Testing and Debugging Hints
648(1)
Summary
649(14)
Quick Check
650(2)
Exam Preparation Exercises
652(4)
Programming Warm-up Exercises
656(2)
Programming Problems
658(3)
Case Study Follow-Up
661(2)
Arrays
663(80)
One-Dimensional Arrays
664(17)
Declaring Arrays
666(1)
Accessing Individual Components
667(3)
Out-of-Bounds Array Indexes
670(1)
Initializing Arrays in Declarations
671(1)
(Lack of) Aggregate Array Operations
671(2)
Examples of Declaring and Accessing Arrays
673(3)
Passing Arrays as Arguments
676(3)
Background Information: C, C++, and Arrays as Arguments
679(1)
Assertions About Arrays
679(1)
Using Typedef with Arrays
680(1)
Arrays of Records and Class Objects
681(3)
Arrays of Records
681(2)
Arrays of Class Objects
683(1)
Special Kinds of Array Processing
684(1)
Subarray Processing
684(1)
Indexes with Semantic Content
684(1)
Two-Dimensional Arrays
685(4)
Processing Two-Dimensional Arrays
689(6)
Sum the Rows
690(1)
Sum the Columns
691(1)
Initialize the Array
692(2)
Print the Array
694(1)
Passing Two-Dimensional Arrays as Arguments
695(3)
Another Way of Defining Two-Dimensional Arrays
698(2)
Multidimensional Arrays
700(3)
Problem-Solving Case Study: Comparison of Two Lists
703(7)
Problem-Solving Case Study: City Council Election
710(11)
Testing and Debugging
721(5)
One-Dimensional Arrays
721(1)
Complex Structures
722(1)
Multidimensional Arrays
723(2)
Testing and Debugging Hints
725(1)
Summary
726(17)
Quick Check
726(3)
Exam Preparation Exercises
729(5)
Programming Warm-up Exercises
734(3)
Programming Problems
737(4)
Case Study Follow-Up
741(2)
Array-Based Lists
743(58)
The List as an Abstract Data Type
744(4)
Unsorted Lists
748(10)
Basic Operations
748(3)
Insertion and Deletion
751(1)
Sequential Search
752(3)
Sorting
755(3)
Sorted Lists
758(15)
Basic Operations
761(1)
Insertion
761(3)
Sequential Search
764(1)
Binary Search
765(5)
Deletion
770(2)
Theoretical Foundations: Complexity of Searching and Sorting
772(1)
Understanding Character Strings
773(10)
Initializing C Strings
776(1)
C String Input and Output
777(4)
C String Library Routines
781(2)
String Class or C Strings?
783(1)
Problem-Solving Case Study: Exam Attendance
783(9)
Testing and Debugging
792(1)
Testing and Debugging Hints
792(1)
Summary
793(8)
Quick Check
793(2)
Exam Preparation Exercises
795(2)
Programming Warm-up Exercises
797(1)
Programming Problems
798(1)
Case Study Follow-Up
799(2)
Object-Oriented Software Development
801(66)
Object-Oriented Programming
802(2)
Objects
804(1)
Inheritance
805(12)
Deriving One Class from Another
807(3)
Software Engineering Tip: Inheritance and Accessibility
810(1)
Specification of the ExtTime Class
811(1)
Implementation of the ExtTime Class
812(4)
Avoiding Multiple Inclusion of Header Files
816(1)
Composition
817(5)
Design of a TimeCard Class
818(2)
Implementation of the TimeCard Class
820(2)
Dynamic Binding and Virtual Functions
822(5)
The Slicing Problem
823(2)
Virtual Functions
825(2)
Object-Oriented Design
827(4)
Identify the Objects and Operations
828(1)
Determine the Relationships Among Objects
829(1)
Design the Driver
830(1)
Software Engineering Tip: The Iterative Nature of Object-Oriented Design
830(1)
Implementing the Design
831(1)
Problem-Solving Case Study: Time Card Lookup
832(22)
Testing and Debugging
854(1)
Testing and Debugging Hints
854(1)
Summary
855(12)
Quick Check
856(2)
Exam Preparation Exercises
858(4)
Programming Warm-up Exercises
862(1)
Programming Problems
863(1)
Case Study Follow-Up
864(3)
Pointers, Dynamic Data, and Reference Types
867(76)
Pointers
868(11)
Pointer Variables
869(6)
Pointer Expressions
875(4)
Dynamic Data
879(5)
Reference Types
884(6)
Classes and Dynamic Data
890(11)
Class Destructors
894(1)
Shallow Versus Deep Copying
895(2)
Class Copy-Constructors
897(4)
Problem-Solving Case Study: Personnel Records
901(16)
Problem-Solving Case Study: Dynamic Arrays
917(11)
Testing and Debugging
928(3)
Testing and Debugging Hints
930(1)
Summary
931(12)
Quick Check
932(2)
Exam Preparation Exercises
934(3)
Programming Warm-up Exercises
937(2)
Programming Problems
939(1)
Case Study Follow-Up
940(3)
Linked Structures
943(70)
Sequential Versus Linked Structures
944(2)
Array Representation of a Linked List
946(2)
Dynamic Data Representation of a Linked List
948(29)
Algorithms on Dynamic Linked Lists
956(19)
Pointer Expressions
975(1)
Classes and Dynamic Linked Lists
976(1)
Choice of Data Representation
977(2)
Problem-Solving Case Study: Simulated Playing Cards
979(7)
Problem-Solving Case Study: Solitaire Simulation
986(20)
Testing and Debugging
1006(1)
Testing and Debugging Hints
1006(1)
Summary
1006(7)
Quick Check
1007(1)
Exam Preparation Exercises
1008(2)
Programming Warm-up Exercises
1010(1)
Programming Problems
1011(1)
Case Study Follow-Up
1012(1)
Recursion
1013
What Is Recursion?
1014(4)
Recursive Algorithms with Simple Variables
1018(3)
Towers of Hanoi
1021(5)
Recursive Algorithms with Structured Variables
1026(3)
Recursion Using Pointer Variables
1029(7)
Printing a Dynamic Linked List in Reverse Order
1029(3)
Copying a Dynamic Linked List
1032(4)
Recursion or Iteration?
1036(1)
Problem-Solving Case Study: Converting Decimal Integers to Binary Integers
1037(3)
Problem-Solving Case Study Minimum Value in an Integer Array
1040(3)
Testing and Debugging
1043(1)
Testing and Debugging Hints
1043(1)
Summary
1043
Quick Check
1044(1)
Exam Preparation Exercises
1044(2)
Programming Warm-up Exercises
1046(2)
Programming Problems
1048(1)
Case Study Follow-Up
1049
Appendix A Reserved Words 1(1)
Appendix B Operator Precedence 1(2)
Appendix C A Selection of Standard Library Routines 3(9)
Appendix D Using This Book with a Prestandard Version of C++ 12(4)
Appendix E Character Sets 16(2)
Appendix F Program Style, Formatting, and Documentation 18(9)
Glossary 27(10)
Answers to Selected Exercises 37(30)
Index 67

Supplemental Materials

What is included with this book?

The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.

The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.

Rewards Program