ex3 first try
rewrite ex3.rb to use floating point