i am taking a beginners java course and i have written a code to add a
bunch of inputs when entered in dialog boxes, and the code ends when
it hits 0, however, i am also asked to average these numbers and i am
not sure how to do this, anyone have a clue? please let me know
Alex Hunsley - 30 Nov 2003 17:50 GMT
> i am taking a beginners java course and i have written a code to add a
> bunch of inputs when entered in dialog boxes, and the code ends when
> it hits 0, however, i am also asked to average these numbers and i am
> not sure how to do this, anyone have a clue? please let me know
The average is the sum of the numbers, divided by the amount of numbers
you added (summed).
E.g. the average of 1, 3, 4, and 4 is (1+3+4+4)/4 = 12/4 = 3