/**
 * CS139 - Programming Fundamentals
 * Department of Computer Science
 * James Madison University
 * @version Spring 2016
 */

Resources

Background

The goal for this activity is to re-write the solution to our earlier statistics activity using ArrayLists instead of arrays. Recall that in the array version of the code the user was required to provide a command line argument specifying how many values they intended to enter. This was necessary so that we could allocate an array with enough capacity to store the input.

With ArrayLists, we don't need to know how many elements we will store in advance. There is no need to ask the user to provide this information.

Part 1: Review

If you didn't complete the earlier lab, download the solution from Canvas and look over the code. Make sure you understand how the array-based solution works.

Part 2: Re-Write

Re-write Stats.java and StatDriver.java with the following changes:

Once you have completed and tested your code, create a zip file containing StatDriver.java and Stats.java files and submit it through WebCat. Web-CAT will not run Checkstyle tests on your submission.

Part 3: If You Have Extra Time

  1. Add a median method to your Stats.java class. (The Collections.sort method will probably be helpful.)