I some code that will output a list of numbers in an array, based on "count" along with the average of all the OTHER numbers in the array.
So...
Suppose there were four numbers: 5, 3, 2, and 7. The program is then required to display the following:
5.00 4.00
3.00 4.67
2.00 5.00
7.00 3.33
(Note that, to two decimal places, 4.00 is the average of 3, 2 and 7. etc. etc.)
Now I have all the rest of the code, I'm just stuck on how I go about doing the "average of all the OTHER numbers in the array" bit. I was never really good at maths, so it's a little hard for me to write it in english, then java-fy it.
Question
shrike
I some code that will output a list of numbers in an array, based on "count" along with the average of all the OTHER numbers in the array.
So...
Suppose there were four numbers: 5, 3, 2, and 7. The program is then required to display the following:
5.00 4.00
3.00 4.67
2.00 5.00
7.00 3.33
(Note that, to two decimal places, 4.00 is the average of 3, 2 and 7. etc. etc.)
Now I have all the rest of the code, I'm just stuck on how I go about doing the "average of all the OTHER numbers in the array" bit. I was never really good at maths, so it's a little hard for me to write it in english, then java-fy it.
Thanks, if anybody can help me out.
Link to comment
Share on other sites
13 answers to this question
Recommended Posts