Computing Concepts with C++ Essentials

Bug Report Page

Third Edition

Second Edition

First Edition

{short description of image}

Book errata

* = corrected in the second printing

*Page 23
Change "See Advanced Topic 2.2 in Chapter 2" to "See Advanced Topic 2.6 in Chapter 2"
*Page 78 Exercise R2.2
Change dm = m * ((sqrt . . . to dm = m * (sqrt . . .
*Page 79 Exercise R2.7
Add a semicolon to the end of the line << average << "\n"
*Page 93
Change the last line from 2000 2 12 to 2000 1 12.
*Page 102
The caption for Figure 7 reads "Output from point.cpp". It should read "Output from circle.cpp"
*Page 115 intsect2.cpp
Add a semicolon after Circle c(Point(0, 0), radius)
*Page 121 Exercise R3.14
Change "the value of c.get_center and c.get_radius" to "the value of c.get_center() and c.get_radius()"
*Page 142 coins6.cpp
Change value = value * 0.25; to value = n * 0.25;
*Page 144 2nd line from bottom
Change "the first four" to "the last three"
*Page 157 second table last row
Change false false true to false false false
*Page 169 4th Formula
Add a / between r and the root of q3.
*Page 192/193
Change float balance = future_value(r) to float balance = future_value(10000, r, 10) (2 times)
*Page 193
The green ] should be displayed more clearly (like in CCJ)
Page 209 line 1
Change c / 10 to c % 10
*Page 219 Exercise R5.9
Change
for (i = 0; i < c; i++)
to
i = 10;
if (i < c)
( for loops aren't introduced yet.)
*Page 219 Exercise R5.9
Change
for (i = n; i > c; i--)
{ int b = a;
int a = i;
n = a + b;
}
to
i = n - 1;
if (c > 0)
{ int b = g(c - 1);
int a = i;
n = a + b;
}
return n;
*Page 222 Exercise P5.2
Change "and leaves a and b unchanged" to "and leaves a and b unchanged otherwise".
*Page 223 Exercise P5.8
Change "the triangle t" to "the circle c".
*Page 224 2nd line from bottom
Change d to jd
*Page 225
Change long jb = ja + 1524; to long jb = jul + 1524;.
*Page 241, 291
The sqroot.cpp program fails if a == 0
*Page 248
Change "in the average.cpp program in Section 6.1.3" to "in the maxsal.cpp program in Section 6.1.3"
*Page 261
Change yhigh = ylow + cos(alpha) to yhigh = ylow + sin(alpha)
*Page 262, buffon.cpp
Change float yhigh = ylow + cos(deg2rad(angle)) to float yhigh = ylow + sin(deg2rad(angle)). Change the range of the angle to double angle = rand_double(0, 180);. Change if (yhigh >= 2) hit++; to if (yhigh >= 2) hits++;
*Page 277
Change "Exercise 6.2" to "Exercise R6.2" and "Exercise 6.3" to "Exercise R6.3"
*Page 277 Exercise R6.5
Change s = 1 / (1 + 1.0/(n * n)); to s = 1.0 / (n * n);
*Page 279 Exercise R6.12
Change the first two occurrences of cout << s to cout << s << " ".
*Page 279 Exercise R6.13
There should be a blank line between cout << n; and int i;
*Page 339
Change void Employee::set_salary(float salary) const to void Employee::set_salary(float new_salary) const
*Page 422 Exercise P9.25
Change "...you must move to the square to the right and up instead." to "...you must move to the square above instead."
*Page 456
Change "ccc_graf.h for graphics" to "ccc_shap.h for graphical shapes". Change "ccc_misc.h" to "ccc_util.h".
Page 493 bsearch.cpp
Change else if (diff < 0) /* v[mid] > a */ to else if (diff < 0) /* v[mid] < a */. (That is, change the comment to <.)
*Page 497 fibtime.cpp
else return f(n - 1) + f(n - 2); should be else return fib(n - 1) + fib(n - 2);
Page 511
Change the last line of the table from "4 Reindeer, Rudolf 2" to "4 Reindeer, Rudolf 1"
Page 517
Change "cwin << *bubble; /* NO!!! next points to a deleted element */" to "cwin << *bubble; /* NO!!! bubble points to a deleted element */"
*Page 533
Change "To fully understand the issue of 'big three' memory management, you need to know quite a bit more C++ that you can learn in a beginning programming course" to "To fully understand the issue of 'big three' memory management, you need to know quite a bit more C++ than you can learn in a beginning programming course"
*Page 565 clocks2.cpp
The code in the book will give for 12:30 PM the time 0:30 PM. Change the code to:
if (hours < 12)
{ if (hours == 0) hours += 12;
suffix = " am";
}
else
{ if (hours > 12) hours -= 12;
suffix = " pm";
}
*Index
Missing terms:

CCC Code bugs

These bugs are fixed in the current code release .

ccc_strg/g++
Included DOS file conio.h, referred to ::toupper
ccc_win, ccc_x11
mouse coordinate system was wrong if upper left corner != (0, 0)
average2.c,readdata.c
referred to unused variable i
fibloop.c
replace cpp_lite.h with ccc.h
raisesal.cpp,global.cpp,etree.cpp
salaries should be specified as floating-point numbers to avoid overflow with 16 bit int
ccc_strg.cpp
istream >> string set the input stream to a failed state when the last string from the input stream wasn't followed by whitespace.
ccc_vect.cpp
[] didn't work on a const matrix<T>&
ccc_win.cpp
Closing the program window while the program waited for mouse or keyboard input didn't terminate the program. (This was a hassle--the program was still running invisibly, and the compiler would refuse to overwrite the executable file. The only way to deal with this was to bring up the task list and kill the program.)

Thanks to Nick Amin, Thomas Amsler, Mike Clancy, Dan Colquhoun, Jim Donovan, Renee Fecteau, Jim Field, Peter Gacs, William B. Jones, Younik Lee, Carl Longnecker, Roger Mitton, Paul Newson, D. Sills, Kamel Takla, Dave Zarzycki and a number of anonymous contributors for their help!