This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Lab 4: Anagrams (CSE 15L, October 19, 2011) Definition: An anagram of a word is a new word or phrase that contains all the letters of the original word, using each original letter exactly once. New spaces and punctuation are allowed in the anagram. This lab uses two Java files. The main method is in TestAnagram.java . This calls LetterCount.java to generate a list of anagrams from a vocabulary list (given by the user) and a given root word. In addition to the root word, the user must input an inquiry phrase. The inquiry phrase is checked to see whether it is in the list or not. Program Specification: The program takes three arguments, which are the input file, root word, and inquiry phrase . The program generates internally a list of phrases that are combinations of vocabulary words connected by single spaces. Each phrase is an anagram of the root word ignoring whitespace and non-letter characters. For example, “dirty room!” is an anagram of “dormitory” because “dirty” and “room!” are in the vocabulary fileand “room!...
View Full Document
- Fall '08
- root word, TestAnagram.java, java TestAnagram vocabulary.txt