I have written a program that stores 1000 random numbers in an array, and finds the average. The question is, how do I actually test it? When I try to run it, all that comes up is the class name. Here is the code:
import java.util.*;
import java.io.*;
public class Random
{
public static void main(String[] args)
{
double [] random = new double[1000];
for( int i = 0; i < random.length; i++)
{
random[i] = Math.random();
double sum = 0;
for (int j = 0; j < random.length; j++)
sum += random[i];
double average = sum/random.length;
}
}
}
Can someone help me with how I would incorporate input/output?
Thanks a lot


Sign In
Create Account

Guest_scarfacemontana_*
Back to top









