Code /* IOapalooza1.java CIS 260 David Klick 2006-01-18 This program demonstrates simple console I/O using an InputStreamReader and a PrintStream. It also demonstrates a simple input loop and basic data validation. */ import java.io.*; public class IOapalooza1 { public static void main(String[] args) throws IOException { InputStreamReader istrm = new InputStreamReader(System.in); BufferedReader kbd = new BufferedReader(istrm); System.out.print("Enter an integer (QUIT to exit): "); String strIn = kbd.readLine(); int sum = 0; while (! strIn.equalsIgnoreCase("QUIT")) { try { int num = Integer.parseInt(strIn); sum += num; } catch (NumberFormatException e) { System.out.println("Illegal integer"); } System.out.print("Enter an integer (QUIT to exit): "); strIn = kbd.readLine(); } System.out.println("The total is " + sum); } }