Calculating the ranks of classmates' exam grades
in your checkRelativePrime method you have 

static boolean checkRelativePrime(int a, int b) {
    int i = 2;
    while (a &gt; 1) {
        if (a % i == 0) {
            {
                if (b % i == 0)
                    return false;
            }
            a = a / i;
        } else
            i++;
    }

    return true;
}



you have an extra set of brackets
you have a statement in purgatory.

a = a / i;


it sits in-between the ending bracket of your if statement and the else statement that is supposed to be attached to the if statement
if you use brackets for one part of an if statement, you should use them for the entire if statement. I recommend using brackets even for one-liners no matter what, it's cleaner and leaves less room for mistakes.




I think you wanted to keep that if statement separate from the declaration to the a variable, but you don't need to do that(especially if you are using brackets properly)

like this

while (a &gt; 1) {
    if (a % i == 0) {
        if (b % i == 0) {
            return false;
        }
        a = a / i;
    } else {
        i++;
    }
}


if you enter that if statement and return false then a = a /i; will never happen and your boolean method will return false