I'm creating a console game in Java. And I want to keep track of the scores and names.
I've already created two arrays.
String[] PlayerNames = {"Bob", "Rick", "Jack"}; // just an example
int[] PlayerScores = {40, 20, 60}; // just an example
I want to sort their scores, but also know who the score belongs to, and then print it out like this:
Jack 60
Bob 40
Rick 20