import java.io.PrintStream; import java.util.Scanner; import type.lib.ToolBox; public class RedOrBlueOrYellow { public static void main(String[] args) { Scanner input = new Scanner(System.in); PrintStream output = System.out; output.println("0 : red"); output.println("1 : blue"); output.println("2 : yellow"); output.print("Enter your choice: "); int choice = input.nextInt(); String result; if (choice == 0) { result = "red"; } else if (choice == 1) { result = "blue"; } else if (choice == 2) { result = "yellow"; } else { ToolBox.crash(true, "invalid choice"); result = "invalid"; // needed to make compiler happy } output.println(result); } }