I’m starting to learn Ruby using the Learn to Program book by Chris
Pine.
On a mini assignment I need to:
"Write a program which asks for a person’s favorite number. Have your
program add one to the number, then suggest the result as a bigger and
better favorite number. (Do be tactful about it, though.) "
On Dec 18, 2011, at 11:22 PM, Fellipe de Paula wrote:
:in `+’: can’t convert Fixnum into String (TypeError)
Could you please point my mistake?
Are you sure the problem is on line 4? Seems like it is more likely
that it is on line 5 where you try to put new_number into a new message.
That is where you need to convert it back to a string.
Gary W.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.