takaoueda / my-deja.com writes:

> I have just started learning Ruby with the book of Thomas and Hunt. The
> book is readable, but sample code is often an incomplete program.  So I
> am filling the gaps for exercises.  I concocted the following program
> for pp 31-32 by trial and error.  Will someone give a better solution to
> this cross-word puzzle?  I had to change the local variables checking
> and savings to instance variables @checking and @savings.

Congratulations. That's a bug in that code. I compiles cleanly as it
is, but clearly they need to be instance variables for it to actually
_do_ anything. Sorry about that.

> class Account
>   attr_reader :balance           # you don't need this one
>   attr_accessor :balance         # as this one does both
>   def initialize(name, balance)
>     @balance = balance
>     @name = name
>   end
> end

Regards

Dave

ps. If you'd like to e-mail me your name, I'll add it to the credits
on the errata web page.