import cse1030.Die; import java.util.List; import java.util.ArrayList; public class Lab01C { public static void main(String[] args) { Die d = new Die(8); // Create a list to keep count of the number of times each // face value appears; initialize the counts to zero. List freq = new ArrayList(); for (int i = 0; i < d.getFaces(); i++) { freq.add(0); } final int TRIALS = 80000; for (int trial = 0; trial < TRIALS; trial++) { d.roll(); int value = d.getValue(); int frequencyOfValue = freq.get(value - 1); freq.set(value - 1, frequencyOfValue + 1); } int value = 1; for (Integer i : freq) { System.out.println(value + " : " + i); value++; } } }