<repo_name>acc-java2/addit<file_sep>/src/edu/acc/java2/addit/Addit.java
/*
	Java 2 - ITSE-1701-351
	<EMAIL>
	www.bytecaffeine.com/acc/java/2
	proj.bat at www.bytecaffeine.com/acc/java/1/proj.bat
*/
package edu.acc.java2.addit;

public class Addit {
	private static final String EXCEPTION = "%s is not an integer.\n";
	private static final String USAGE = "java edu.acc.java2.addit.Addit <int> <int>";
	
	public static void main(String[] args) {
		
		int num1 = 0, num2 = 0, sum = 0;
		try {
			num1 = Integer.parseInt(args[0]);
		} catch (NumberFormatException nfe1) {
			System.out.printf(EXCEPTION, args[0]);
			return;
		} catch (ArrayIndexOutOfBoundsException aioobe1) {
			System.out.println(USAGE);
			return;
		}
		
		try {
			num2 = Integer.parseInt(args[1]);
		} catch (NumberFormatException nfe2) {
			System.out.printf(EXCEPTION, args[1]);
			return;
		} catch (ArrayIndexOutOfBoundsException aioobe1) {
			System.out.println(USAGE);
			return;
		}
		
		sum = num1 + num2;
		System.out.printf("The sum of %d and %d is %d\n", num1, num2, sum);
		javax.swing.JOptionPane.showMessageDialog(null, "Addit (c)2016 ACC");
	}
}











