From: Craig Schweitzer Date: 2006-03-28T09:22:04+09:00 Subject: Would this be possible? Would this work to find the mean average and the number of elements greater than the average? # Calculating Avg and # of elements greater than Avg. in Ruby sum = 0.0 n = 0 count = 0 while figure = STDIN.gets.to_f sum += figure n += 1 end average = sum / n puts "Average = #{average}" while figure = STDIN.gets.to_f if figure > average count +=1 end end puts “Number of elements greater than Avg = #{count}” -- Posted via http://www.ruby-forum.com/.