I need the names of the card, rates, and amount owed to print out. however im not sure how to do this. please help. been stuck for too long.
the class that needs work is the selectionSort class.
THANKS in advance.
public class sortparallelarrays { public static void main (String [] args) { String [] card = {"Disney Rewards" , "Amazon Rewards", "Chase Sapphire", "Marriott Rewards"}; double [] rates = {14.24, 13.24, 15.24, 14.20}; double [] owed = {4500.00, 1300.10, 3200.80, 775.00}; double amount; displayHeader(); selectionSort(card, rates, owed); } public static void displayHeader() { System.out.printf("%8s %9s %10s %16s \n" , "Card", "Rate of Interest", "Amount owed", "In one year, you'll owe"); System.out.println("==================================================================="); } public static void displayValues(String [] c, double [] r, double [] owed) { System.out.printf("%8s %18s %25s \n", c, r, owed); } public static void selectionSort(String [] card, double [] rates, double [] owed) { for (int i=0; i< rates.length; i++) { for (int j=i+1; j< rates.length; j++){ if (rates[j] > rates[i]){ double temp = rates[i]; rates[i] = rates[j]; rates[j] = temp; String temppp = card[i]; card[i] = card[j]; card[j] = temppp; double tempppp = owed[i]; owed[i] = owed[j]; owed[j] = tempppp; } } } for (int i=0; i<rates.length; i++){ System.out.println(); System.out.print( rates[i]); } } }