Please I'm trying to compile the program. I'm being asked for a return type and variable. Please could u fix it. The program is meant 2 calculate the mean of up to 10000 randomly generated numbers. Thanks
[CODE=java] class Test1
{
static float mu1,mean1;
public static void setMean(float mu1)
{
mean1=mu1;
}
public static float[] generateRandom( )
{
Random generator = new Random();
float total=0.0f;
int count = 10000;
for(int i = 0; i<count; i++){
total += (float)generato r.nextGaussian( );
float am[] = new float[2];
am[0] = total;
}
}
}
public class Test
{
public static void main(String[] args)
{
Test1 bgg = new Test1();
bgg.setMean(1.0 f);
float[] x = bgg.generateRan dom();
System.out.prin tln("["+ x[0]+"]");
}
}[/CODE]
[CODE=java] class Test1
{
static float mu1,mean1;
public static void setMean(float mu1)
{
mean1=mu1;
}
public static float[] generateRandom( )
{
Random generator = new Random();
float total=0.0f;
int count = 10000;
for(int i = 0; i<count; i++){
total += (float)generato r.nextGaussian( );
float am[] = new float[2];
am[0] = total;
}
}
}
public class Test
{
public static void main(String[] args)
{
Test1 bgg = new Test1();
bgg.setMean(1.0 f);
float[] x = bgg.generateRan dom();
System.out.prin tln("["+ x[0]+"]");
}
}[/CODE]
Comment