   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 ();
         } 		 
      }
   
   
       public static int calculate(int x, int y) 
    
      { 
		 int a, b, counter; 
         counter = 0;
	      do 
			
			{
			  counter++;
			   a = 1; // S1 
            if (x > y) // S2 
            { 
               a = 2; // S3
            } x++; // S4 
            b = x * a; // S5 
         } while (b <= 0); // S6 
	     System.out.println (" number of times it looped is " + counter);		     
 				      return b; // S7 } 
      }
   } 
