A Frontend module

Report a typo

Your team is creating a Java module that returns an ArrayList with an enum set (or sets) to apply the styles on the respective document type. The next part of the module has to be completed by you.

Consider the following info:

Main-Heading means the main heading of the document and Quote|Bold signifies a quotation that is bold. Similarly the switch cases represents various other segments of a document.

In various segments, different fonts are used:

  • BOLD, LARGE and NORMAL for main-heading;

  • SMALL and ITALIC for quotation;

  • SMALL and NORMAL for paragraph;

  • MEDIUM and NORMAL for sub-heading;

  • BOLD, SMALL and ITALIC for bold quotation.

Sample Input 1:

Main-Heading

Sample Output 1:

[BOLD, LARGE, NORMAL]
Write a program in Java 17
// Include import statements
public class Main {

enum Fonts {
BOLD, LARGE, MEDIUM, SMALL, ITALIC, NORMAL
}

EnumSet<Fonts> enumSet;

public static void main(String[] args) {

Main object = new Main();

Scanner sc = new Scanner(System.in);
String string = sc.nextLine().trim();

// Change Code below this line
switch (string) {
case "Main-Heading":
break;
case "Quote":
break;
case "Paragraph":
break;
case "Sub-Heading":
break;
case "Quote|BOLD":
break;
default : System.out.println("ERROR");
break;
}
// Change the code above this line
System.out.println(object.enumSet);
}
}
___

Create a free account to access the full topic