J
John Tar
Hi
I am a newbie. I am trying to run some small ruby programs to learn a
bit about ruby.
everytime i run the following program in windows it auto closes when it
is done, so there is no time to see the final result
is there any way to allow it to just freeze and not autoclose...the way
i was doing it,is by putting a gets at the end....but i am sure there is
a better way
thanks
john
code:
puts 'what is you first name?'
name = gets.chomp
a=name.length.to_i
puts a
puts 'what is you midlle name?'
mname=gets.chomp
b=mname.length.to_i
puts b
puts 'what is you last midlle name?'
lname=gets.chomp
c=lname.length.to_i
puts c
d=a+b+c
puts 'there are ' + d.to_s + ' characters in your name:' +
mname.swapcase
I am a newbie. I am trying to run some small ruby programs to learn a
bit about ruby.
everytime i run the following program in windows it auto closes when it
is done, so there is no time to see the final result
is there any way to allow it to just freeze and not autoclose...the way
i was doing it,is by putting a gets at the end....but i am sure there is
a better way
thanks
john
code:
puts 'what is you first name?'
name = gets.chomp
a=name.length.to_i
puts a
puts 'what is you midlle name?'
mname=gets.chomp
b=mname.length.to_i
puts b
puts 'what is you last midlle name?'
lname=gets.chomp
c=lname.length.to_i
puts c
d=a+b+c
puts 'there are ' + d.to_s + ' characters in your name:' +
mname.swapcase