Christian Rubio
2/25/2008 2:18:00 PM
Help I am completely new to ruby and to OO programming. Why-does my code
not compile??
class Quadratic
def findroots()
b = (ARGV[0])
c = (ARGV[1])
$stdout.print("You entered " , ARGV[1], ARGV[0], "\n")
discriminant = b * b - 4.0 * c
sqroot = Math.sqrt(discriminant)
root1 = (-b + sqroot) / 2.0
root2 = (-b - sqroot) / 2.0
$stdout.print(root1)
$stdout.print(root2)
end
end
if __FILE__ == $0
qf = Quadratic.new
qf.findroots
end