
-----------------------------------
eNc
Mon Nov 01, 2004 5:22 pm

Find Mean 3 Numbers
-----------------------------------
Hi how do you find the mean of 3 numbers if you can't use if  statements, for loops, loops, arrays, basically nothing more advanced than  Math.max function.

-----------------------------------
Andy
Mon Nov 01, 2004 7:18 pm


-----------------------------------
i dont see how any competent programmer can not noe how to do that??? float avg=(num1+num2+num3)/3.0;

-----------------------------------
wtd
Mon Nov 01, 2004 7:51 pm


-----------------------------------
I think maybe he's talking about "median".

Psuedocode:
max(min(number_1, number2), number_3)

-----------------------------------
eNc
Mon Nov 01, 2004 9:24 pm


-----------------------------------
omg wtd yea thats wut i meant, ty so much u saved me again!


omg man ure my hero man omg i'm so happy, i have this comp sci test tomrrow and omg i got the scoop on the question and omg! ! ! i was like stuk and u saved me omg ure my hero i'm so happy :D  :D  :D  :D  :D  :D  :D  :D  :D  :D  :D  :D  :D  :D  :D  :D  :D  :D  :D  :D  :D  :D  :D  :D  :D  :D  :D 20 bits 2 u  :P

-----------------------------------
zylum
Tue Nov 02, 2004 10:01 pm


-----------------------------------
I think maybe he's talking about "median".

Psuedocode:
max(min(number_1, number2), number_3)

i think you meant 

min(max(number_1, number_2), number_3)

-----------------------------------
wtd
Tue Nov 02, 2004 10:27 pm


-----------------------------------
I think maybe he's talking about "median".

Psuedocode:
max(min(number_1, number2), number_3)

i think you meant 

min(max(number_1, number_2), number_3)

Yes, of course, thank you.

-----------------------------------
eNc
Wed Nov 03, 2004 3:42 pm


-----------------------------------
I think maybe he's talking about "median".

Psuedocode:
max(min(number_1, number2), number_3)

i think you meant 

min(max(number_1, number_2), number_3)

Yes, of course, thank you.


well yea slight error but he meant it the other way :P i'm not an idiot i understood what he ment.

-----------------------------------
wtd
Wed Nov 03, 2004 3:46 pm


-----------------------------------
i'm not an idiot

But I am!  :)

-----------------------------------
eNc
Wed Nov 03, 2004 7:20 pm


-----------------------------------
i'm not an idiot

But I am!  :)


 I DISAGREE

-----------------------------------
rizzix
Wed Nov 03, 2004 7:24 pm


-----------------------------------
haha.. now think about this.. if a person says he's an idiot.. you should never disagree.. by disagreeing you have acknowledge your self more of an idiot than he/she is.. so you should always agree   :lol: LOL

-----------------------------------
Hikaru79
Thu Nov 04, 2004 7:38 am


-----------------------------------
 i have this comp sci test tomrrow and omg i got the scoop on the question and omg! ! !

 :? Probably not a good idea to say that aloud. Especially not on a forum that a few teachers lurk around on.

-----------------------------------
McKenzie
Thu Nov 04, 2004 12:42 pm


-----------------------------------
I hate to extend an already overdone topic ... but
min(max(number_1, number_2), number_3) 
???
min(max(5,10),0)  is 0
and clearly median is 5.  :wink:

-----------------------------------
bugzpodder
Thu Nov 04, 2004 1:01 pm


-----------------------------------
median=a+b+c-(a>=b&&a>=c?a:(b>=a&&b>=c?b:c))-(a