Ruby Problem

Hi sir Martin(aka Marrtin DeMello [mailto:martindemello@yahoo.com]):

You answered:

Sorry - I was careless and didn’t test the code…

[snip]

You could make the whole thing a method of TestCase:

class TestCase
attr_accessor :num

def initialize
@num =
end

def input_nums
print "How many numbers to input? "
n = gets.chomp.to_i
0.upto(n-1) do |i|
print "Please enter number #{i+1}: "
num[i] = gets.chomp.to_f
end
end
end

ob = TestClass.new
^^^^^^^^^^^^ <-TestCase

You erred :wink:
'm just playing(nitpicking) though :slight_smile:

ob.input_nums

martin

kind regards,
-botp