i use three arrays where in
System.out.println("Enter number of process: ");
int process = in.nextInt();
String name[] = new String[process];
int age[] = new int[process];
double income[] = new double[process];
bla bla bla so basically i used three arrays and a for loop and the outcome is this.
(note: this is a user input)
so here's my inputs
================
|| Name || Age || Income ||
================
|| chuck || 40 || 40,000 ||
|| norris || 65 || 32,000 ||
|| nemo || 14 || 37,200 ||
================
what should i do if i want it to sort like this?
================
|| Name || Age || Income ||
================
|| nemo || 14 || 37,200 ||
|| chuck || 40 || 40,000 ||
|| norris || 65 || 32,000 ||
================
i want to sort it by age from the youngest to the oldest
and still the name and income is still associated with the age.
can somebody help me ?
System.out.println("Enter number of process: ");
int process = in.nextInt();
String name[] = new String[process];
int age[] = new int[process];
double income[] = new double[process];
bla bla bla so basically i used three arrays and a for loop and the outcome is this.
(note: this is a user input)
so here's my inputs
================
|| Name || Age || Income ||
================
|| chuck || 40 || 40,000 ||
|| norris || 65 || 32,000 ||
|| nemo || 14 || 37,200 ||
================
what should i do if i want it to sort like this?
================
|| Name || Age || Income ||
================
|| nemo || 14 || 37,200 ||
|| chuck || 40 || 40,000 ||
|| norris || 65 || 32,000 ||
================
i want to sort it by age from the youngest to the oldest
and still the name and income is still associated with the age.
can somebody help me ?