Here's what I got so far. I'm not sure how to implement comparable interface on insertionSort method. I have 3 java class, one tester method, one main, and another that does insertion sort.

Here's insertion Sort code. (that has some errors that I can't figure out)

public class Sorter
{
/** Insertion sort of an array of characters into non-decreasing order */
public static void insertionSort(Comparable[] a)
{
int n = a.length;
for (int i = 1; i < n; i++) { // index from the second character in a
Comparable cur = a[i]; // the current character to be inserted
int j = i - 1; // start comparing with cell left of i
while ((j >= 0) && (a[i] > cur)) // while a[j] is out of order with cur
a[j + 1] = a[j--]; // move a[j] right and decrement j
a[j + 1]=cur; // this is the proper place for cur
}

}
}

and here's separate class (java file)

public class GameEntry implements Comparable<GameEntry>
{

private String name;
private int score;
public static final int SORT_BY_SCORE = 1;
public static final int SORT_BY_NAME = 2;
private static int typeSortBy;

public GameEntry(String n, int s)
{
name = n;
score = s;
}

public String getName()
{
return name;
}

public int getScore()
{
return score;
}

public String toString()
{
return "(" + name + ", " + score + ")";
}

public static void setSortBy(int sortBy)
{
if(sortBy == 2)
typeSortBy = sortBy;

else if(sortBy == 1)
typeSortBy = sortBy;

else
throw new IllegalArgumentException("Illegal sortBy argument: " + sortBy);
}

public int compareTo(GameEntry OtherObj)
{
if (typeSortBy == 1) {
if (this.score > OtherObj.score)
return SORT_BY_SCORE;
if (this.score < OtherObj.score)
return -SORT_BY_SCORE;
else
return (SORT_BY_SCORE-SORT_BY_SCORE);
}

if (typeSortBy == 2){
if (this.name.compareTo(OtherObj.name) > 0)
return SORT_BY_SCORE;
if (this.name.compareTo(OtherObj.name) < 0)
return -SORT_BY_SCORE;
else
return (SORT_BY_SCORE- SORT_BY_SCORE);
}
else
return SORT_BY_NAME;


}

}

Here's tester method (separate java file)
import java.io.PrintStream;
import java.util.Arrays;

public class SortTester
{

public SortTester()
{
}

public static void main(String args[])
{
GameEntry entries[] = new GameEntry[4];
entries[0] = new GameEntry("Frank", 5000);
entries[1] = new GameEntry("Bob", 2000);
entries[2] = new GameEntry("Susan", 3000);
entries[3] = new GameEntry("Amelia", 4000);
try
{
GameEntry.setSortBy(3);
}
catch(Exception e)
{
e.printStackTrace();
}
GameEntry.setSortBy(2);
Sorter.insertionSort(entries);
System.out.println(Arrays.toString(entries));
GameEntry.setSortBy(1);
Sorter.insertionSort(entries);
System.out.println(Arrays.toString(entries));
}
}

Any tip, help, guidances will be appreciated, thanks