...

View Full Version : Pseudocode need HELP?



oyildirimoglu
05-02-2004, 07:57 PM
Hi,

Can anyone help me create an array code that generates 50 random numbers.

thanx.

so far i done this but its not working.

arrayName= new ArrayType [sizeOfArray];
sizeOfArray = 50;
double [] numbers = {9,1,3,10,10,5,6,50,45,39,1,2,3,5,10,11,13,29,20,21,21,21,10,40,9,15,27,27,30,29,4,49,50,50,13,14,15 ,1,2,2,2,2,2,7,3,14,4,5,6,7};

dswimboy
05-02-2004, 08:56 PM
not sure what language you're using, but the only real difference between each language will be variable declaration and random number generation.
the for loop is the key here though.


int total_rands = 50;
Array random = new Array[total_rands];
for (int i=0; i<total_rands; i++) {
random[i] = random_number_var;
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum