Posted by: LahureDai February 4, 2009
java -assignment help!!!!!!!!!!!
Login in to Rate this Post:     0       ?        
redLotus,

 I am not going to do the entire homework for ya. Here are some important points, which might be helpful.

int [] test; // declare test to be an array of type int
test = new int[20]  //  allocate test of 20 ints

for( int i =0; i < test.length ; i++)  //test.length prevents from overrunning the end of an array

for random numbers, you need to call the method  Math.random()
But math,random() returns double from 0.0 to 1.0. So you need to add

(int)(10.0 * Math.random() + 1); //returns random int from 1 to 10
modify the code little bit if you want to print the random numbers from 1 to 100 or so

make sure you include your import statement, import java.util.*;

Hope it helps!I pretty much gave you the entire answer :)
Read Full Discussion Thread for this article