On Fri, Nov 5, 2010 at 7:12 AM, Thierry Ntoh yuh <thierryny / hotmail.com> wrote:
> Please someone help me with this ruby code on putty/emacs
> Thanks
>
> Write a statistical program in Ruby to:
>
> a)         

Take a look at ARGV

> b)      
File#readlines and Array#map and String#to_f or Kernel#Float to
transform to floats

> c)        
> the
>     
sum = array.inject {|total,n| total + n} # this gives you the sum of the values

> d)        
> the
>         
> of
>      
> values.

array.sort[array.size / 2] # will sort the array and take the middle
value (or the left side one if even)

Hope this sets you on the right track. Let us know how it goes.

Jesus.