/* DoubleArrayOps.java defines common operations for double[]. * * Begun by: Charles Hoot for Hands on Java. * Adapted from code by: Adams, Fall 1995, Hands on C++. * Completed by: * Date: ********************************************************************/import ann.easyio.*;public class DoubleArrayOps{	/*******************************************************	 * subArray returns a sub sequence from an array       *	 *                                                     *	 * Receive: data, an array of doubles,                 *	 *          start, an integer, and                     *	 *          stop, an integer.                          *	 * Preconditions: stop >= start                        *	 *                start >= 0                           *	 *                stop < data.length                   *	 * Output: a sub sequence of the original array.       *	 *******************************************************/	public static double[] subArray(double data[], int start, int stop) 	{		double newData[] = new double[stop-start+1];				int storeAt = 0;		for (int i = start; i<= stop; i++)			newData[storeAt++] = data[i];					return newData;	}			// A basic print operation for an array	public static void printArray(Screen out, double data[]) 	{		for (int i = 0; i< data.length; i++)			out.print(data[i] + " ");	}		// replace this line with a definition of average()	// replace this line with a definition of standardDev()}
