D
Dot Baiki
Hello
Please, can someone help me with this problem. I am really stuck. Can't
find my problem. Simple code snippet is not working at all. I totally
desperate.
Look at this:
--------------------start
#!/usr/bin/env ruby
class AreaOfCircle
PI = 3.14159265
def initialize(radius, area)
@radius = radius
@area = area
end
def calc_area(radius)
@area = PI * @radius**2
end
end
print 'Enter radius of circle: '
keyboard_input = gets
radius = keyboard_input.to_f
instance = AreaOfCircle.new
screen_output = instance.calc_area(keyboard_input)
puts screen_output
----------------------------------- end
I'm already pulling my hairs (not much left by now). Hopefully you can
give me any hint!
Regards,
Baiki
Please, can someone help me with this problem. I am really stuck. Can't
find my problem. Simple code snippet is not working at all. I totally
desperate.
Look at this:
--------------------start
#!/usr/bin/env ruby
class AreaOfCircle
PI = 3.14159265
def initialize(radius, area)
@radius = radius
@area = area
end
def calc_area(radius)
@area = PI * @radius**2
end
end
print 'Enter radius of circle: '
keyboard_input = gets
radius = keyboard_input.to_f
instance = AreaOfCircle.new
screen_output = instance.calc_area(keyboard_input)
puts screen_output
----------------------------------- end
I'm already pulling my hairs (not much left by now). Hopefully you can
give me any hint!
Regards,
Baiki