Computer Science Canada Find Mean 3 Numbers |
| Author: | eNc [ 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. |
|
| Author: | Andy [ Mon Nov 01, 2004 7:18 pm ] |
| Post subject: | |
i dont see how any competent programmer can not noe how to do that??? float avg=(num1+num2+num3)/3.0; |
|
| Author: | wtd [ Mon Nov 01, 2004 7:51 pm ] | ||
| Post subject: | |||
I think maybe he's talking about "median". Psuedocode:
|
|||
| Author: | eNc [ Mon Nov 01, 2004 9:24 pm ] |
| Post 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 |
|
| Author: | zylum [ Tue Nov 02, 2004 10:01 pm ] | ||||
| Post subject: | |||||
wtd wrote: I think maybe he's talking about "median".
Psuedocode:
i think you meant
|
|||||
| Author: | wtd [ Tue Nov 02, 2004 10:27 pm ] | ||||
| Post subject: | |||||
zylum wrote: wtd wrote: I think maybe he's talking about "median".
Psuedocode:
i think you meant
Yes, of course, thank you. |
|||||
| Author: | eNc [ Wed Nov 03, 2004 3:42 pm ] | ||||
| Post subject: | |||||
wtd wrote: zylum wrote: wtd wrote: I think maybe he's talking about "median".
Psuedocode:
i think you meant
Yes, of course, thank you. well yea slight error but he meant it the other way |
|||||
| Author: | wtd [ Wed Nov 03, 2004 3:46 pm ] |
| Post subject: | |
eNc wrote: i'm not an idiot
But I am! |
|
| Author: | eNc [ Wed Nov 03, 2004 7:20 pm ] |
| Post subject: | |
wtd wrote: eNc wrote: i'm not an idiot
But I am! I DISAGREE |
|
| Author: | rizzix [ Wed Nov 03, 2004 7:24 pm ] |
| Post 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 |
|
| Author: | Hikaru79 [ Thu Nov 04, 2004 7:38 am ] |
| Post subject: | |
eNc wrote: i have this comp sci test tomrrow and omg i got the scoop on the question and omg! ! !
|
|
| Author: | McKenzie [ Thu Nov 04, 2004 12:42 pm ] | ||
| Post subject: | |||
I hate to extend an already overdone topic ... but
??? min(max(5,10),0) is 0 and clearly median is 5. |
|||
| Author: | bugzpodder [ Thu Nov 04, 2004 1:01 pm ] |
| Post subject: | |
median=a+b+c-(a>=b&&a>=c?a equilvalently, median=a+b+c-Math.Max(Math.Max(a,b),c)-Math.Min(Math.Min(b,c),a); |
|
| Author: | wtd [ Thu Nov 04, 2004 2:58 pm ] | ||
| Post subject: | |||
McKenzie wrote: I hate to extend an already overdone topic ... but
??? min(max(5,10),0) is 0 and clearly median is 5. Yes, we covered this. I'm a moron. |
|||
| Author: | eNc [ Thu Nov 04, 2004 5:51 pm ] |
| Post subject: | |
Hikaru79 wrote: eNc wrote: i have this comp sci test tomrrow and omg i got the scoop on the question and omg! ! !
my teach doens' t know about his... yet |
|
| Author: | McKenzie [ Thu Nov 04, 2004 8:45 pm ] |
| Post subject: | |
wtd, Again, I hate to beat a dead horse but the correction was just as wrong as the first code. Bugz...what are you doing? Didn't you read that he is useing this to cheat on a test? |
|
| Author: | rizzix [ Thu Nov 04, 2004 9:08 pm ] |
| Post subject: | |
ah didn't realize that... none of us did.. thread locked although it's no point now.. but a locked thread is never a good thing.. WARNING: eNc consider your self warned! |
|