   import java.util.Scanner;
/******************************************************** 
  * OffByOne.java is a mini example showing an off by one 
  * error.
  *
  * @author Nancy Harris
  * @version V1 - 10/19/2008
  *******************************************************/
    public class OffByOne
   {
   /* main method runs through the loop 
	 *
    * @param args Unused in this application
    */
       public static void main(String args[])
      {  
         final int HI_VAL = 10;
			final int LO_VAL = 1;
			final boolean DEBUG = true;
			
			int count;
			int sum;
			
			// This loop sums the values between lo and hi values inclusively
			count = LO_VAL;
			sum = 0;
			
			while (count < HI_VAL)
			{
				sum = sum + count;
				
				// debug prints.  before we change count
				if (DEBUG) System.out.print("Count: " + count);
				if (DEBUG) System.out.println("\tSum: " + sum);	

				count = count + 1;
				
			} // end while
			
			System.out.println("Sum is: " + sum);			 
		}
	}	
					