i am a total novice when it comes to java. im having trouble completing this while statement. the program is supposed to compile and run and be able to add multiple numbers together until a zero is entered. any help anyone could provide would be much appreciated. thanks a lot.
import java.io.*; public class Lab11C { public static void main(String[] args) { int number = 0; int total = 0; do { System.out.print("Enter a number or 0 to quit: "); number = Utility.readInt(); System.out.println("You entered: " + number); if (number != 0) { total += number; System.out.println("Total is now " + total); } } while(im not sure what to put here, ive tried just about everything i can think of.) System.out.println("Processing complete"); } } class Utility { public static int readInt() { BufferedReader kb = new BufferedReader(new InputStreamReader(System.in)); Integer result = null; while (result == null) { try { result = new Integer(kb.readLine()); } catch(Exception err) { System.out.print("ERROR! Please try again: "); } } return result.intValue(); } }