Basic job requirements

Report a typo

Consider the following enum class:

enum Language {
    JAVA, C_PLUS_PLUS, PYTHON, C_SHARP, JAVA_SCRIPT, HTML, CSS
}
enum Role {
    WEB_DEVELOPER, DATA_SCIENTIST, JAVA_EXPERT, GAME_DEVELOPER, COMPETITIVE_CODER
}

You are working at a company that works with the given jobs, as well as the languages specified by the above enums. Based on the job, the getRequirementsByRole method must return the EnumSet<Language> of basic language requirements based on these rules:

  • Web developer: HTML, CSS, JavaScript

  • Data scientist: Python

  • Java expert: Java

  • Game developer: C#

  • Competitive coder: C++

Sample Input 1:

WEB_DEVELOPER

Sample Output 1:

Job Code : WEB_DEVELOPER
Prerequisite : [JAVA_SCRIPT, HTML, CSS]
Write a program in Java 17
import java.util.EnumSet;
import java.util.Scanner;

public class Main {

enum Language {
JAVA, C_PLUS_PLUS, PYTHON, C_SHARP, JAVA_SCRIPT, HTML, CSS
}

enum Role {
WEB_DEVELOPER, DATA_SCIENTIST, JAVA_EXPERT, GAME_DEVELOPER,
COMPETITIVE_CODER
}

// Do not change the method
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String roleName = scanner.next();
try {
Role role = Role.valueOf(roleName);
EnumSet<Language> languages = getRequirementsByRole(role);
System.out.println("Job Code : " + role);
System.out.println("Prerequisite : " + languages);
} catch (IllegalArgumentException e) {
System.out.println("Thank you for considering us but there is no vacancy.");
}
}

// Implement the method
public static EnumSet<Language> getRequirementsByRole(Role role) {

}
}
___

Create a free account to access the full topic