This page contains errata for the versions of the textbooks on this site, beginning with the 2nd edition.
Introduction to Programming and Problem Solving Using Scala
- Page 128, problem 7. The formula for combinations has a factorial in the wrong place. It should be outside the parentheses as t!/(p!(t-p)!).
- Page 228, project 8.6.
Object-Orientation, Abstraction, and Data Structures Using Scala
- Page 66, the lambda expressions passed to the three calls to fold left on lines 11, 12, and 13 of the Bank implementation should use max instead of min.
- Page 72, on line 26 of the Loan code, the conditional should have amount <= _balance as a payment equal to the balance is allowable.
- Page 130 states that traits can't inherit from classes. This isn't true. A trait can inherit from a class, but then classes that inherit from that trait can not inherit from any other class. This makes the traits less flexible and could lead to problems when a future class tries to extend two traits that inherit from different classes.
- Page 218-220, the push method in ArrayStack uses Array.copy instead of a for loop, but the footnote on page 220 is written as if a for loop had been used.
- Page 223, Figure 7.3 - In the figure showing how Array-based queues work, "back" and "front" are reversed.
|
|