rent-now

Rent More, Save More! Use code: ECRENTAL

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

9780763714246

Programming in C++

by ; ;
  • ISBN13:

    9780763714246

  • ISBN10:

    0763714240

  • Edition: 2nd
  • Format: Paperback
  • Copyright: 2000-07-01
  • Publisher: Lightning Source Inc
  • View Upgraded Edition
  • 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: $93.95 Save up to $0.09
  • Buy New
    $93.86
    Add to Cart Free Shipping Icon Free Shipping

    USUALLY SHIPS IN 3-5 BUSINESS DAYS

Summary

This is a no frills version of the best-selling Programming & Problem Solving with C++, 2/e. Programming in C++, offering a straightforward introduction to programming that is intended for non-major programming students. Although this second edition incorporates numerous changes (conformance to ISO/ANSI standard C++, & an earlier introduction to classes, data abstraction, & object-oriented concepts) one thing has not changed: their commitment to the students. In addition, data abstraction & abstract data types (ADTs) are explained in conjunction with the C++ class mechanism, forming a natural lead-in to the important topics of object-oriented programming.In reference to object-oriented programming, Programming in C++ has taken a more heterogeneous approach in which both functional decomposition & object-oriented design are presented as design tools.

Table of Contents

Overview of Programming and Problem Solving
1(24)
Overview of Programming
2(5)
What Is Programming?
2(1)
How Do We Write a Program?
2(5)
What Is a Programming Language?
7(4)
What Is a Computer?
11(4)
Ethics and Responsibilities in the Computing Profession
15(2)
Software Piracy
15(1)
Privacy of Data
16(1)
Use of Computer Resources
16(1)
Software Engineering
17(1)
Problem-Solving Techniques
17(8)
Ask Questions
18(1)
Look for Things That Are Familiar
19(1)
Solve by Analogy
19(1)
Means-Ends Analysis
19(1)
Divide and Conquer
20(1)
The Building-Block Approach
20(1)
Merging Solutions
21(1)
Mental Blocks: The Fear of Starting
22(1)
Algorithmic Problem Solving
22(1)
Summary
22(3)
C++ Syntax and Semantics, and the Program Development Process
25(44)
The Elements of C++ Programs
26(18)
C++ Program Structure
26(2)
Syntax and Semantics
28(2)
Syntax Templates
30(1)
Naming Program Elements: Identifiers
31(2)
Data and Data Types
33(1)
Naming Elements: Declarations
34(4)
Taking Action: Executable Statements
38(5)
Beyond Minimalism: Adding Comments to a Program
43(1)
Program Construction
44(6)
Blocks (Compound Statements)
46(1)
The C++ Preprocessor
47(2)
An Introduction to Namespaces
49(1)
More About Output
50(19)
Creating Blank Lines
50(1)
Inserting Blanks Within a Line
51(2)
Programming Example: Contest Letter
53(4)
Testing and Debugging
57(2)
Summary
59(1)
Quick Check
59(3)
Exam Preparation Exercises
62(3)
Programming Warm-up Exercises
65(2)
Programming Problems
67(2)
Numeric Types, Expressions, and Output
69(46)
Overview of C++ Data Types
70(1)
Numeric Data Types
70(3)
Integral Types
71(1)
Floating-Point Types
72(1)
Declarations for Numeric Types
73(1)
Named Constant Declarations
73(1)
Variable Declarations
74(1)
Simple Arithmetic Expressions
74(4)
Arithmetic Operators
75(3)
Increment and Decrement Operators
78(1)
Compound Arithmetic Expressions
78(5)
Precedence Rules
79(1)
Type Coercion and Type Casting
80(3)
Function Calls and Library Functions
83(4)
Value-Returning Functions
83(2)
Library Functions
85(1)
Void Functions
86(1)
Formatting the Output
87(7)
Integers and Strings
87(3)
Floating-Point Numbers
90(4)
Additional string Operations
94(21)
The length and size Functions
94(1)
The find Function
95(2)
The substr Function
97(2)
Programming Example: Map Measurements
99(3)
Testing and Debugging
102(1)
Summary
103(1)
Quick Check
103(3)
Exam Preparation Exercises
106(3)
Programming Warm-up Exercises
109(4)
Programming Problems
113(2)
Program Input and the Software Design Process
115(42)
Getting Data into Programs
116(9)
Input Streams and the Extraction Operator (>>)
116(3)
The Reading Marker and the Newline Character
119(1)
Reading Character Data with the get Function
120(2)
Skipping Characters with the ignore Function
122(1)
Reading String Data
123(2)
Interactive Input/Output
125(1)
Noninteractive Input/Output
126(1)
File Input and Output
127(7)
Files
127(1)
Using Files
127(3)
An Example Program Using Files
130(3)
Run-Time Input of File Names
133(1)
Input Failure
134(1)
Software Design Methodologies
135(1)
What Are Objects?
136(2)
Object-Oriented Design
138(1)
Functional Decomposition
138(19)
Modules
140(1)
A Perspective on Design
141(1)
Programming Example: Stretching a Canvas
142(5)
Testing and Debugging
147(1)
Testing and Debugging Hints
148(1)
Summary
149(1)
Quick Check
150(1)
Exam Preparation Exercises
151(2)
Programming Warm-up Exercises
153(2)
Programming Problems
155(2)
Conditions, Logical Expressions, and Selection Control Structures
157(48)
Flow of Control
158(1)
Selection
159(1)
Conditions and Logical Expressions
159(9)
The bool Data Type
159(1)
Logical Expressions
160(6)
Precedence of Operators
166(1)
Relational Operators with Floating-Point Types
167(1)
The If Statement
168(6)
The If-Then-Else Form
169(1)
Blocks (Compound Statements)
170(2)
The If-Then Form
172(1)
A Common Mistake
173(1)
Nested If Statements
174(4)
The Dangling else
176(2)
Testing the State of an I/O Stream
178(27)
Programming Example: Warning Notices
180(3)
Testing and Debugging
183(1)
Testing in the Problem-Solving Phase: The Algorithm Walk-Through
184(2)
Testing in the Implementation Phase
186(5)
The Test Plan
191(1)
Tests Performed Automatically During Compilation and Execution
192(1)
Testing and Debugging Hints
193(2)
Summary
195(1)
Quick Check
195(1)
Exam Preparation Exercises
196(3)
Programming Warm-up Exercises
199(3)
Programming Problems
202(3)
Looping
205(30)
The While Statement
206(2)
Phases of Loop Execution
208(1)
Loops Using the While Statement
208(6)
Count-Controlled Loops
209(1)
Event-Controlled Loops
209(3)
Looping Subtasks
212(2)
How to Design Loops
214(3)
Designing the Flow of Control
215(1)
Designing the Process Within the Loop
216(1)
The Loop Exit
217(1)
Nested Logic
217(18)
Designing Nested Loops
219(1)
Programming Example: Average Income by Gender
220(3)
Testing and Debugging
223(1)
Loop-Testing Strategy
223(1)
Test Plans Involving Loops
224(1)
Testing and Debugging Hints
225(2)
Summary
227(1)
Quick Check
227(1)
Exam Preparation Exercises
228(3)
Programming Warm-up Exercises
231(1)
Programming Problems
232(3)
Functions
235(46)
Functional Decomposition with Void Functions
236(3)
Writing Modules as Void Functions
236(3)
An Overview of User-Defined Functions
239(2)
Flow of Control in Function Calls
239(1)
Function Parameters
240(1)
Syntax and Semantics of Void Functions
241(6)
Function Call (Invocation)
241(1)
Function Declarations and Definitions
242(2)
Local Variables
244(1)
The Return Statement
245(1)
Header Files
246(1)
Parameters
247(3)
Value Parameters
248(1)
Reference Parameters
249(1)
Designing Functions
250(31)
Writing Assertions as Program Comments
252(2)
Documenting the Direction of Data Flow
254(3)
Programming Example: Comparison of Furniture-Store Sales
257(6)
Testing and Debugging
263(2)
The assert Library Function
265(1)
Testing and Debugging Hints
266(1)
Summary
267(1)
Quick Check
268(1)
Exam Preparation Exercises
269(6)
Programming Warm-up Exercises
275(2)
Programming Problems
277(4)
Scope, Lifetime, and More on Functions
281(42)
Scope of Identifiers
282(9)
Scope Rules
284(3)
Variable Declarations and Definitions
287(1)
Namespaces
288(3)
Lifetime of a Variable
291(2)
Initializations in Declarations
292(1)
Interface Design
293(2)
Side Effects
294(1)
Global Constants
294(1)
Value-Returning Functions
295(28)
Boolean Functions
299(1)
Interface Design for Value-Returning Functions
300(1)
When to Use Value-Returning Functions
300(2)
Programming Example: Starship Weight and Balance
302(8)
Testing and Debugging
310(1)
Stubs and Drivers
310(1)
Testing and Debugging Hints
311(1)
Summary
312(1)
Quick Check
312(1)
Exam Preparation Exercises
313(4)
Programming Warm-up Exercises
317(2)
Programming Problems
319(4)
Additional Control Structures
323(26)
The Switch Statement
324(3)
The Do-While Statement
327(3)
The For Statement
330(2)
The Break and Continue Statements
332(3)
Guidelines for Choosing a Looping Statement
335(14)
Programming Example: Monthly Rainfall Averages
336(4)
Testing and Debugging
340(1)
Testing and Debugging Hints
340(1)
Summary
341(1)
Quick Check
341(1)
Exam Preparation Exercises
342(2)
Programming Warm-up Exercises
344(2)
Programming Problems
346(3)
Simple Data Types: Built-In and User-Defined
349(52)
Built-In Simple Types
350(4)
Integral Types
352(1)
Floating-Point Types
353(1)
Additional C++ Operators
354(6)
Assignment Operators and Assignment Expressions
356(1)
Increment and Decrement Operators
357(1)
Bitwise Operators
358(1)
The Cast Operation
358(1)
The sizeof Operator
358(1)
The ?: Operator
359(1)
Operator Precedence
359(1)
Working with Character Data
360(7)
Character Sets
361(1)
C++ char Constants
362(1)
Programming Techniques
363(4)
More on Floating-Point Numbers
367(5)
Representation of Floating-Point Numbers
367(3)
Arithmetic with Floating-Point Numbers
370(2)
User-Defined Simple Types
372(8)
The Typedef Statement
372(1)
Enumeration Types
373(6)
Named and Anonymous Data Types
379(1)
User-Written Header Files
380(1)
More on Type Coercion
380(21)
Type Coercion in Arithmetic and Relational Expressions
381(1)
Type Coercion in Assignments, Argument Passing, and Return of a Function Value
382(2)
Programming Example: Rock, Paper, Scissors
384(7)
Testing and Debugging
391(1)
Floating-Point Data
391(1)
Coping with Input Errors
391(1)
Testing and Debugging Hints
392(1)
Summary
393(1)
Quick Check
393(2)
Exam Preparation Exercises
395(2)
Programming Warm-up Exercises
397(1)
Programming Problems
398(3)
Structured Types, Data Abstraction, and Classes
401(74)
Simple Versus Structured Data Types
402(1)
Records (C++ Structs)
403(9)
Accessing Individual Components
405(2)
Aggregate Operations on Structs
407(2)
More About Struct Declarations
409(1)
Hierarchical Records
409(3)
Unions
412(1)
Data Abstraction
413(2)
Abstract Data Types
415(2)
C++ Classes
417(8)
Classes, Class Objects, and Class Members
419(2)
Built-in Operations on Class Objects
421(2)
Class Scope
423(1)
Information Hiding
423(2)
Specification and Implementation Files
425(9)
The Specification File
425(2)
The Implementation File
427(4)
Compiling and Linking a Multifile Program
431(3)
Guaranteed Initialization with Class Constructors
434(41)
Invoking a Constructor
435(1)
Revised Specification and Implementation Files for TimeType
436(2)
Guidelines for Using Class Constructors
438(2)
Programming Example: Manipulating Dates
440(9)
Programming Example: Birthday Calls
449(7)
Testing and Debugging
456(3)
Testing and Debugging Hints
459(1)
Summary
460(1)
Quick Check
461(3)
Exam Preparation Exercises
464(4)
Programming Warm-up Exercises
468(2)
Programming Problems
470(5)
Arrays
475(70)
One-Dimensional Arrays
476(14)
Declaring Arrays
478(1)
Accessing Individual Components
479(2)
Out-of-Bounds Array Indexes
481(1)
Initializing Arrays in Declarations
482(1)
(Lack of) Aggregate Array Operations
483(1)
Examples of Declaring and Accessing Arrays
484(3)
Passing Arrays as Arguments
487(2)
Assertions About Arrays
489(1)
Using Typedef with Arrays
490(1)
Arrays of Records and Class Objects
490(3)
Arrays of Records
491(1)
Arrays of Class Objects
492(1)
Special Kinds of Array Processing
493(1)
Subarray Processing
493(1)
Indexes with Semantic Content
494(1)
Two-Dimensional Arrays
494(4)
Processing Two-Dimensional Arrays
498(5)
Sum the Rows
499(1)
Sum the Columns
500(1)
Initialize the Array
501(1)
Print the Array
502(1)
Passing Two-Dimensional Arrays as Arguments
503(2)
Another Way of Defining Two-Dimensional Arrays
505(2)
Multidimensional Arrays
507(38)
Programming Example: Comparison of Two Lists
510(5)
Programming Example: City Council Election
515(8)
Testing and Debugging
523(1)
One-Dimensional Arrays
523(1)
Complex Structures
524(1)
Multidimensional Arrays
525(1)
Testing and Debugging Hints
526(1)
Summary
527(1)
Quick Check
528(3)
Exam Preparation Exercises
531(5)
Programming Warm-up Exercises
536(3)
Programming Problems
539(6)
Array-Based Lists
545(52)
The List as an Abstract Data Type
546(4)
Unsorted Lists
550(8)
Basic Operations
550(2)
Insertion and Deletion
552(2)
Sequential Search
554(1)
Sorting
555(3)
Sorted Lists
558(14)
Basic Operations
561(1)
Insertion
561(3)
Sequential Search
564(1)
Binary Search
565(5)
Deletion
570(2)
Understanding Character Strings
572(25)
Initializing C Strings
574(1)
C String Input and Output
575(4)
C String Library Routines
579(1)
String Class or C Strings?
580(1)
Programming Example: Exam Attendance
581(6)
Testing and Debugging
587(1)
Testing and Debugging Hints
588(1)
Summary
588(1)
Quick Check
589(1)
Exam Preparation Exercises
590(2)
Programming Warm-up Exercises
592(2)
Programming Problems
594(3)
Object-Oriented Software Development
597(58)
Object-Oriented Programming
598(2)
Objects
600(1)
Inheritance
601(12)
Deriving One Class from Another
602(4)
Specification of the ExtTime Class
606(2)
Implementation of the ExtTime Class
608(4)
Avoiding Multiple Inclusion of Header Files
612(1)
Composition
613(4)
Design of a TimeCard Class
613(1)
Implementation of the TimeCard Class
614(3)
Dynamic Binding and Virtual Functions
617(5)
The Slicing Problem
618(2)
Virtual Functions
620(2)
Object-Oriented Design
622(3)
Identify the Objects and Operations
622(1)
Determine the Relationships Among Objects
623(1)
Design the Driver
624(1)
Implementing the Design
625(30)
Programming Example: Time Card Lookup
626(19)
Testing and Debugging
645(1)
Testing and Debugging Hints
645(2)
Summary
647(1)
Quick Check
647(3)
Exam Preparation Exercises
650(1)
Programming Warm-up Exercises
651(2)
Programming Problems
653(2)
Recursion
655(18)
What is Recursion?
656(4)
Towers of Hanoi
660(5)
Recursive Algorithms with Structured Variables
665(1)
Recursion or Iteration?
666(7)
Testing and Debugging
668(1)
Testing and Debugging Hints
668(1)
Summary
669(1)
Quick Check
669(1)
Exam Preparation Exercises
669(2)
Programming Warm-up Exercises
671(1)
Programming Problems
672(1)
Appendix A Reserved Words 673(1)
Appendix B Operator Precedence 673(2)
Appendix C A Selection of Standard Library Routines 675(9)
Appendix D Using This Book with a Prestandard Version of C++ 684(5)
Appendix E Character Sets 689(3)
Appendix F Program Style, Formatting, and Documentation 692(7)
Glossary 699(8)
Answers to Selected Exercises 707(22)
Index 729

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