Fall 2020 question 6: public static void printZipCodes(String str) { while(!str.equals("")) { String zipCode = str.substring(0, 5); String secondary = str.substring(6,10); System.out.println(zipCode + " " + secondary); str = str.substring(11); } str = "" } import java.util.*; import java.io.*; public class Question7{ public static void main(String[] args) throws Exception{ Scanner infile = new Scanner(new File("input.txt")); PrintWriter outfile = new PrintWriter(new File("output.txt")); String[] names = new String[100]; double[] avgDist = new double[100]; int numPeople = readData(infile, names, avgDist); infile.close(); printAvgData(outfile, avgDist, numPeople); sort(names, avgDist, numPeople); for(int i=0; i overallAvg) { countA++; } else{ countB++; } } outfile.println("The number of distances above average is "+countA); outfile.println("The number of distances below average is "+countB); outfile.println("The number of distances equal to average is "+countE); } public static void sort(String[] names, double[] dist, int n) { for(int i=0; i 0) { maxIndex = i; } } return maxIndex; } public static void swap(String[] s, double[] d, int i, int j) { String tempS = s[i]; s[i] = s[j]; s[j] = tempS; double tempD = d[i]; d[i] = d[j]; d[j] = tempD; } } arr3 = {1, 2, 3, 4, 5} x y __ ____ 12 32 doTwo: arr x y (same ___ ___ array 32 12 as array3) 10 7 1 4 2 12 15 3 1 || 7 10 4 2 12 15 3 1 2 || 10 4 7 12 15 3 1 2 3 || 4 7 12 15 10 1 2 3 4 || 7 12 15 10 1 2 3 4 7 || 12 15 10 1 2 3 4 7 10 || 15 12 1 2 3 4 7 10 12 15