// Collection of code snippets by Arne Vajhøj 
// (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) 
import java.util.Random;

public class Rng {
    public final static int N = 10;
    public final static int K = 100;
    public static void main(String[] args) {
        // initialize random generator
        Random rng = new Random();
        for(int i = 0; i < N; i++) {
            // generate random integer in the range from 0 (inclusive) to K-1 (inclusive)
            int rani = rng.nextInt(K);
            System.out.println(rani);
        }
        for(int i = 0; i < N; i++) {
            // generate random double in the range 0.0 (inclusive) to 1.0 (exclusive) 
            double ranx = rng.nextDouble();
            System.out.println(ranx);
        }
    }
}
