import java.io.*; class Numbers6 { // A demonstration of non-mutating sort of an array of integers static final int SENTINEL = -999; static final int MAXNUMS = 100; public static void main (String[] args) throws IOException { int [] data; int [] sortedData; 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); sortedData=Sorter.makeSort(data,count); System.out.println("After sorting the number are:"); NumberOps.printall(sortedData,count); System.out.println("To show the old data is unchanged, here it is:"); NumberOps.printall(data,count); } }