I am a student in a beginning java class, I got some help earlier today on my assignment, which really helped! So I thought I would give it one more try, before I throw in the towel on this last part. I have been able to get everything going, but my sort just doesn't work. I have to use this format, as my professor does not want us to use sort APIs. It processes correctly, meaning I get the same results by hand as when I run it, so I think the problem is in the logic itself. Can anyone see what I am doing wrong and offer any hints or helps. Thanks in advance. Here is my code for my sort loop:
int i, j; // used to index into the array
double temp;
for (i = 1; i < count ; ++i) {
temp = students[i].getGPA();
j = i - 1;
while (j >= 0 && temp < students[j].getGPA())
{
students[j + 1] = students[j];
j = j - 1;
}
students[j + 1]= students[i];
}