Arrays:
static String[] names;
static int[] points;
static int[] goals_scored;
static int[] goles_received;
I am asked in an exercise to get the second highest number in points array, then display the second highest team by it's name, then the points, the goals, etc like this e.g.:
Name: FC Spain
Points: 50
Goals scored: 43
Goals received: 27
I though about sorting the array but the problem is that if I sort the points array, then, the second highest position of points would not be the same as the names/goals array, also i can not sort also the goals arrays because the best team (e.g.) won't have the max goals. Right?
But also in another execise I have to display the data of the teams according to a logical criterion (like in ascending order) so I do not know what to do.
EDIT: Also, the user enters the max values that the arrays can have.
Team[]not make more sense here?