I want to calculate grade of students but a red line is shown in the last line below the word 'grade'.Please help.
This is my coding:-
int eng=Integer.parseInt(jTextField1.getText());
int eco=Integer.parseInt(jTextField2.getText());
int acc=Integer.parseInt(jTextField3.getText());
int bus=Integer.parseInt(jTextField4.getText());
int ip=Integer.parseInt(jTextField5.getText());
int pe=Integer.parseInt(jTextField6.getText());
int tot=eng+eco+acc+bus+ip+pe;
float avg=tot/6;
jTextField7.setText(""+tot);
jTextField8.setText(""+avg);
char grade;
if(avg>90)
{
grade='A';
}
else
if(avg>75&&avg<=90)
{
grade='B';
}
else
if(avg>60&&avg<=75)
{
grade='C';
}
else
if(avg>50&&avg<=60)
{
grade='D';
}
else
if(avg>40&&avg<=50)
{
grade='E';
}
else
if(avg>30&&avg<=40)
{
grade='F';
}
jTextField9.setText(""+grade);