// Java class Tutorial // BubbleSort array (random values) + sum + moving average // // Save to: BubbleSort.java // javac BubbleSort.java // java BubbleSort public class BubbleSort { // BubbleSort random array class public static void main(String[]args) { // main function int [] sortArray = new int [20]; sortArray(sortArray); } // end of main function public static void sortArray(int [] sArray) { // (bubble) sort array method int result=0; int sum = 0, randNum, swapVal; double movAvg = 0.0; for (int i=0; i sArray[j+1]){ swapVal = sArray[i]; sArray[i] = sArray[j+1]; sArray[j+1] = swapVal; } //end of if } //end of for (inner) System.out.print(sArray[i] + " "); // temporary debug line 2 of 2 } //end of for (outer) System.out.println(""); } //end of (bubble) sort array method } //end of Java class