Here is the description of my assignment:

Statistics Array Assignment. In this assignment you will be creating a new class called StatsArray based on the UML below. This class will use what you have learned about arrays and building classes. Use the StatsArray.java skeleton class provided as a starting point. This skeleton class has empty methods for you to finish. (empty methods are also called stubs) The StatsArray class works with the StatsArrayGUI.java tester class provided . As you complete each method in StatsArray, compile your class and check by running StatsArrayGUI.

The first step is to fill an int array: +fillArray() : void //fill the int array with random data in the range 0 - 100

I tried to set the random generator but I get the following error:

StatsArray.java:45: cannot find symbol

symbol : method nextInt(int[])

location: class java.util.Random

stats = random.nextInt (stats) + (101); //This is where I am at. Does not compile.

^

StatsArray.java:45: operator + cannot be applied to java.util.Random.nextInt,int

stats = random.nextInt (stats) + (101);//This is where I am at. Does not compile.

^

2 errors

----jGRASP wedge2: exit code for process is 1.

----jGRASP: operation complete.

I don't know what to do from here.

Any advise and/or assistance will be appreciated, Thanks, broncosfan.

import java.awt.*; import java.util.Random; //for our random number generator public class StatsArray { //instance variables private int size; //how big is the array private int[] stats; // an array of integers //default constructor -overloaded method StatsArray() { size = 10; stats = new int[size]; //instantiate the array called stats } public void display(Graphics g) { int x = 50; //coordinates for displaying int y = 40; //display the array with position number for(int i = 0; i < stats.length; i++) { g.drawString("Stats [" + i + "] = "+ stats[i], x, (y + 15 * i)); } } public void fillArray() { /*fill the array with random numbers (int) in the range 0 - 100.*/ Random random = new Random(); stats = random.nextInt (stats) + (101); //This is where I am at. Does not compile. } public int getSum() { //add up all the values in the array return 0; } public int getMax() { //return the maximum value in the array return 0; } public int getMin() { //return the minimum value in the array return 0; } public double getAverage() { //return the average return 0; } public int countValues(int lowRange, int highRange) { //count how many numbers are >= lowRange and <= highRange return 0; } public boolean isValueFound(int someNumber) { //check to see if someNumber is in the array return true; } public void sortArray() { /*sort the array in ascending order - selection sort*/ int tempValue; int min; for (int i = 0; i < (stats.length - 1); i++) { min = i; for (int j = (i + 1); j < (stats.length); j++) { if (stats[j] < stats[min]) { min = j; } } tempValue = stats[min]; stats[min] = stats[i]; stats[i] = tempValue; } } public void sortBArray() { /*Here is another common sort algorithm. It sorts the array in ascending order. This is called a bubble sort. I have added it so that you can take a look at it.*/ int tempValue; for (int i = 0; i < (stats.length - 1); i++) { for (int j = (i + 1); j < (stats.length); j++) { if (stats[j] < stats[i]) { tempValue = stats[i]; stats[i] = stats[j]; stats[j] = tempValue; } } } } }//end of StatsArray Class definition