package ClassStuff; import java.util.Random; public class Main { public static void main(String[] args) { System.out.println("hey!"); Random rand = new Random(); final int BIGGEST = 1000; final int NUM_NUMS = 10000; System.out.println(rand.nextInt(BIGGEST)); int nums[] = new int[NUM_NUMS]; populateArray(nums, BIGGEST, rand); //for (int i = 0; i < NUM_NUMS; i++ ) //System.out.println(i + " " + nums[i]); System.out.println(calcAverage(nums)); ThreeWayBulb b1 = new ThreeWayBulb(); ThreeWayBulb b2 = new ThreeWayBulb(); b1.turnSwitch(); System.out.println("b1 - " + b1.getLevel()); System.out.println("b2 - " + b2.getLevel()); } public static void populateArray(int nums[], int biggest, Random rand) { for (int i = 0; i < nums.length; i++ ) nums[i] = rand.nextInt(biggest); } public static double calcAverage(int nums[]) { int total = 0; for (int i = 0; i < nums.length; i++) total = total + nums[i]; return total / (double) nums.length; } }