y += next; int total= sum( z, many ); float avg= float(total) / many; text( "The total is: "+total, 100, y ); y += next; text( "The average is: "+avg, 100, y ); //// Title, etc.. textSize(20); text( title, width/4, 20 ); textSize(12); text( help, width/4, 40 ); text( author, 20, height-20 ); } //// Return the sum total //// int sum( int a[], int m ) { int result=0; for (int j=0; j a[w]) w=j; } swap( a, w, m-1 ); } void swap( int p[], int a, int b ) { //// exchange p[a] with p[b] int tmp= p[a]; p[a]= p[b]; p[b]= tmp; } void small( int a[], int m ) { // Move the smallest number to the beginning of the array // (Swap, to keep all numbers.) int w=0; for (int j=1; j1; k--) { big( q, k ); } }