9780137443925

C++ : An Introduction to Computing

by ;
  • ISBN13:

    9780137443925

  • ISBN10:

    0137443927

  • Edition: 3rd
  • Format: Paperback
  • Copyright: 2003-01-01
  • Publisher: Prentice Hall
  • View Upgraded Edition
  • Purchase Benefits
  • 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.
  • Get Rewarded for Ordering Your Textbooks! Enroll Now
List Price: $123.00 Save up to $3.69
  • Buy New
    $119.31
    Add to Cart Free Shipping

    CURRENTLY AVAILABLE, USUALLY SHIPS IN 24-48 HOURS

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.

Summary

For the introduction to Programming course (CS 1) using C++ offered in computer science, engineering, and mathematics departments. Introduces key ideas behind computing with C++, and object-oriented programming in an intuitive and unintimidating way. Includes a comprehensive, on-line instructor's support package.

Table of Contents

Chapter 0. BEGINNING SNAPSHOTS
1(28)
Part of the Picture: What Is Computer Science?
2(2)
Part of the Picture: The History of Computing
4(6)
Early Computing Devices
4(1)
The Stored Program Concept
4(1)
Mechanical Computers
5(1)
Early Electronic Computers
6(1)
Modern Computers
6(1)
System Software
7(1)
A Brief History of C++ and OOP
8(2)
Part of the Picture: Computing History
10(8)
Exercises
17(1)
Part of the Picture: Introduction to Computer Organization
18(3)
Computing Systems
18(1)
Memory Organization
19(2)
Exercises
21(1)
Part of the Picture: Ethics and Computing
21(8)
Anne Marchant
Exercises
26(3)
Chapter 1. PROBLEM SOLVING AND SOFTWARE ENGINEERING
29(22)
1.1 Welcome to the World of C++
32(2)
1.2 Problem Solving through Software Engineering
34(9)
Problem
34(1)
Object-Centered Design
35(4)
Coding in C++
39(1)
Testing, Execution, and Debugging
40(2)
Maintenance
42(1)
1.3 Example: Revenue Calculation
43(8)
Problem
43(1)
Object-Centered Design
43(2)
Coding in C++
45(1)
Testing, Execution, and Debugging
46(1)
Program Maintenance
46(2)
Quick Quiz 1.3
48(1)
Exercises 1.3
48(3)
Chapter 2. TYPES AND EXPRESSIONS
51(78)
2.1 Introductory Example: Einstein's Equation
52(3)
Problem
52(1)
Object-Centered Design
52(1)
Coding, Execution, and Testing
53(2)
2.2 Declarations: Specifying an Object's Type
55(14)
Fundamental Types
55(7)
Constant Objects
62(2)
Variable Objects
64(2)
Variable Initialization
66(1)
Quick Quiz 2.2
67(1)
Exercises 2.2
68(1)
Part of the Picture: Data Representation
69(4)
Integers
69(2)
Reals
71(1)
Characters and Strings
72(1)
Booleans
73(1)
2.3 Numeric Expressions
73(9)
Operators
74(4)
Numeric Functions
78(3)
Quick Quiz 2.3
81(1)
Exercises 2.3
81(1)
2.4 Boolean Expressions
82(8)
Simple Boolean Expressions
83(1)
Compound Boolean Expressions
84(2)
Operator Precedence
86(1)
Short-Circuit Evaluation
87(1)
Preconditions and the assert () Mechanism
88(1)
Quick Quiz 2.4
89(1)
Exercises 2.4
89(1)
2.5 Character Expressions
90(2)
Character-Processing Operations
91(1)
Quick Quiz 2.5
91(1)
2.6 Assignment Expressions
92(12)
Assignment as an Operation
96(1)
Chaining Assignment Operators
96(1)
The Increment and Decrement Operations
97(2)
Other Assignment Shortcuts
99(2)
Transforming Expressions into Statements--Semicolons
101(1)
A Final Word
102(1)
Quick Quiz 2.6
102(1)
Exercises 2.6
103(1)
2.7 Input/Output Expressions
104(11)
I/O Streams
104(1)
Input Expressions
105(3)
Output Expressions
108(2)
Example: Calculating Wages
110(1)
Output Formatting
111(4)
2.8 Example: Truck Fleet Accounting
115(6)
Problem
115(1)
Object-Centered Design
115(3)
Quick Quiz 2.8
118(1)
Exercises 2.8
119(2)
Programming Pointers
121(4)
Program Style and Design
121(1)
Potential Problems
122(3)
Programming Problems
125(4)
Chapter 3. FUNCTIONS
129(76)
3.1 Computing with Expressions
130(2)
Problem: Temperature Conversion
130(1)
Object-Centered Design
130(2)
3.2 Computing with Functions
132(16)
Defining a Function
134(4)
Function Prototypes
138(2)
Calling a Function
140(1)
Local Objects
140(2)
Functions that Return Nothing
142(2)
Summary
144(2)
Quick Quiz 3.2
146(1)
Exercises 3.2
147(1)
3.3 Functions that Use Selection
148(11)
Problem: Finding a Minimum of Two Values
148(1)
Object-Centered Design
148(3)
Sequential Execution
151(1)
Selective Execution
152(1)
Blocks
153(1)
Style
154(2)
Nested ifs
156(1)
Quick Quiz 3.3
157(1)
Exercises 3.3
158(1)
3.4 Functions that Use Repetition
159(16)
Problem: Computing Factorials
159(1)
Object-Centered Design
160(3)
Repeated Execution: The for Statement
163(3)
Processing Several Input Values
166(5)
Quick Quiz 3.4
171(2)
Exercises 3.4
173(2)
3.5 Example: An 8-Function Calculator
175(7)
Problem
175(1)
Object-Centered Design
175(7)
3.6 An Introduction to Libraries
182(11)
Constructing a Library
183(4)
Using a Library in a Program
187(1)
Translating a Library
188(2)
Object-Centered Design: Incorporating Functions and Libraries
190(1)
Summary
191(2)
Quick Quiz 3.6
193(1)
Part of the Picture: Computability Theory
193(12)
Programming Pointers
194(1)
Program Style and Design
194(2)
Potential Problems
196(4)
Programming Problems
200(5)
Chapter 4. CLASS TYPES AND EXPRESSIONS
205(58)
4.1 Introductory Example: "The Farmer in the Dell"
206(6)
Problem
206(1)
Object-Centered Design
207(5)
4.2 Introduction to Classes
212(5)
Data Encapsulation
213(2)
Function Members
215(1)
Summary
216(1)
Quick Quiz 4.2
216(1)
4.3 The istream and ostream Classes
217(13)
The istream Class
217(5)
The ostream Class
222(3)
Format Control
225(3)
Quick Quiz 4.3
228(1)
Exercises 4.3
229(1)
4.4 Computing with string Objects
230(17)
Declaring string Objects
231(1)
String I/O
232(1)
Other String Operations
233(12)
Quick Quiz 4.4
245(1)
Exercises 4.4
246(1)
4.5 Example: Decoding Phone Numbers
247(5)
Problem
247(1)
Object-Centered Design
248(4)
Part of the Picture: Simulation
252(11)
Random Number Generators--the RandomInt Class
253(1)
Example: Modeling a Dice Roll
254(2)
Normal Distributions
256(1)
Programming Pointers
257(1)
Program Style and Design
257(1)
Potential Problems
257(1)
Programming Problems
258(5)
Chapter 5: SELECTION
263(56)
5.1 Introductory Example: The School Mascot Problem
264(4)
Problem
264(1)
Object-Centered Design
264(4)
5.2 Selection: The if Statement Revisited
268(6)
Understanding the Multibranch if
269(1)
Pitfall: The Dangling-else Problem
270(1)
Pitfall: Confusing = and ==
271(2)
Exercises 5.2
273(1)
5.3 Selection: The switch Statement
274(12)
Example: Temperature Conversions
274(4)
Form of the switch Statement
278(1)
The break Statement
279(1)
Drop-Through Behavior
279(1)
Example: Converting Numeric Codes to Names
280(3)
Cases With No Action
283(1)
Choosing the Proper Selection Statement
284(2)
5.4 Example: Computing Letter Grades
286(7)
Problem
286(1)
Object-Centered Design
286(5)
Quick Quiz 5.4
291(1)
Exercises 5.4
292(1)
*5.5 Selection: Conditional Expressions
293(3)
Exercises 5.5
295(1)
Part of the Picture: Boolean Logic and Digital Design
296(4)
Early Work
296(1)
Digital Circuits
297(1)
Circuit Design: A Binary Half-Adder
297(3)
Part of the Picture: Computer Architecture
300(19)
William Stallings
Processor Registers
301(1)
Control and Status Registers
302(1)
Instruction Execution
303(1)
Instruction Fetch and Execution
303(1)
I/O Function
304(1)
The Memory Hierarchy
305(2)
Input/Output Organization
307(1)
I/O Module Function
307(2)
To Probe Further
309(1)
Programming Pointers
309(1)
Program Style and Design
309(4)
Potential Problems
313(1)
Programming Problems
313(6)
Chapter 6: REPETITION
319(64)
6.1 Introductory Example: The Punishment of Gauss
320(3)
The Summation Problem
320(1)
Object-Centered Design
320(3)
6.2 Repetition: The for Loop Revisited
323(10)
Nested Loops: Displaying a Multiplication Table
327(2)
Words of Warning
329(1)
The Forever Loop
330(3)
6.3 Repetition: The while Loop
333(6)
Example: Follow the Bouncing Ball
333(1)
Object-Centered Design
333(3)
The while Statement
336(1)
Loop Conditions vs. Termination Conditions
337(1)
Words of Warning
338(1)
6.4 Repetition: The do Loop
339(11)
Example: How Many Digits?
339(1)
Object-Centered Design
339(4)
A Posttest Loop
343(1)
Loop Conditions vs. Termination Conditions
344(1)
Words of Warning
344(1)
Quick Quiz 6.4
345(2)
Exercises 6.4
347(3)
6.5 Input Loops
350(14)
Running Example: The Mean Time to Failure Problem
350(1)
Object-Centered Design
350(1)
Input Loops: The Sentinel Approach
351(7)
Input Loops: The Counting Approach
358(2)
Input Loops: The Query Approach
360(4)
6.6 Choosing the Right Loop
364(2)
Decision #1: Use a Counting Loop or a General Loop?
364(1)
Decision #2: Which General Loop?
364(2)
Quick Quiz 6.6
366(1)
6.7 Example: Calculating Depreciation
366(7)
Problem
366(1)
Object-Centered Design
367(6)
Part of the Picture: Introduction to Algorithm Analysis
373(10)
Programming Pointers
375(1)
Program Style and Design
375(1)
Potential Problems
376(3)
Programming Problems
379(4)
Chapter 7: FUNCTIONS IN DEPTH
383(78)
7.1 Introductory Example: One-Step Integer Division
384(4)
Problem
384(1)
Object-Centered Design
384(4)
7.2 Parameters in Depth
388(7)
Value Parameters
388(1)
Reference Parameters
389(3)
const Reference Parameters
392(3)
Using Parameters
395(1)
7.3 Examples of Parameter Usage
395(13)
Problem 1: Decomposing a Name
395(3)
Problem 2: Designing a Coin Dispenser
398(6)
Problem 3: Interchanging the Values of Two Variables
404(1)
Quick Quiz 7.3
405(1)
Exercises 7.3
406(2)
7.4 Inline Functions
408(3)
Inline Functions and Libraries
409(1)
To inline or Not to inline: A Space-Time Tradeoff
410(1)
Quick Quiz 7.4
410(1)
7.5 Scope, Overloading, and Templates
411(15)
Scope: Identifier Accessibility
412(7)
Function Signatures and Overloading
419(2)
Function Templates
421(4)
Quick Quiz 7.5
425(1)
*7.6 Introduction to Recursion
426(20)
Example 1: The Factorial Problem Revisited
426(7)
Example 2: Recursive Exponentiation
433(2)
Example 3: Dry Bones!
435(4)
Example 4: Towers of Hanoi
439(3)
Recursion or Iteration?
442(1)
Quick Quiz 7.6
443(1)
Exercises 7.6
444(2)
Part of the Picture: Numerical Methods
446(15)
The Trapezoid Method of Approximating Areas
447(3)
Problem: Road Construction
450(1)
Object-Centered Design
450(3)
Programming Pointers
453(1)
Program Style and Design
453(1)
Potential Problems
454(2)
Programming Problems
456(5)
Chapter 8: FILES AND STREAMS
461(58)
8.1 Introductory Example: Weather Data Analysis
462(6)
Problem: Processing Meteorological Data
462(1)
Object-Centered Design
463(5)
8.2 ifstream and ofstream Objects
468(20)
Declaring fstream Objects
468(1)
The Basic fstream Operations
469(16)
fstreams as Parameters
485(1)
Summary
485(1)
Quick Quiz 8.2
486(1)
Exercises 8.2
487(1)
8.3 Example: Scanning for a Virus
488(3)
8.4 Additional fstream Operations
491(14)
The seekg(), tellg(), seekp(), and tellp() Members
492(6)
The peek() and putback() Members
498(2)
The setstate() Member
500(2)
The Formatting Manipulators
502(2)
Quick Quiz 8.4
504(1)
Part of the Picture: Database Systems
505(14)
Keith Vander Linden
Programming Pointers
511(1)
Program Style and Design
511(1)
Potential Problems
512(2)
Programming Problems
514(5)
Chapter 9: ARRAYS AND vector T S
519(66)
9.1 Introductory Example: Quality Control
520(5)
Problem: Mean Time to Failure
520(1)
Object-Centered Design
521(4)
9.2 C-Style Arrays
525(19)
Array Initialization
528(2)
The Subscript Operation
530(1)
Processing Arrays with for Loops
531(1)
Arrays as Parameters
532(1)
The typedef Mechanism
532(2)
Out-of-Range Errors
534(2)
Predefined Array Operations
536(1)
A Non-OOP Approach
537(3)
An Object-Oriented Approach
540(1)
Quick Quiz 9.2
541(1)
Exercises 9.2
542(2)
9.3 Example: Sorting Employee Information
544(3)
Problem
544(1)
Object-Centered Design
544(3)
9.4 The vector T Class Template
547(20)
A Quick Review of Function Templates
547(1)
Class Templates
548(1)
Defining vector T Objects
548(2)
vector T Function Members
550(3)
vector T Operators
553(5)
The Standard Template Library
558(6)
vector T Function Members Involving Iterators
564(1)
Decision Making: Use a vector T or a C-Style Array?
565(1)
Array and vector T Limitations
566(1)
9.5 Example: Processing Test Scores
567(10)
Problem
567(1)
Object-Centered Design
567(7)
Quick Quiz 9.5
574(1)
Exercises 9.5
575(2)
Part of the Picture: Component Programming
577(8)
Computer Hardware
578(1)
Computer Software
578(1)
Programming Pointers
579(1)
Program Style and Design
579(1)
Potential Problems
579(2)
Programming Problems
581(4)
Chapter 10: BUILDING CLASSES
585(64)
10.1 Introductory Example: Modeling Temperatures
586(4)
Problem: Temperature Conversion
586(1)
Preliminary Analysis
586(1)
Extending Object-Centered Design
587(1)
Object-Centered Design
588(2)
10.2 Designing a Class
590(3)
Class Design
591(1)
The External and Internal Perspectives
591(1)
Temperature Behavior
592(1)
Temperature Attributes
592(1)
10.3 Implementing Class Attributes
593(4)
Encapsulation
593(1)
Information Hiding
594(1)
Class Invariants
595(1)
Conditional Compilation and the Class "Wrapper"
595(2)
10.4 Implementing Class Operations
597(24)
Temperature Output
597(3)
The Default-Value Constructor
600(2)
Explicit-Value Constructors
602(3)
Accessor Functions
605(2)
Temperature Input
607(2)
Conversion Functions
609(1)
Overloading Operators
610(9)
Summary: The Temperature Class
619(2)
10.5 friend Functions
621(5)
Quick Quiz 10.5
624(1)
Exercises 10.5
625(1)
10.6 Example: Retrieving Student Information
626(10)
Problem: Information Retrieval
626(1)
Object-Centered Design
627(9)
Part of the Picture: Artificial Intelligence
636(13)
Keith Vander Linden
Programming Pointers
643(1)
Program Style and Design
643(1)
Potential Problems
644(2)
Programming Problems
646(3)
Chapter 11: ENUMERATIONS
649(46)
11.1 Introductory Example: Wavelenghts of Colors
651(2)
Problem
651(1)
Object-Centered Design
651(2)
11.2 C-Style Enumerations
653(11)
Enumeration Declarations
653(2)
Defining Enumeration Objects
655(1)
Using Enumerations
655(1)
C-Style Enumeration Operations
656(3)
Other Enumeration Operations
659(3)
Libraries and Types
662(1)
Quick Quiz 11.2
663(1)
Exercises 11.2
663(1)
11.3 Object-Oriented Enumerations
664(15)
Declaring Enumeration Classes
664(2)
Defining Color Operations
666(11)
The Color Header File
677(2)
Quick Quiz 11.3
679(1)
Exercises 11.3
679(1)
11.4 Example: Geological Classification
679(11)
Part of the Picture: The C++ Type Hierarchy
690(5)
Programming Pointers
690(1)
Program Style and Design
690(1)
Potential Problems
691(1)
Programming Problems
691(4)
Chapter 12: MULTIDIMENSIONAL ARRAYS
695(66)
12.1 Introductory Example: Mileage between Cities
696(2)
Problem
696(1)
Preliminary Analysis
696(1)
Object-Centered Design
696(2)
12.2 C-Style Multidimensional Arrays
698(16)
Defining A Two-Dimensional Array
699(2)
Predefined Two-Dimensional Array Operations
701(1)
Defining Two-Dimensional Array Operations
702(3)
Declaring Three-Dimensional Arrays
705(1)
Operations on Three-Dimensional Arrays
706(1)
Higher-Dimensional Arrays
707(3)
Drawbacks of C-Style Arrays
710(1)
Quick Quiz 12.2
711(1)
Exercises 12.2
712(2)
12.3 Multidimensional vector T Objects
714(9)
Two-Dimensional vector T Objects
715(3)
Two-Dimensional vector T Operations
718(2)
Defining Two-Dimensional vector T Functions
720(3)
Quick Quiz 12.3
723(1)
Exercises 12.3
723(1)
12.4 A vector T -Based Matrix Library
723(17)
Matrix Multiplication
724(1)
Building a Matrix Class: The External Approach
725(1)
Matrix Operations
725(4)
Building a Matrix Class: The Internal Approach
729(8)
Object-Centered Design
737(1)
Application: Solving Linear Systems
737(2)
Quick Quiz 12.4
739(1)
Exercises 12.4
739(1)
Part of the Picture: Computer Graphics
740(21)
Examples: Function Graphing and Density Plots
741(6)
GUI Windows Application Programming
747(2)
Programming Pointers
749(1)
Program Style and Design
749(1)
Potential Problems
750(1)
Programming Problems
751(10)
Chapter 13: POINTERS AND RUN-TIME ALLOCATION
761(68)
13.1 Introduction to Pointer Variables
762(13)
Declaring and Initializing Pointers
763(2)
Basic Pointer Operations
765(10)
13.2 Run-Time Allocation Using new and delete
775(17)
The new Operation
776(7)
The delete Operation
783(7)
Summary
790(2)
13.3 The STL list T Class Template
792(16)
A Limitation of vector T
792(3)
Some list T Operations
795(9)
Example: Internet Addresses
804(4)
Part of the Picture: The TCP/IP Communications Architecture
808(7)
William Stallings
13.4 Pointers and Command-Line Arguments
815(7)
Parameters of the Main Function
816(2)
Example: A Square Root Calculator
818(3)
Command-Line Arguments: Files and Switches
821(1)
Part of the Picture: Data Structures
822(7)
Programming Pointers
823(1)
Program Style and Design
823(1)
Potential Problems
824(1)
Programming Problems
825(4)
Appendixes 829(28)
A. ASCII Character Set 829(2)
B. C++ Keywords 831(2)
C. C++ Operators 833(2)
D. Libraries and Classes 835(1)
C Libraries 835(3)
The string Class 838(6)
The list T Class Template 844(3)
Answers to Quick Quizzes 847(10)
Index 857

Rewards Program

Write a Review