Question: my code has a semantic error I expect to receive this output: But my output is My java code is: import java.util.Scanner; public class Anagram{
my code has a semantic error I expect to receive this output:

But my output is
My java code is:
import java.util.Scanner; public class Anagram{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); System.out.print("Enter first phrase"); String phrase_1 = scan.nextLine(); Scanner scan2 = new Scanner(System.in); System.out.println("Enter second phrase"); String phrase_2 = scan.nextLine(); phrase_2 = phrase_2.toLowerCase(); String new_phrase_1 = ""; String new_phrase_2 = ""; for(char chr = 'a';chr
Typical expected output: Enter first phrase replays Enter second phrase parsley aelprsy are the letters of replays in order aelprsy are the letters of parsley in order replays is an anagram of parsley Enter furst phrase replays Enter second phrase parsley aelprsy are the letters of replays in order aelprsy are the letters of parsley in order
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
