// package chapter5; /** * Title: Chapter 5, "Arrays" * Description: Examples for Chapter 2 * Copyright: Copyright (c) 2000 * Company: Armstrong Atlantic State University * @author Y. Daniel Liang * @version 1.0 */ // Deviation.java: Compute deviation public class Deviation { public static void main(String[] args) { // Declare and create an array for 10 numbers double[] numbers = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; // Print numbers printArray(numbers); // Display mean and deviation System.out.println("The mean is " + mean(numbers)); System.out.println("The standard deviation is " + deviation(numbers)); } /** Method for computing deviation */ public static double deviation(double[] x) { double mean = mean(x); double squareSum = 0; for (int i=0; i