/** * Main method. A single command-line argument is expected, which is the amount of change to * create (in other words, 75 would be equal to 75 cents). * * @param args amount of change in cents to create * @throws Exception * @author Neil Rotstan * @author Klaus Meffert * @since 1.0 */ public static void main(String[] args) throws Exception { if (args.length < 1) { System.out.println("Syntax: ConstraintExample <amount>"); } else { int amount = 0; try { amount = Integer.parseInt(args[0]); } catch (NumberFormatException e) { System.out.println("The <amount> argument must be a valid integer value"); System.exit(1); } boolean doMonitor = false; if (args.length > 1) { String monitoring = args[1]; if (monitoring != null && monitoring.equals("MONITOR")) { doMonitor = true; } } makeChangeForAmount(amount, doMonitor); } }