Public paste
cleanerwhile
By: microhaxo | Date: Nov 12 2008 02:01 | Format: None | Expires: never | Size: 733 B | Hits: 1048

  1. import java.util.Scanner;
  2. public class InputRange
  3. {
  4.         public static void main(String[] args)
  5.         {
  6.  
  7.                 Scanner scan = new Scanner(System.in);
  8.                 System.out.println ("What number starts the range?");
  9.                 String f = scan.nextLine();
  10.                 System.out.println ("what number ends the range?");
  11.                 String s = scan.nextLine();
  12.                 System.out.println("what number do you increment by?");
  13.                 String t = scan.nextLine();
  14.                 System.out.println("The numbers in the range from " + f + " to " + s + " incremented by " + t);
  15.                 int first = Integer.parseInt(f);
  16.                 int second = Integer.parseInt(s);
  17.                 int third = Integer.parseInt(t);
  18.                 while (first < third)
  19.                 {
  20.                 System.out.println("count is : " + f);
  21.                         first++;
  22.                         first=+third;
  23.                         }
  24.                 }
  25.         }