/**
 * A simple example that uses do-while loops
 *
 * @author  Professor David Bernstein, James Madison University
 * @version 1.0
 * @author  Professor Elizabeth Adams, James Madison University 
 * @version 1.1
 */
public class DoExample1
{
    public static void main(String[] args)
    {
			 // since these values don't change, have made them constants 
			 // NOTE:  reserved word final MUST precede type (in this case double)
        final double  FEET_PER_KNOT = 6080.0;
        final double  FEET_PER_MILE = 5280.0;

  	     double  feetPerHour;
 		  double  speedInKnots, speedInMPH;
	
        //    A simple do-while loop which, given  
		  //    speeds in knots ranging from 1.to 49. will compute
		  //    the corresponding speeds in miles per hour
	speedInKnots = 1.;

	do
	{
	    feetPerHour = speedInKnots * FEET_PER_KNOT;
	    speedInMPH  = feetPerHour / FEET_PER_MILE;

	    System.out.println("knots: "+speedInKnots+"\t mph: "+speedInMPH);

	    speedInKnots = speedInKnots + 1.;

	} while (speedInKnots < 50.); 	}
}
