A
Ant Walliams
Hi there,
Sorry this is probably going to be a real easy question but I am totally
new to programming.
I was following some tutorial online and at the end of the first chapter
it said 'Now create a program that asks the user for a number and then
suggests a higher number as a better option.
So what I wanted to happen below is it takes the users input and just
adds 1 to it. But is is coming back with "rb:3:in '+' can't convert
fixnum into string'
puts 'What is your favourite number?'
number = gets.chomp
number+=1
puts 'Do you not think' + number + 'is a better number?'
Any help would be appreciated its doing my head in.
Thanks
Sorry this is probably going to be a real easy question but I am totally
new to programming.
I was following some tutorial online and at the end of the first chapter
it said 'Now create a program that asks the user for a number and then
suggests a higher number as a better option.
So what I wanted to happen below is it takes the users input and just
adds 1 to it. But is is coming back with "rb:3:in '+' can't convert
fixnum into string'
puts 'What is your favourite number?'
number = gets.chomp
number+=1
puts 'Do you not think' + number + 'is a better number?'
Any help would be appreciated its doing my head in.
Thanks