我有这个代码用于分配。当我编译它时,我得到
grades.java:18: error: 'else' without 'if'
else
^
1 error
这是代码:
public class grades
{
public static void main (String [] args)
{
int gradeone=75;
int gradetwo=80;
int testscore= ((gradeone + gradetwo)/2);
char grade;
System.out.println("\n" + "your test score is" + testscore);
if(testscore >= 90 )
grade='A';
elseif(testscore >= 80 );
grade='B';
elseif(testscore >= 70 );
grade='C';
elseif(testscore >= 65 );
grade='D';
else
grade='F';
}
}