Lab 6: Array Example

Overview

This week, you're you're writing an applet that does the following: generates an array of numbers, then finds three statistics about those numbers: minimum, maximum, and average. You will use a RandomIntGenerator to fill the array with random integers, but you'll also give the user control over the size of the array and the lowest and highest numbers the RandomIntGenerator is allowed to produce.

Writing the Applet

You'll need to refer to both your lecture notes and your previous labs to get information on how to write this one. Here's an outline of the steps you'll need to take. Take some time to work through the problems before you consult a TA. The rough spots are in there intentionally.


Make your ArrayExample.html page to display the applet, and test it out until it's bug-free. The interesting things about this applet are the summary statistics, of course - the user can play with the size and bounds of the array, and see how big it has to get before the average becomes identical to the median of the two boundaries, and before the min and max become identical to the boundaries. You can get extra credit for putting some text above your applet explaining this phenomenon, but you can't get help on the extra credit from the TAs.

Don't forget to submit your .ajva file as usual (before next week's lab.)