Solved

Given the Following Method, What Do We Need to Fix

Question 64

Multiple Choice

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:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents