The score is increasing until 40 using the increaseScore() method.
If a boolean flag is true, the score will be reduced by 10 (so, in this case, it will be 30), and display score = 30 and grade = D in toString().
But I only can get score = 40 and grade = D in toString().
Is it possible to add return score; after score = score - 10; in findGrade()?
public int increaseScore(){
score = score + 10;
return score;
}
public char findGrade(){
if (flag)
score = score - 10;
char grade = 'A';
if (80<=score)
grade = 'A';
else if (60<=score && score <= 79)
grade = 'B';
else if (40<=score && score <= 69)
grade = 'C';
else
grade ='D';
return grade;
}
public String toString(){
return teamName + " " + score + " " + findGrade();
}