The result of this below only print out
John 90
Shawn 100
Melalin 75
Jane 80
What i want is
Melalin 75
Jane 80
John 90
Shawn 100
I tried all methods but still can't think of how to make it arrange from the lowest score to the highest. Can anyone help me? I am new to java. Thanks.
class students
{
public static void main(String args[])
{
String studentName[] = { "John ", "Shawn ", "Melalin ", "Jane " };
double studentScore[] = { 90, 100, 75, 80 };
int i;
for(i=0; i<4; i++)
{
System.out.println(studentName [i] + studentScore [i]);
}
}
}
Thanks.