- Page 2:
LOCATION OF VIDEONOTES IN THE TEXT
- Page 6:
Seventh Edition Starting Out with C
- Page 10:
Contents at a Glance Preface xv CHA
- Page 14:
Preface xv Contents CHAPTER 1 Intro
- Page 18:
5.14 Focus on Testing and Debugging
- Page 22:
11.12 Constructors, Destructors, an
- Page 26:
Contents xiii Student CD The follow
- Page 30:
Preface Welcome to Starting Out wit
- Page 34:
Figure P-1 Chapter 7 introduces obj
- Page 38:
Preface xix Chapter 6: Functions In
- Page 42:
Preface xxi Chapter 16: Exceptions,
- Page 46:
Features of the Text Preface xxiii
- Page 50:
• A computerized test bank • A
- Page 54:
David Kaeli Northeastern University
- Page 58:
CHAPTER TOPICS 1 1.1 Why Program? 1
- Page 62:
Figure 1-1 Figure 1-2 The organizat
- Page 66:
Computer Systems: Hardware and Soft
- Page 70:
Programs and Programming Languages
- Page 74:
Programs and Programming Languages
- Page 78:
Figure 1-5 Source code hello.cpp Pr
- Page 82:
What Is a Program Made of? 13 Table
- Page 86:
Figure 1-7 0 10 20 What Is a Progra
- Page 90:
The Programming Process 17 Lines 10
- Page 94:
Figure 1-9 Designing a Program with
- Page 98:
The Programming Process 21 When a v
- Page 102:
Review Questions and Exercises 23 5
- Page 106:
Solving the Candy Bar Sales Problem
- Page 110:
CHAPTER TOPICS 2 2.1 The Parts of a
- Page 114:
The Parts of a C++ Program 29 progr
- Page 118:
The cout Object 31 Checkpoint 2.1 T
- Page 122:
The cout Object 33 An important con
- Page 126:
Table 2-2 Common Escape Sequences T
- Page 130:
2.4 Standard and Prestandard C++ CO
- Page 134:
Variables, Constants, and the Assig
- Page 138:
Checkpoint 2.6 Which of the followi
- Page 142:
Integer Data Types 43 • After the
- Page 146:
Table 2-6 Integer Data Types, Sizes
- Page 150:
Program 2-10 (continued) Program Ou
- Page 154:
Program 2-11 1 // This program demo
- Page 158:
Figure 2-6 Figure 2-7 The char Data
- Page 162:
You can assign a string literal to
- Page 166:
Table 2-8 Floating-Point Data Types
- Page 170:
The bool Data Type 57 Assigning a f
- Page 174:
Assignment Statements 2.22 What wil
- Page 178:
Arithmetic Operators Arithmetic Ope
- Page 182:
Program 2-20 (continued) 10 overtim
- Page 186:
Program 2-21 1 /* 2 PROGRAM: PAYROL
- Page 190:
Another aspect of programming style
- Page 194:
Review Questions and Exercises 69 1
- Page 198:
Review Questions and Exercises 71 F
- Page 202:
Review Questions and Exercises 73 9
- Page 206:
Using cin to Read Input CHAPTER TOP
- Page 210:
The cin Object 77 This tells the us
- Page 214:
Program 3-3 (continued) Program Out
- Page 218:
Evaluating Mathematical Expressions
- Page 222:
Mathematical Expressions 83 Some ex
- Page 226:
Mathematical Expressions 85 When co
- Page 230:
Program 3-6 (continued) 13 // Get t
- Page 234:
3.3 Implicit Type Conversion Implic
- Page 238:
Explicit Type Conversion 91 This co
- Page 242:
C-style and Prestandard C++ Type Ca
- Page 246:
Program 3-10 1 // This program demo
- Page 250:
3.6 Named Constants CONCEPT: Consta
- Page 254:
Program 3-12 1 // This program calc
- Page 258:
int main() { const int PIECES_PER_J
- Page 262:
Multiple and Combined Assignment 10
- Page 266:
} duo *= 2; tres -= 4; unus /= 3; d
- Page 270:
Program 3-15 (continued) Formatting
- Page 274:
Program 3-17 (continued) 14 cout
- Page 278:
Formatting Output 111 The output cr
- Page 282:
Formatting Output 113 blanks. There
- Page 286:
Working with Characters and String
- Page 290:
Program 3-22 (continued) 16 17 cout
- Page 294:
Figure 3-3 Working with Characters
- Page 298:
Figure 3-4 Using C-Strings 121 As w
- Page 302:
Using C-Strings 123 than it can hol
- Page 306:
Using C-Strings 125 The getline fun
- Page 310:
More Mathematical Library Functions
- Page 314:
Program 3-32 More Mathematical Libr
- Page 318:
3. Open the file. 4. Use the file.
- Page 322:
Figure 3-6 Figure 3-7 Step 4: Use t
- Page 326:
Introduction to Files 135 In Progra
- Page 330:
Program 3-35 (continued) 23 24 // P
- Page 334:
Program 3-36 (with hand trace chart
- Page 338:
cubicYards = cubicFeet / 27 totalPr
- Page 342:
Program 3-38 Tying It All Together:
- Page 346:
Review Questions and Exercises 145
- Page 350:
Review Questions and Exercises 147
- Page 354:
B) (Assume the user enters George W
- Page 358:
Solving the Stadium Seating Problem
- Page 362:
Review Questions and Exercises 153
- Page 366:
Review Questions and Exercises 155
- Page 370:
CHAPTER TOPICS 4 4.1 Relational Ope
- Page 374:
Relational Operators 159 A couple o
- Page 378:
Table 4-3 shows examples of other s
- Page 382:
Figure 4-2 The if Statement 163 The
- Page 386:
Program 4-2 (continued) Program Out
- Page 390:
The if Statement 167 statements tha
- Page 394:
The if Statement 169 The fact that
- Page 398:
Program 4-4 (continued) 14 // Howev
- Page 402:
Program 4-5 (continued) 15 if (numb
- Page 406:
Using an if/else if Statement int m
- Page 410:
Program 4-7 (continued) 16 // Deter
- Page 414:
Program 4-8 (continued) 6 int main(
- Page 418:
4.5 Menu-Driven Programs Menu-Drive
- Page 422:
4.6 Nested if Statements Figure 4-7
- Page 426:
Program 4-11 (continued) Program Ou
- Page 430:
Logical Operators 187 If the custom
- Page 434:
Program 4-12 (continued) 20 // Dete
- Page 438:
Program 4-13 (continued) 19 // Dete
- Page 442:
Logical Operators 193 true may have
- Page 446:
if ((x >= 20) && (x
- Page 450:
Program 4-16 (continued) 23 else 24
- Page 454:
Program 4-18 (continued) 10 double
- Page 458:
} // // Write input validation code
- Page 462:
Program 4-20 (continued) Comparing
- Page 466:
Comparing Characters and Strings 20
- Page 470:
Figure 4-9 The Conditional Operator
- Page 474:
Checkpoint 4.31 Rewrite the followi
- Page 478:
The switch Statement 211 An optiona
- Page 482:
Program 4-24 (continued) Program Ou
- Page 486:
Program 4-26 (continued) 15 // Find
- Page 490:
Program 4-27 (continued) Program Ou
- Page 494:
4.13 Enumerated Data Types Enumerat
- Page 498:
Program 4-28 (continued) Checkpoint
- Page 502:
4.15 Focus on Testing and Debugging
- Page 506:
Green Fields Landscaping Case Study
- Page 510:
The Program Green Fields Landscapin
- Page 514:
Program 4-30 (continued) Green Fiel
- Page 518:
Review Questions and Exercises Revi
- Page 522:
Review Questions and Exercises 233
- Page 526:
Review Questions and Exercises 235
- Page 530:
Review Questions and Exercises 237
- Page 534:
Review Questions and Exercises 239
- Page 538:
Review Questions and Exercises 241
- Page 542:
CHAPTER TOPICS 5 Looping 5.1 The In
- Page 546:
Program 5-1 (continued) 13 // Use p
- Page 550:
For another example, look at the fo
- Page 554:
The while Loop E) x = 99; if (x++ <
- Page 558:
Figure 5-2 The statement in line 11
- Page 562:
Using the while Loop for Input Vali
- Page 566:
Program 5-4 (continued) 6 7 int mai
- Page 570:
Program 5-5 (continued) 7 int main(
- Page 574:
Figure 5-4 The do-while Loop 259 As
- Page 578:
Program 5-8 (continued) The do-whil
- Page 582:
The for Loop 5.6 The for Loop CONCE
- Page 586:
The for Loop 265 The counter variab
- Page 590:
Creating a User-Controlled for Loop
- Page 594:
C) int x for (x = 3; x
- Page 598:
Sentinels 271 Let’s take a closer
- Page 602:
Using a Loop to Read Data from a Fi
- Page 606:
Program 5-12 (continued) Program Ou
- Page 610:
The do-while Loop Nested Loops 277
- Page 614:
Program 5-14 (continued) Program Ou
- Page 618:
Program 5-15 (continued) Program Ou
- Page 622:
Program 5-16 (continued) The contin
- Page 626:
Program 5-17 (continued) 21 22 whil
- Page 630:
Central Mountain Credit Union Case
- Page 634:
Central Mountain Credit Union Case
- Page 638:
Testing the Program Testing the pro
- Page 642:
Program 5-19 1 // This program demo
- Page 646:
Review Questions and Exercises 295
- Page 650:
B) // This program adds two numbers
- Page 654:
Solving the Ocean Levels Problem Pr
- Page 658:
Review Questions and Exercises 301
- Page 662:
Review Questions and Exercises 303
- Page 666:
CHAPTER TOPICS 6 Functions 6.1 Modu
- Page 670:
Figure 6-2 Defining and Calling Fun
- Page 674:
Figure 6-3 Defining and Calling Fun
- Page 678:
Program 6-3 (continued) 26 int main
- Page 682:
Figure 6-5 void deep() { cout
- Page 686:
Function Prototypes 315 from a func
- Page 690:
Notice the function prototype for d
- Page 694:
Program 6-7 (continued) Program Out
- Page 698:
Figure 6-7 Passing Data by Value 32
- Page 702:
Figure 6-8 Passing Data by Value 32
- Page 706:
6.6 The return Statement CONCEPT: T
- Page 710:
Figure 6-10 Defining a Value-Return
- Page 714:
Figure 6-11 Returning a Value from
- Page 718:
Program 6-12 (continued) 51 double
- Page 722:
Program 6-13 (continued) 17 // Indi
- Page 726:
Program 6-14 (continued) Using Func
- Page 730:
Local and Global Variables 337 int
- Page 734:
Local Variable Lifetime Local and G
- Page 738:
Local and Global Variables 341 vari
- Page 742:
Program 6-18 (continued) 66 double
- Page 746:
Program 6-20 1 // This program show
- Page 750:
int main() { int var = 100; cout
- Page 754:
Program 6-22 1 // This program demo
- Page 758:
Using Reference Variables as Parame
- Page 762:
Using Reference Variables as Parame
- Page 766:
Here are three common instances whe
- Page 770:
Program 6-26 (continued) 11 int mai
- Page 774:
6.14 Overloading Functions CONCEPT:
- Page 778:
Overloading Functions 361 integers.
- Page 782:
Program 6-28 (continued) Program Ou
- Page 786:
6.25 What is the output of the foll
- Page 790:
Stubs and Drivers 367 are debugged
- Page 794:
Program Design Little Lotto Case St
- Page 798:
Program 6-31 Little Lotto Case Stud
- Page 802:
Program 6-31 (continued) Program Ou
- Page 806:
Now let’s use a function to do so
- Page 810:
Program 6-33 (continued) Review Que
- Page 814:
Review Questions and Exercises 379
- Page 818:
2. Celsius Temperature Table The fo
- Page 822:
Review Questions and Exercises 383
- Page 826:
Review Questions and Exercises 385
- Page 830:
CHAPTER TOPICS 7 7.1 Abstract Data
- Page 834:
7.2 Object-Oriented Programming Fig
- Page 838:
Creating a Class Introduction to Cl
- Page 842:
Creating and Using Class Objects 7.
- Page 846:
Defining Member Functions 395 Notic
- Page 850:
Program 7-2 (continued) Naming Conv
- Page 854:
Program 7-3 (continued) Defining Me
- Page 858:
More on Inline Functions Defining M
- Page 862:
Program 7-4 (continued) Program Out
- Page 866:
Overloading Constructors Constructo
- Page 870:
Destructors 407 and type of argumen
- Page 874:
7.7 A constructor that requires no
- Page 878:
Program 7-8 Private Member Function
- Page 882:
Program 7-8 (continued) Program Out
- Page 886:
Program 7-9 (continued) Passing Obj
- Page 890:
Passing Objects to Functions 417 vo
- Page 894:
Program 7-10 (continued) 59 Invento
- Page 898:
Figure 7-4 class Carpet { private:
- Page 902:
Program 7-11 (continued) 47 // ****
- Page 906:
Focus on Software Engineering: Sepa
- Page 910:
Focus on Software Engineering: Sepa
- Page 914:
Table 7-1 summarizes how the differ
- Page 918:
7.12 Input Validation Objects CONCE
- Page 922:
Contents of CharRange.cpp Input Val
- Page 926:
Program 7-13 (continued) Program Ou
- Page 930:
Structures 437 Program 7-14 is a co
- Page 934:
Figure 7-7 Structures 439 items in
- Page 938:
Figure 7-8 Figure 7-8 illustrates i
- Page 942:
Structures 443 Checkpoint 7.26 Writ
- Page 946:
Program 7-16 (continued) Structures
- Page 950:
} cout > item.onHand; cout > item.p
- Page 954:
Program 7-17 (continued) 27 if (hou
- Page 958:
The withdraw Member Function Home S
- Page 962:
Program 7-18 (continued) Home Softw
- Page 966:
Program 7-18 (continued) Menu a) Di
- Page 970:
Introduction to Object-Oriented Ana
- Page 974:
Introduction to Object-Oriented Ana
- Page 978:
Introduction to Object-Oriented Ana
- Page 982:
Introduction to Object-Oriented Ana
- Page 986:
Screen Control 465 To place the cur
- Page 990:
Program 7-19 (continued) 60 /******
- Page 994:
Program 7-20 (continued) 70 71 /***
- Page 998:
Review Questions and Exercises Revi
- Page 1002:
40. A Car structure is declared as
- Page 1006:
51. A) struct Names { string first;
- Page 1010:
Review Questions and Exercises 477
- Page 1014:
Review Questions and Exercises 479
- Page 1018:
13. Population In a population, the
- Page 1022:
Group Project Review Questions and
- Page 1026:
CHAPTER 8 Arrays 8.1 Arrays Hold Mu
- Page 1030:
Accessing Array Elements 487 The si
- Page 1034:
However, the following statements a
- Page 1038:
Inputting and Displaying Array Cont
- Page 1042:
Writing the Contents of an Array to
- Page 1046:
Watch for Off-By-One Errors Inputti
- Page 1050:
Program 8-5 (continued) Program Out
- Page 1054:
Program 8-7 (continued) 9 int main(
- Page 1058:
Figure 8-10 Array Initialization 50
- Page 1062:
Program 8-9 (continued) 13 // Input
- Page 1066:
Display the appropriate message if
- Page 1070:
Program 8-10 Processing Array Conte
- Page 1074:
Why Use an Array? Processing Array
- Page 1078:
Processing Array Contents 511 Let
- Page 1082:
Program 8-12 (continued) 26 // If t
- Page 1086:
Figure 8-12 10 hours[0] Employee #1
- Page 1090:
Passing an Array to a Function Arra
- Page 1094:
Program 8-15 1 // This program show
- Page 1098:
Program 8-16 (continued) 25 /******
- Page 1102:
Some Useful Array Functions Arrays
- Page 1106:
Program 8-18 (continued) 84 double
- Page 1110:
Figure 8-14 Row 0 Row 1 Row 2 Two-D
- Page 1114:
Program 8-19 (continued) Program Ou
- Page 1118:
Program 8-20 (continued) 19 int tab
- Page 1122:
Sum each student’s test scores so
- Page 1126:
Program 8-21 Arrays with Three or M
- Page 1130:
8.21 Write a statement that assigns
- Page 1134:
You may also initialize a vector wi
- Page 1138:
for (index = 0; index < NUM_EMPS; i
- Page 1142:
Determining the Size of a Vector Un
- Page 1146:
Program 8-25 (continued) 22 // Now
- Page 1150:
Program 8-27 (continued) 19 // Get
- Page 1154:
Arrays of Class Objects 549 Checkpo
- Page 1158:
Program 8-28 1 // This program uses
- Page 1162:
Program 8-29 (continued) 11 int mai
- Page 1166:
#include using namespace std; clas
- Page 1170:
Program 8-30 (continued) 22 for (in
- Page 1174:
National Commerce Bank Case Study 5
- Page 1178:
Program 8-31 (continued) Program Ou
- Page 1182:
Program 8-32 (continued) 54 cout
- Page 1186:
Use the following Car structure dec
- Page 1190:
Solving the Chips and Salsa Problem
- Page 1194:
Review Questions and Exercises 569
- Page 1198:
Review Questions and Exercises 571
- Page 1202:
Client Program Review Questions and
- Page 1206:
Review Questions and Exercises 575
- Page 1210:
CHAPTER TOPICS 9 9.1 Introduction t
- Page 1214:
Program 9-1 (continued) Introductio
- Page 1218:
Introduction to Search Algorithms 5
- Page 1222:
Program 9-2 (continued) Introductio
- Page 1226:
Program 9-3 (continued) Searching a
- Page 1230:
Sorting a Set of Data Program 9-3 (
- Page 1234:
Introduction to Sorting Algorithms
- Page 1238:
Program 9-4 (continued) 30 /*******
- Page 1242:
Here is the selection sort algorith
- Page 1246:
Program 9-5 (continued) 40 for (sta
- Page 1250:
Program 9-6 (continued) Sorting an
- Page 1254:
Sorting and Searching Vectors 599 L
- Page 1258:
Program 9-7 (continued) Program Out
- Page 1262:
Introduction to Analysis of Algorit
- Page 1266:
Introduction to Analysis of Algorit
- Page 1270:
Introduction to Analysis of Algorit
- Page 1274:
Case Studies 609 1. O(1): A functio
- Page 1278:
Program 9-8 does all of this. Progr
- Page 1282:
Program 9-8 (continued) Tying It Al
- Page 1286:
Review Questions and Exercises 615
- Page 1290:
Snow Report December 12 - 18 Date B
- Page 1294:
CHAPTER TOPICS 10 Pointers 10.1 Poi
- Page 1298:
Pointer Variables Program 10-1 (con
- Page 1302:
Pointer Variables 623 You can use a
- Page 1306:
The Relationship Between Arrays and
- Page 1310:
Program 10-6 (continued) 16 // Disp
- Page 1314:
Pointer Arithmetic 629 The only dif
- Page 1318:
Initializing Pointers 631 Pointers
- Page 1322:
Figure 10-5 Comparing Pointers 633
- Page 1326:
10.7 Pointers as Function Parameter
- Page 1330:
Pointers as Function Parameters 637
- Page 1334:
Pointers to Constants and Constant
- Page 1338:
Program 10-13 (continued) 21 // Dis
- Page 1342:
Figure 10-8 int value = 22; const i
- Page 1346:
Dynamically Allocating an Array Any
- Page 1350:
Program 10-14 (continued) 24 // Get
- Page 1354:
} cout
- Page 1358:
B) if (&array[4] < &array[1]) cout
- Page 1362:
Pointers to Class Objects and Struc
- Page 1366:
Program 10-16 (continued) Program O
- Page 1370:
Program 10-17 (continued) Program O
- Page 1374:
Program 10-18 (continued) Program O
- Page 1378:
ptr->width A) *rptr.width B) (*rptr
- Page 1382:
Figure 10-12 United Cause Relief Ag
- Page 1386:
Here is the C++ code for the functi
- Page 1390:
United Cause Relief Agency Case Stu
- Page 1394:
Program 10-19 (continued) Program O
- Page 1398:
time_t epSecs; // Seconds since epo
- Page 1402:
C++ Language Elements 25. Consider
- Page 1406:
Review Questions and Exercises 675
- Page 1410:
CHAPTER TOPICS 11 11.1 The this Poi
- Page 1414:
The this Pointer and Constant Membe
- Page 1418:
Static Members 681 takes a pointer
- Page 1422:
Figure 11-2 The cout statements sho
- Page 1426:
Program 11-2 (continued) Program Ou
- Page 1430:
Program 11-3 (continued) 11 // Get
- Page 1434:
11.3 Friends of Classes Friends of
- Page 1438:
Program 11-4 (continued) Contents o
- Page 1442:
Program 11-4 (continued) Here are t
- Page 1446:
Program 11-5 (continued) 39 cout
- Page 1450:
Program 11-6 (continued) 21 Address
- Page 1454:
Program 11-7 (continued) Contents o
- Page 1458:
Program 11-8 (continued) 12 ~Number
- Page 1462:
Copy Constructors 703 called again
- Page 1466:
Figure 11-4 Operator Overloading 70
- Page 1470:
Program 11-9 (continued) 7 double *
- Page 1474:
Program 11-9 (continued) Program Ou
- Page 1478:
public: Weird(int v) {value = v; }
- Page 1482:
or more succinctly: Length operator
- Page 1486:
Program 11-10 (continued) 32 cout
- Page 1490:
Length Length::operator++() { len_i
- Page 1494:
19 { 20 len_inches = 12 *feet + inc
- Page 1498:
Program 11-11 (continued) Overloadi
- Page 1502:
IntArray::IntArray(int s) { arraySi
- Page 1506:
Contents of intarray.cpp 1 #include
- Page 1510:
Program 11-14 demonstrates the IntA
- Page 1514:
Type Conversion Operators 729 The s
- Page 1518:
11.8 Convert Constructors Convert C
- Page 1522:
12 //******************************
- Page 1526:
class Date { string month; int day,
- Page 1530:
Aggregation and Composition 737 pub
- Page 1534:
Program 11-17 (continued) 71 Countr
- Page 1538:
Figure 11-6 Insect class members In
- Page 1542:
Inheritance 743 Program 11-18 demon
- Page 1546:
Protected Members and Class Access
- Page 1550:
Program 11-19 (continued) 9 const s
- Page 1554:
Protected Members and Class Access
- Page 1558:
Program 11-20 (continued) 17 18 //
- Page 1562:
31 }; 32 33 class Faculty:public Pe
- Page 1566:
11.13 Overriding Base Class Functio
- Page 1570:
derived class when the base class a
- Page 1574:
If you use Microsoft Windows, you c
- Page 1578:
Program 11-22 (continued) Tying It
- Page 1582:
Review Questions and Exercises 763
- Page 1586:
{ diameter = right.diameter; center
- Page 1590:
Review Questions and Exercises 767
- Page 1594:
Review Questions and Exercises 769
- Page 1598:
CHAPTER TOPICS 12 12.1 C-Strings 12
- Page 1602:
Program 12-2 1 // This program demo
- Page 1606:
Pointers to char C-Strings 775 As w
- Page 1610:
Figure 12-2 char string1[13] = "Hel
- Page 1614:
Program 12-5 (continued) 8 int main
- Page 1618:
Library Functions for Working with
- Page 1622:
Program 12-8 (continued) 19 // Prin
- Page 1626:
Program 12-9 (continued) 20 char lo
- Page 1630:
Conversions Between Numbers and Str
- Page 1634:
Program 12-10 demonstrates the use
- Page 1638:
Conversions Between Numbers and Str
- Page 1642:
Character Testing 793 12.11 Write a
- Page 1646:
Program 12-12 (continued) Program O
- Page 1650:
Likewise, the next four characters
- Page 1654:
Program 12-14 (continued) 22 // Kee
- Page 1658:
Program 12-15 (continued) 33 void s
- Page 1662:
Figure 12-3 Figure 12-4 Writing You
- Page 1666:
More About the C++ string Class 805
- Page 1670:
More About the C++ string Class 807
- Page 1674:
More About the C++ string Class 809
- Page 1678:
The MyString Class Creating Your Ow
- Page 1682:
53 //******************************
- Page 1686:
Creating Your Own String Class 815
- Page 1690:
Program 12-22 (continued) 37 else 3
- Page 1694:
Tying It All Together: Program Exec
- Page 1698:
Review Questions and Exercises 821
- Page 1702:
Solving the Backward String Problem
- Page 1706:
Review Questions and Exercises 825
- Page 1710:
Review Questions and Exercises 827
- Page 1714:
CHAPTER TOPICS 13.1 Files 13 13.1 F
- Page 1718:
in your program. Objects of type if
- Page 1722:
sentences to it, closes the file, a
- Page 1726:
Program 13-2 (continued) 18 // Open
- Page 1730:
int number; file >> number; while (
- Page 1734:
Figure 13-1 Figure 13-1 shows the w
- Page 1738:
Program 13-5 (continued) 14 double
- Page 1742:
Output Formatting 843 Recall from C
- Page 1746:
Passing File Stream Objects to Func
- Page 1750:
13.4 More Detailed Error Testing Mo
- Page 1754:
Program 13-8 (continued) 46 //*****
- Page 1758:
Program 13-9 (continued) 32 // Clos
- Page 1762:
Program 13-11 (continued) 7 int mai
- Page 1766:
Member Functions for Reading and Wr
- Page 1770:
Program 13-13 (continued) 51 else 5
- Page 1774:
Member Functions for Reading and Wr
- Page 1778:
#include using namespace std; int
- Page 1782:
Figure 13-3 Figure 13-4 Binary File
- Page 1786:
Binary Files 865 If the data we are
- Page 1790:
Creating Records with Structures 86
- Page 1794:
Program 13-17 (continued) Program S
- Page 1798:
Random-Access Files 871 Checkpoint
- Page 1802:
Table 13-9 shows examples of seekp
- Page 1806:
Program 13-20 (continued) Random-Ac
- Page 1810:
Program 13-21 1 // This program dem
- Page 1814:
Program 13-22 1 // This program set
- Page 1818:
Opening a File for Both Input and O
- Page 1822:
Checkpoint 13.28 Describe the diffe
- Page 1826:
Figure 13-6 Determining a Serializa
- Page 1830:
51 // Read the data for fname into
- Page 1834:
Tying It All Together: File Merging
- Page 1838:
Program 13-27 (continued) Tying It
- Page 1842:
Review Questions and Exercises 893
- Page 1846:
B) ofstream file; file.open("info.d
- Page 1850:
Solving the File Encryption Filter
- Page 1854:
Review Questions and Exercises 899
- Page 1858:
CHAPTER TOPICS 14 Recursion 14.1 In
- Page 1862:
Figure 14-2 Introduction to Recursi
- Page 1866:
Program 14-2 (continued) 8 int main
- Page 1870:
Program 14-3 (continued) 19 //*****
- Page 1874:
Figure 14-3 Program 14-4 demonstrat
- Page 1878:
Program 14-5 (continued) 14 cout >
- Page 1882:
14.5 A Recursive Binary Search Func
- Page 1886:
QuickSort 14.6 Focus on Problem Sol
- Page 1890:
} { if (arr[pos] < pivotValue) { //
- Page 1894:
14.7 The Towers of Hanoi The Towers
- Page 1898:
Move a disk from peg 1 to peg 3. Mo
- Page 1902:
Many problems can only be solved by
- Page 1906:
Program 14-10 (continued) Focus on
- Page 1910:
Tying It All Together: Infix and Pr
- Page 1914:
Program 14-11 (continued) Tying It
- Page 1918:
Predict the Output 7. What is the o
- Page 1922:
Solving the Recursive Multiplicatio
- Page 1926:
CHAPTER TOPICS 15 15.1 Type Compati
- Page 1930:
Type Compatibility in Inheritance H
- Page 1934:
Type Compatibility in Inheritance H
- Page 1938:
Polymorphism and Virtual Member Fun
- Page 1942:
We want to tell the compiler that w
- Page 1946:
Program 15-3 (continued) 59 { 60 se
- Page 1950:
Abstract Base Classes and Pure Virt
- Page 1954:
which is executed a number of diffe
- Page 1958:
15.6 What will the following progra
- Page 1962:
class is a special case of the base
- Page 1966:
To demonstrate this class, we will
- Page 1970:
Secure Encryption Systems, Inc., Ca
- Page 1974:
Program 15-6 (continued) 7 class En
- Page 1978:
15.6 Tying It All Together: Let’s
- Page 1982:
Tying It All Together: Let’s Move
- Page 1986:
Tying It All Together: Let’s Move
- Page 1990:
Program 15-7 Tying It All Together:
- Page 1994:
17. Rewrite the following two state
- Page 1998:
Review Questions and Exercises 971
- Page 2002:
CHAPTER TOPICS 16 16.1 Exceptions 1
- Page 2006:
Throwing and Handling Exceptions Ha
- Page 2010:
Object-Oriented Exception Handling
- Page 2014:
Multiple Exceptions Exceptions 979
- Page 2018:
Extracting Information from the Exc
- Page 2022:
Handling the bad_alloc Exception Th
- Page 2026:
Function Templates 985 When the fir
- Page 2030:
Program 16-6 demonstrates how this
- Page 2034:
Function Templates 989 Because the
- Page 2038:
Program 16-8 (continued) 26 27 // T
- Page 2042:
Defining Template Functions Class T
- Page 2046:
Class Templates 995 In this definit
- Page 2050:
63 template 64 void SimpleVector::
- Page 2054:
16.4 Class Templates and Inheritanc
- Page 2058:
Program 16-12 (continued) 12 // Sto
- Page 2062:
Introduction to the Standard Templa
- Page 2066:
Introduction to the Standard Templa
- Page 2070:
Table 16-4 Selected Member Function
- Page 2074:
Table 16-5 STL Algorithms (continue
- Page 2078:
Introduction to the Standard Templa
- Page 2082:
Program 16-16 (continued) 30 // Fin
- Page 2086:
In Program 16-18, the following sta
- Page 2090:
Program 16-19 (continued) Tying It
- Page 2094:
Review Questions and Exercises 1019
- Page 2098:
Review Questions and Exercises 1021
- Page 2102:
CHAPTER TOPICS 17 17.1 Introduction
- Page 2106:
Introduction to the Linked List ADT
- Page 2110:
Introduction to the Linked List ADT
- Page 2114:
Program 17-2 (continued) 36 { 37 co
- Page 2118:
Adding an Element to a Linked List
- Page 2122:
Figure 17-3 Figure 17-4 Figure 17-5
- Page 2126:
Contents of SortedNumberList.h 1 #i
- Page 2130:
Figure 17-9 Figure 17-10 Linked Lis
- Page 2134:
38 { 39 nodePtr = head; 40 head = h
- Page 2138:
Figure 17-12 head Figure 17-13 Next
- Page 2142:
55 { 56 ListNode *nodePtr, *previou
- Page 2146:
Program 17-6 (continued) Program Ou
- Page 2150:
Program 17-7 1 // This program illu
- Page 2154:
17 ListNode *head; // List head poi
- Page 2158:
The Recursive remove Member Functio
- Page 2162:
67 { 68 // Point to the node to be
- Page 2166:
Table 17-1 describes some of the li
- Page 2170:
Planning for the Changes and Class
- Page 2174:
Reliable Software Systems, Inc., Ca
- Page 2178:
} { } for(int k = 0; coordArray[k].
- Page 2182:
Tying It All Together: More on Grap
- Page 2186:
Program 17-11 (continued) Tying It
- Page 2190:
12. Write a function ListNode *remo
- Page 2194:
Solving the Member Insertion By Pos
- Page 2198:
CHAPTER TOPICS 18 18.1 Introduction
- Page 2202:
Figure 18-2 Figure 18-3 Introductio
- Page 2206:
Introduction to the Stack ADT 1075
- Page 2210:
Figure 18-4 Figure 18-5 Figure 18-6
- Page 2214:
Dynamic Stacks 1079 function, but d
- Page 2218:
41 bool DynIntStack::isEmpty() 42 {
- Page 2222:
Storing Objects in an STL Stack The
- Page 2226:
Figure 18-8 Introduction to the Que
- Page 2230:
Figure 18-11 Figure 18-12 Figure 18
- Page 2234:
A Static Queue Class The declaratio
- Page 2238:
80 81 //***************************
- Page 2242:
A dynamic integer queue class is li
- Page 2246: 73 //******************************
- Page 2250: 7 int main() 8 { 9 deque iDeque; 10
- Page 2254: Once this is done, the array item a
- Page 2258: Program 18-9 (continued) Focus on P
- Page 2262: Tying It All Together: Converting P
- Page 2266: Program 18-10 (continued) Tying Tyi
- Page 2270: Review Questions and Exercises 1107
- Page 2274: Solving the File Reverser Problem R
- Page 2278: CHAPTER TOPICS 19 19.1 Definition a
- Page 2282: Figure 19-2 Figure 19-3 Left Subtre
- Page 2286: Binary Search Tree Operations 1115
- Page 2290: Binary Search Tree Operations 1117
- Page 2294: if (!tree) { tree = new TreeNode(nu
- Page 2300: 1122 Chapter 19 Binary Trees Removi
- Page 2304: 1124 Chapter 19 Binary Trees Figure
- Page 2308: 1126 Chapter 19 Binary Trees void I
- Page 2312: 1128 Chapter 19 Binary Trees 16 ret
- Page 2316: 1130 Chapter 19 Binary Trees 125 //
- Page 2320: 1132 Chapter 19 Binary Trees We now
- Page 2324: 1134 Chapter 19 Binary Trees Progra
- Page 2328: 1136 Chapter 19 Binary Trees Review
- Page 2332: 1138 Chapter 19 Binary Trees Solvin
- Page 2336: This page intentionally left blank
- Page 2340: 1142 Appendix A The ASCII Character
- Page 2344: This page intentionally left blank
- Page 2348:
This page intentionally left blank
- Page 2352:
1148 INDEX aggregation defined, 734
- Page 2356:
1150 INDEX C C# programming languag
- Page 2360:
1152 INDEX conversion (continued) e
- Page 2364:
1154 INDEX enumeration algorithms,
- Page 2368:
1156 INDEX functions (continued) fr
- Page 2372:
1158 INDEX input validation, 183 cl
- Page 2376:
1160 INDEX map STL container, 1003
- Page 2380:
1162 INDEX Online Friendship Connec
- Page 2384:
1164 INDEX private access specifica
- Page 2388:
1166 INDEX SearchableVector class,
- Page 2392:
1168 INDEX structures (continued) p