public class Lecture7b {
  // check that b is non zero - if it is, print an error message
  // otherwise divide a by b and resturn result.
  public static void main (String [] args) {
    String result;
    System.out.print("enter an integer: ");
    int a = In.getInt();
    System.out.print("enter an integer: ");
    int b = In.getInt();
    if (b == 0) {
      result = "divide by zero not allowed";
    } else {
      result = "the result of " +a + " divided by " + b  +" is " + (double)a/b ;
    }
    System.out.print(result);
  }
}
 