Tuesday, November 8, 2011

Homework 9 - AveragingArrays.java

You are to complete exercise 6.8, p228.

The class name must be AveragingArrays. You must write it as a command line application.

This assignment requires that you write a pair of overloaded methods for averaging the contents of arrays. These are the headers:

   public static double average(int[] array)
   public static double average(double[] array)


In the book, the first method is listed as having a return type of int. This doesn't really make a whole lot of sense, so write both methods with a return type of double.

You will also need to write a pair of overloaded methods for obtaining the array contents from the user. These are the headers:

   public static void populateArray(
      Scanner scanner, int[] array)
   public static void populateArray(
      Scanner scanner, double[] array)


Sample Output
Here is a screenshot of my code running.

AveragingArrays output

Refer to the deliverables post for comment formatting and required program identification information.

Due Date:
Monday, November 14th, 8:00am