The code in the editor uses the Sc anner class incantations to ask the user for th first letter of their zodiac sign and store the ch
The code in the editor uses the Sc anner class incantations to ask the user for th first letter of their zodiac sign and store the ch ar value they enter in a variable called s ign. For example, if the user is a Pisces, s ign will be the char ‘ p ‘ . Complete the code using the char variable s i gn to output the following messages: Enter the first letter of your zodiac sign: t Compiled and executed Exception in thread “main” java.lang.StringIndexOutOfBoundsExcepti at java.base/java.lang.StringLatin1.charAt(StringLatin1.java:4 at java.base/java.lang.String.charAt(String. java:1512) at ZodiacSign.main(ZodiacSign.java:7) liacSign \{ c void main(String[] args) \{ input = new Scanner(System.in); ut.print(“Enter the first letter of your zodiac sign: “); ;n = input.nextLine().charAt(0); sign) \{ ‘a’: System. out.println(“You could be an Aries or Aquarius.”); break; ‘t’: System.out.println(“You are a Taurus.”); break; ‘l’: System.out.println(“You could be a Leo or Libra.”); break; Iult: System.out.println(“Sorry, your sign did not make the cut!”) ose(); liacSign \{ c void main(String[] args) \{ input = new Scanner(System.in); ut.print(“Enter the first letter of your zodiac sign: “); ;n = input.nextLine (). charAt (0); sign) \{ ‘a’: System.out.println(“You could be an Aries or Aquarius.”); break; ‘t’: System.out.println(“You are a Taurus.”); break; ‘ 1 ‘: System.out.println(“You could be a Leo or Libra.”); break; iult: System.out.println(“Sorry, your sign did not make the cut!”) ose ( );
OR