Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

image text in transcribed

But my output is

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Decisions Based On Data Analytics For Business Excellence

Authors: Bastian Weber

1st Edition

9358681683, 978-9358681680

More Books

Students also viewed these Databases questions