I have to create a program which generates 10000 random numbers between 0 and 1 using the Math.random(). We then have to display the largest and smallest numbers, and the average of all the numbers. We are supposed to use a loop. Here is the code I have so far. All I've figured out how to do is generate the random numbers. If somebody could help me from here it would be much appreciated!

public class RandAnalysis { public static void main(String[] args) { for(int i = 0; i < 10000; i++) System.out.println("Random number ["+ (i+1) +"]:" + Math.random()); } }