Reassigning the value of variables in Ruby?
Try something like this where you use lower case variable names rather than upper case constant names: def square_root(radicand) a, b = radicand, 1 tolerance = 0.00000000000000000001 while (a – b).abs > tolerance a = (a + b) / 2 b = radicand / a end a end print “Enter the radicand:” radicand = gets.to_f … Read more