
-----------------------------------
ford_masta_665
Thu Feb 10, 2005 5:10 pm

Simple problem : getting a median
-----------------------------------
I know this is tupid, but could somebody please remind me how to make a program where the user inputs a bunch of #s and the comp outputs the median of those #s? thanx

-----------------------------------
Cervantes
Thu Feb 10, 2005 5:33 pm


-----------------------------------
It will probably involve sorting an array of numbers then using the middle element of that array as your median.
If you don't know how to sort an array, try to work out your own method.  :)

P.S. Welcome to the site :)

-----------------------------------
TheZsterBunny
Sat Feb 12, 2005 8:14 am


-----------------------------------
good lord!

I posted an answer to this question barely a week ago!

please do a search before making a new topic

-Z

-----------------------------------
endusto
Sun Feb 13, 2005 11:25 am


-----------------------------------
try this

var med1, med2, med3, med4:int
put "Enter four numbers"
get med1
get med2
get med3
get med4
put (med1 + med2 + med3 + med4) / 4


-----------------------------------
ssr
Sun Feb 13, 2005 12:26 pm


-----------------------------------
try this

var med1, med2, med3, med4:int
put "Enter four numbers"
get med1
get med2
get med3
get med4
put (med1 + med2 + med3 + med4) / 4


*** I think he said  the median 
not the mean :lol:

-----------------------------------
ssr
Sun Feb 13, 2005 12:30 pm


-----------------------------------
I was readin this  :lol: 

-----------------------------------
ssr
Sun Feb 13, 2005 12:33 pm


-----------------------------------
btw, that one was mostly for finding the mode, its harder.
But median is basically just find the middle #, if even then add up the middle 2 and divide them by 2  
That ow I learnt it anywayz 8)  8)
