//7. Write a class called RandomNumbers to do the following:
//a. Write a method called generate to randomly generate a 1000 numbers in the range [50..100]. Find and return the sum of these numbers.
//b. Write a method called output to receive the sum. Output the sum
import java.util.*;
public class RandomNumbers
{
// declarations
int sum=0;
public static void main (String[]a)
{
// method to generate a 1000 numbers in the range [50..100]and sum up those numbers
public double random() <<<< that's where I get an error but I "illegal start of expression"
{
for(int i=1;i<=1000;i++)
{
int number=(int)(math.random()*51)+100;
}
sum=sum+number;
return sum;
}
}
public void output(int sum)
{
System.out.print("The sum is :"+sum);
}
}
can you pick up an error above?? please help