/** * Simple Picture manipulation * * @author Pat Troy: troy AT uic DOT edu */ // Note the name of the class in the following line MUST // match the name of the file. This is stored in a file // named: Template.java public class Lect1013a { public static void main (String[] args) { int num; int den; int result; // prompt the user for the numerator and denominator num = SimpleInput.getIntNumber ("Enter an integer:"); den = SimpleInput.getIntNumber ("Enter an integer:"); // Code to check for a division by zero. if ( den == 0 ) { // display an error message SimpleOutput.showError ("Can not divide by zero: quitting program. "); // quit the program System.exit(1); } result = num / den; SimpleOutput.showInformation ("The result of the the division is: " + result); } // end of main } // end of class