Given the following method, what do we need to fix?
Public static String getPerformance(char grade)
{
Switch (grade)
{
Case 'A': return "Excellent"; break;
Case 'B': return "Good"; break;
Case 'C': return "Mediocre"; break;
Case 'D': return "Weak"; break;
Case 'F': return "Bad"; break;
}
}
A) Remove all the break statements
B) Add a local boolean variable definition
C) Remove all the break statements and add a return statement before the end of method
D) Remove the switch statement and use and if statement
Correct Answer:
Verified
Q59: You need to write a method that
Q60: Which of the following code snippets can
Q61: Assuming that a user enters 45 as
Q62: For a program that reads city names
Q63: What is a good rule for deciding
Q65: Which of the following code snippets can
Q66: What is the purpose of writing a
Q67: Given the following method, what is the
Q68: Assuming that a user enters 22 as
Q69: What does the following code do?
Public static
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents