import java.util.Scanner; public class TestingExample { public static void main (String [] args) { int result, myX, myY; Scanner myKeyboard; for (int i = 0; i <= 5; i++) { myKeyboard = new Scanner(System.in); System.out.print("Please enter an integer and hit return "); myX = myKeyboard.nextInt(); System.out.print("Please enter an integer and hit return "); myY = myKeyboard.nextInt(); result = calculate( myX, myY); System.out.println (" When myX is " + myX + " and myY is " + myY + " result is " + result); System.out.println (); } // end for } // end main public static int calculate(int x, int y) { int a, b; do { a = 1; // S1 if (x > y) // S2 { a = 2; // S3 } x++; // S4 b = x * a; // S5 } while (b <= 0); // S6 return b; // S7 } // end calculate } // end class