414,656 views
11 votes
11 votes
What is wrong with the following code? publicstatic char grade(int score) { if (score >= 9) { return 'A'; } else if (score >= 8) { return 'B'; } else if (score >= 6) { return 'C'; } else if (score > 4) { return 'D'; } else if (score < 4) { return 'F'; } }

User Sheldon Chang
by
3.0k points

1 Answer

24 votes
24 votes

Answer:

c) No return statement for all possible logic paths

User Decio Lira
by
2.8k points