average and medians of arrays

I need to calculate the average and median of an array. I do not know how to put it in code. any help?
Topic archived. No new replies allowed.