Activity 1.9.1.
There is a copy of the following code block in interactive mode that you can compile. Your task is to improve the code’s style as an expert would view it, while ensuring its behavior remains unchanged. You may run your refactored code to verify that it still passes all test cases.
public class Internship {
public static String checkInternshipEligibility(int schoolYear, double GPA, boolean hasWorkExperience) {
if (schoolYear >= 4) {
if (GPA >= 3.5) {
if (hasWorkExperience) {
return "Eligible";
} else {
return "You only need some work experience!";
}
}
}
return "Not eligible";
}
}