import java.io.*; class Numbers4 { // Read a number of integers and store them in an array. // Sort them in place. static final int SENTINEL = -999; static final int MAXNUMS = 100; public static void main (String[] args) throws IOException { int [] data; int count,n; BufferedReader in = Text.open(System.in); data = new int[MAXNUMS]; for(count=0; ;count++) { System.out.print("Enter number "+(count+1)+" (or "); System.out.print(SENTINEL+" to finish): "); n=Text.readInt(in); if(n==SENTINEL) break; data[count]=n; } System.out.println("The numbers entered were:"); NumberOps.printall(data,count); Sorter.sort(data,count); System.out.println("After sorting the number are:"); NumberOps.printall(data,count); } }