andewors
Oct 15, 2012, 05:59 AM
I made this code to loop number
for(int i=0;i<4;i++){
double temp[i]=Math.random() * i*10;
system.out.println("Result" +i+ "=>" +temp);
}
output :
Result 1 => 14.3
Result 2 => 11.4
Result 3 => 10.8
Result 4 => 12.4
now, how to shorting this output based on value with keep original index, so the output like this :
Result 3 => 10.8 => Grade 1
Result 2 => 11.4 => Grade 2
Result 4 => 12.4 => Grade 3
Result 1 => 14.3 => Grade 4
how to do this?? I need your help
for(int i=0;i<4;i++){
double temp[i]=Math.random() * i*10;
system.out.println("Result" +i+ "=>" +temp);
}
output :
Result 1 => 14.3
Result 2 => 11.4
Result 3 => 10.8
Result 4 => 12.4
now, how to shorting this output based on value with keep original index, so the output like this :
Result 3 => 10.8 => Grade 1
Result 2 => 11.4 => Grade 2
Result 4 => 12.4 => Grade 3
Result 1 => 14.3 => Grade 4
how to do this?? I need your help