ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 19 May 2017 My Price 9.00

program name "anagram.java"

java: write a class that finds anagrams (you can name the class anything). An anagram of a word is a permutation of the letters in that word; for example, “stop” is an anagram of “tops”.

Now write a driver program name "anagram.java" that invokes the above class to process the functions.

 The input to the program is a list of words read from an input file, the name of which will be supplied by the user (as shown in the example below) .

The output is a list containing the same words, but with anagrams displayed on the same line and should be displayed both on the screen as well as an output file name output.txt. This output file name must be built-in into the program.

The things contains on input file may like this :

Pans

Pots opt sit

opt

Sit

it's

snap

 

 

Here are some requirements for the program:

 

  1. When determining if two words are anagrams, the program must treat upper and lower case letters as equivalent (thus “Pans” and “snap” are anagrams) and ignore punctuation marks (“it’s” and “Sit” are anagrams). However, the program must display words with their original capitalization and punctuation – as shown above on the screen.
  2. The “word” is assumed to be any series of nonblank characters; words may be separated by any number of white-space characters. Any number of words may appear on a line, including none. You may assume that no word is more than 15 characters long. And maximum number of words in the file would be 50.
  3. The program must work even if the input file is empty. If this is the case print a message saying that “the input file is empty” and then terminate the program.
  4. The program must test the number of characters per word. If a word consists of more than 15 characters, the program should ignore that word and continue. That word would also be ignored in the total number of words of 50.
  5. The program must also test the number of words. If there are more than 50 words, print a message saying that there are more than 50 words in the input file and then terminate the program.Algorithm:
    Use efficient algorithms. The first insight is to create a “signature” for each word by sorting the letters in the word.

    Original Word     Signature
  6.        Pans                                       anps
  7.   It’sist

 

 

Answers

(11)
Status NEW Posted 19 May 2017 06:05 AM My Price 9.00

-----------

Attachments

file 1495174932-Solutions file 2.docx preview (51 words )
H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly -----------onl-----------ine----------- an-----------d g-----------ive----------- yo-----------u e-----------xac-----------t f-----------ile----------- an-----------d t-----------he -----------sam-----------e f-----------ile----------- is----------- al-----------so -----------sen-----------t t-----------o y-----------our----------- em-----------ail----------- th-----------at -----------is -----------reg-----------ist-----------ere-----------d o-----------n -----------THI-----------S W-----------EBS-----------ITE-----------. ----------- Th-----------ank----------- yo-----------u -----------
Not Rated(0)