Hello everyone! I'm new here and started computer programming in September 2010 at my high school.
Ok, so in class we receive program lists that contain instructions for programs our teacher wants us to make. And so I need help with one that requires me to read 30 random numbers and reads out the mean and mode, by using arrays (which I still dont complete understand). Please forgive me for my vast ignorance; I feel my computer science is extremely lax and has not adequately taught us over the months about what we should know by now.
Well here's the program(how do I format again?):
import java.util.Random; public class TestScores { public static void main (String [] args) { int scores=0; int avg; int mean; int mode; final int LIMIT = 15, MULTIPLE = 100; int[]list = new int [LIMIT]; Random generator = new Random(); //Initialize the array values for (int score = 0; score < LIMIT; score++) {list [score] = generator.nextInt(30); scores += list[score]; } avg = scores/30; //Print the array values for (int value : list) System.out.print ( + " "); } }