import java.util.Random;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Random random = new Random();
        Scanner scan = new Scanner(System.in);

        System.out.print("Number of random values to create: ");
        int numberToRandomize = scan.nextInt();

        scan.close();

        double sum = 0;

        for(int i = 0; i < numberToRandomize; i++) {
            double randomNumber = random.nextDouble();

            System.out.println("Random Number " + (i + 1) + ": " + randomNumber);

            sum += randomNumber;
        }

        System.out.println("Sum = " + sum);
        System.out.println("Average = " + (sum / numberToRandomize));
    }
}