1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
monitta
2 years ago
7

An anagram is a word or a phrase made by transposing the letters of another word or phrase; for example, "parliament" is an anag

ram of "partial men," and "software" is an anagram of "swear oft." Write a program that figures out whether one string is an anagram of another string. The program should ignore white space and punctuation.
Computers and Technology
1 answer:
Sliva [168]2 years ago
4 0

Answer:

Anagram

Explanation:

public class Anagram {

   public static boolean areAnagrams(String string1,

                                     String string2) {

       String workingCopy1 = removeJunk(string1);

       String workingCopy2 = removeJunk(string2);

    workingCopy1 = workingCopy1.toLowerCase();

    workingCopy2 = workingCopy2.toLowerCase();

    workingCopy1 = sort(workingCopy1);

    workingCopy2 = sort(workingCopy2);

       return workingCopy1.equals(workingCopy2);

   }

   protected static String removeJunk(String string) {

       int i, len = string.length();

       StringBuilder dest = new StringBuilder(len);

   char c;

    for (i = (len - 1); i >= 0; i--) {

        c = string.charAt(i);

        if (Character.isLetter(c)) {

         dest.append(c);

        }

    }

       return dest.toString();

   }

   protected static String sort(String string) {

    char[] charArray = string.toCharArray();

    java.util.Arrays.sort(charArray);

       return new String(charArray);

   }

   public static void main(String[] args) {

       String string1 = "Cosmo and Laine:";

       String string2 = "Maid, clean soon!";

       System.out.println();

       System.out.println("Testing whether the following "

                        + "strings are anagrams:");

       System.out.println("    String 1: " + string1);

       System.out.println("    String 2: " + string2);

       System.out.println();

       if (areAnagrams(string1, string2)) {

           System.out.println("They ARE anagrams!");

       } else {

           System.out.println("They are NOT anagrams!");

       }

       System.out.println();

   }

}

You might be interested in
__ means having a current knowledge and understanding of computers, mobile devices, the web, and related technologies.
Brrunno [24]

Answer:

Digital literacy

Explanation:

Digital Literacy means having a current knowledge and understanding of computers, mobile devices, the web, and related technologies.

Brainliest plz

8 0
3 years ago
Binary divide 1101011 by 111​
denis-greek [22]

is this computer subject

5 0
3 years ago
Read 2 more answers
During which part of an examination are various body parts and organs touched and felt?
scoray [572]

The correct answer is B. Palpation

Explanation:

In a medical exam or similar, the palpation involves touching different parts of the body to feel the organs and structures in this. This process is essential in diagnosis because palpation can reveal inflammation, pain in certain areas, or abnormalities. Additionally, palpation requires a broad knowledge of anatomy that allows health professionals to understand the structures of the body when they touch these and how to determine abnormalities. Thus, the part of an examination in which body parts are touched and felt is palpation.

8 0
3 years ago
What command can be used to export an nps backup file named npsconfig.xml that can be used to restore nps configuration on anoth
irakobra [83]

The command is Export-NpsConfiguration    

An admin can export the entire NPS configuration from one NPS for import to another NPS. Standard precautions should be taken when exporting NPS configurations over the network. The command syntax that can be used for exporting the NPS configurations is Export-NpsConfiguration –Path <filename>


3 0
3 years ago
It is easier to make an object move across the screen by using the tweening function rather than creating each individual frame
Vesna [10]
Uhhhh I believe it’s true if it’s wrong I’m srry ....
3 0
3 years ago
Other questions:
  • Steps needed to deposit cash on cash deposit machine
    6·1 answer
  • Which of the following explains the growing need for a standard IT professional licensing program? Check all of the boxes that a
    11·1 answer
  • Which of the following is an accurate statement? When the LOWER function is used in a SELECT clause, it will automatically store
    6·1 answer
  • You have just starting working at Quantum Company. As a new programmer, you have been asked to review and correct various pseudo
    14·1 answer
  • What is Quantum Cryptography? How is it different from Public and Private-key transactions?
    6·1 answer
  • A solid understanding of __________ is the foundation of verbal communication
    7·1 answer
  • You are given the task of reading in n numbers and then printing them out in sorted order. Suppose you have access to a balanced
    12·1 answer
  • A trust domain is defined as Select one: a. The agreed upon, trusted third party b. A scenario where one user needs to validate
    5·2 answers
  • What do Business Analysis workers do? Check all that apply.
    15·2 answers
  • Write a program that asks the user for a word. Next, open up the movie reviews.txt file and examine every review one at a time.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!