/* Loops5.java CIS 160 David Klick 2004-09-17 Demonstrates sentinel controlled repetition */ import javax.swing.JOptionPane; public class Loops5 { public static void main(String[] args) { String strIn; do { strIn = JOptionPane.showInputDialog("Enter a number (Q to quit)"); if (!strIn.equalsIgnoreCase("Q")) { System.out.println("You entered: " + strIn); } } while (!strIn.equalsIgnoreCase("Q")); System.exit(0); } }