1 import java.util.Scanner;
2
3 public class DiceAnalyzer
4 {
5 public static void main(String[] args)
6 {
7 final int SIDES = 6;
8 DiceCounter counter = new DiceCounter(SIDES);
9 System.out.println("Please enter values, Q to quit:");
10 Scanner in = new Scanner(System.in);
11 while (in.hasNextInt())
12 {
13 int value = in.nextInt();
14 if (1 <= value && value <= SIDES)
15 {
16 counter.addValue(value);
17 }
18 else
19 {
20 System.out.println(value + " is not a valid input.");
21 }
22 }
23 counter.display();
24 }
25 }