Hello,

i don know how to build a loop for the following problem:

class TestClass
  def input(num1,num2,num3,num4,num5,num6)    #<-- does that make sense? Is it right?
    @num1=num1
    @num2=num2
    @num3=num3
    @num4=num4
    @num5=num5
    @num6=num6
  end
   
  attr_accessor :num1
  attr_accessor :num2
  attr_accessor :num3
  attr_accessor :num4
  attr_accessor :num5
  attr_accessor :num6
end

ob = TestClass::new

6.times do |i|
  print "Enter number #(i+1): "
  ob.num[i]=gets.to_f          #<---this is my problem
end

Maybe youe found some other mistakes or things i should do better. Id be very happy if yould help me cause im very new to ruby. Thank you very much.

Kind regards,
Stefano

-- freenet Email-Office: E-Mail, Kalender und 30 MB virtuelle Festplatte. Jetzt testen unter www.freenet.de/tipp/emo