Here is my original code 

#!/usr/bin/ruby

amount=ARGV[0].to_f

x = amount % 5.0
y = amount - x

if x > 2.0 
        puts y + 5.0
else
        puts y
end



Here is my revised code I did when I got home.

#!/usr/bin/ruby

amount=ARGV[0].to_f

x = amount % 5.0
y = amount - x

puts x > 2.0 ? y+5 : y 


-- 
Regards,

Graham Smith
_______________________________________________
coders mailing list
[email protected]
http://lists.slug.org.au/listinfo/coders

Reply via email to