import java.util.Random; public class Main { public static void main(String[] args) { // Run the helper method 10,000 times and make sure all // integers are in the correct range for(int i=0;i<10000;i++){ int var = getRandom(100,200); if(var > 200){ System.out.println("WRONG" + var); } if(var<100){ System.out.println("WRONG" + var); } } } /**Helper Method to return a random number in a give range * * @param lower, the lower bound to be included in the range * @param upper, the upper bound to be included in the range * @return, and integer in the range */ public static int getRandom(int lower, int upper){ //Don't forget to import java.util.Random; Random rnd = new Random(); return (rnd.nextInt(upper-lower+1)) + lower; } }