/* Output the integers 1 up to a number entered by the user. * * For Example - if the user enters 10 the output will be 1 2 3 4 5 6 7 8 9 10 */ import javax.swing.JOptionPane; class Loop3{ public static void main(String [] args){ final int STARTING_POINT = 1; String input = JOptionPane.showInputDialog("How high do you want to count ?"); int high = Integer.parseInt(input); int i = STARTING_POINT; while(i <= high){ System.out.print(i + " "); i += 1; } System.out.println(); System.exit(0); } }