class LCG{ /* * This is the RNG presented in class - we changed only the way it gets the initial seed * Instead of using the current time we start with 0 */ static final long m = 2147483647; static final long b = 12345; static final long a = 1103515245; static long u = 0; static double save; static boolean even = false; static final double TWO_PI = 6.2831853071795864769252866; public static double Uniform(){ u = (u * a + b) % m; return(double)u/m; } /* This is the code you should complete Remember that you are supposed to not waste random number draws - meaning that you should generate two numbers at once and save one which you will return upon next call */ public static double generateGaussian() { return 0; // stub, to be replaced } } class Main { // do not change this or revert back after testing, otherwise the judge will provide misleading results public static void main(String[] args) { for (int i = 0; i < 20; i++) System.out.println((int)(10*LCG.generateGaussian())); //we cast to int just for the judge (to avoid numerical problems) } }