Statistics - return(double)result(numbers.length 1 public...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
//******************************************************************** // Statistics.java Author: Lewis and Loftus // // Solution to Programming Project 6.6 // //******************************************************************** / public class Statistics { public static double mean(int[] numbers) { double result = 0.0; for (int i=0; i< numbers.length; i++) result += numbers[i];
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: return (double)result / (numbers.length + 1); } public static double standardDeviation(int numbers) { double result = 0.0; double mean = mean(numbers); // compute summation for (int i=0; i<numbers.length; i++) { result += ((double)numbers[i] - mean) * ((double)numbers[i] - mean); } result = result / numbers.length; return Math.sqrt(result); } }...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online