Your problem is here:


maxGrade = scan.nextInt ();
minGrade = scan.nextInt ();
The counter is not increased for the first two lines you read. I would set the maxGrade to 0, and minGrade to...