Posted: Mon Nov 01, 2004 5:22 pm Post subject: 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.
Sponsor Sponsor
Andy
Posted: Mon Nov 01, 2004 7:18 pm Post subject: (No subject)
i dont see how any competent programmer can not noe how to do that??? float avg=(num1+num2+num3)/3.0;
wtd
Posted: Mon Nov 01, 2004 7:51 pm Post subject: (No subject)
I think maybe he's talking about "median".
Psuedocode:
code:
max(min(number_1, number2), number_3)
eNc
Posted: Mon Nov 01, 2004 9:24 pm Post subject: (No subject)
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 20 bits 2 u
zylum
Posted: Tue Nov 02, 2004 10:01 pm Post subject: (No subject)
wtd wrote:
I think maybe he's talking about "median".
Psuedocode:
code:
max(min(number_1, number2), number_3)
i think you meant
code:
min(max(number_1, number_2), number_3)
wtd
Posted: Tue Nov 02, 2004 10:27 pm Post subject: (No subject)
zylum wrote:
wtd wrote:
I think maybe he's talking about "median".
Psuedocode:
code:
max(min(number_1, number2), number_3)
i think you meant
code:
min(max(number_1, number_2), number_3)
Yes, of course, thank you.
eNc
Posted: Wed Nov 03, 2004 3:42 pm Post subject: (No subject)
wtd wrote:
zylum wrote:
wtd wrote:
I think maybe he's talking about "median".
Psuedocode:
code:
max(min(number_1, number2), number_3)
i think you meant
code:
min(max(number_1, number_2), number_3)
Yes, of course, thank you.
well yea slight error but he meant it the other way i'm not an idiot i understood what he ment.
wtd
Posted: Wed Nov 03, 2004 3:46 pm Post subject: (No subject)
eNc wrote:
i'm not an idiot
But I am!
Sponsor Sponsor
eNc
Posted: Wed Nov 03, 2004 7:20 pm Post subject: (No subject)
wtd wrote:
eNc wrote:
i'm not an idiot
But I am!
I DISAGREE
rizzix
Posted: Wed Nov 03, 2004 7:24 pm Post subject: (No subject)
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
Hikaru79
Posted: Thu Nov 04, 2004 7:38 am Post subject: (No subject)
eNc wrote:
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
Posted: Thu Nov 04, 2004 12:42 pm Post subject: (No subject)
I hate to extend an already overdone topic ... but
code:
min(max(number_1, number_2), number_3)
???
min(max(5,10),0) is 0
and clearly median is 5.
bugzpodder
Posted: Thu Nov 04, 2004 1:01 pm Post subject: (No subject)