can u tell me what is wrong with this cod
public void inputGrads()
{
Scanner in = new Scanner (System.in);
System.out.printf("%s\n%s\n,",
"enter the integer grade between 0 till 100",
"for ending the file press -1 and then enter");
total = 0;
gradcounter = 0;
grad = in.nextInt();
if (grad == -1)
System.out.println("there is no number");
else
{
while (grad != -1)
{
total += grad ;
gradcounter++;
System.out.println("enter ur nybmer");
grad = in.nextInt();
incrementLetterGradeCounter(grad );
}
}
//if (gradcounter == 0 )
// System.out.println("there was no number");
}
public void incrementLetterGradeCounter( int grad )
{
switch ( grad / 10)
{
case 9:
case 10:
++ acount;
break;
case 8:
++ bcount;
break;
case 7:
++ ccount;
break;
case 6:
++ dcount;
break;
default:
++ fcount;
break;
}
} //end of method
public void gradReport()
{
System.out.println(" the grads r:");
if( gradcounter != 0)
{
double average = (double) total/gradcounter;
System.out.printf(" total of the %d grade is %d\n ",
gradcounter,total);
System.out.printf(" the average of class is
%.2f\n",average);
System.out.printf("%s\n%s%d\n%s%d\n%s%d\n%s%d\n%s%d\n",
"number of student who received each grade",
"A:",acount,
"B:",bcount,
"C:",ccount,
"D:",dcount,
"F:",fcount);
}
else
System.out.print("there was no grad");
thanks
razieh