spec6 - CSE 143, Winter 2010 Programming Assignment #6:...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
1 of 4 CSE 143, Winter 2010 Programming Assignment #6: Anagrams (20 points) Due Thursday, February 25, 2010, 11:30 PM This program focuses on recursive backtracking. Turn in a file named Anagrams.java from the Homework section of the course web site. You will need support files AnagramMain.java and various dictionary text files from the Homework section of the course web site; place them in the same folder as your class. Anagrams: An anagram is a word or phrase made by rearranging the letters of another word or phrase. For example, the words "midterm" and "trimmed" are anagrams. If you ignore spaces and capitalization and allow multiple words, a multi-word phrase can be an anagram of some other word or phrase. For example, the phrases "Clint Eastwood" and "old west action" are anagrams. In this assignment, you will create a class called Anagrams that uses a dictionary to find all anagram phrases that match a given word or phrase. You are provided with a client program AnagramMain that prompts the user for phrases and then passes those phrases to your Anagrams object. It asks your object to print all anagrams for those phrases. Below is a sample log of execution, wrapped into two columns (user input is underlined): Welcome to the CSE 143 anagram solver. Using dictionary file dict1.txt. Phrase to scramble (Enter to quit)? barbara bush All words found in "barbara bush": [abash, aura, bar, barb, brush, bus, hub, rub, shrub, sub] Max words to include (Enter for no max)? [abash, bar, rub] [abash, rub, bar] [bar, abash, rub] [bar, rub, abash] [rub, abash, bar] [rub, bar, abash] Phrase to scramble (Enter to quit)? john kerry All words found in "john kerry": [he, her] Max words to include (Enter for no max)? Phrase to scramble (Enter to quit)? hairbrush All words found in "hairbrush": [bar, briar, brush, bus, hub, huh, hush, rub, shrub, sir, sub] Max words to include (Enter for no max)? 2 [briar, hush] [hush, briar] Phrase to scramble (Enter to quit)? george bush All words found in "george bush": [bee, beg, bog, bogus, bough, brush, bug, bugs, bus, egg, ego, erg, go, goes, gorge, gosh, grub, gush, he, her, here, hog, hose, hub, hug, rub, she, shrub, shrug, sub, surge] Max words to include (Enter for no max)? 0 [bee, go, shrug] (continued on right) [bee, shrug, go] [bog, he, surge] [bog, surge, he] [bogus, erg, he] [bogus, he, erg] [bug, erg, hose] [bug, goes, her] [bug, her, goes] [bug, hose, erg] [bugs, ego, her] [bugs, go, here] [bugs, her, ego] [bugs, here, go] [bus, erg, go, he] [bus, erg, he, go] [bus, go, erg, he] [bus, go, he, erg] [bus, gorge, he] [bus, he, erg, go] [bus, he, go, erg] [bus, he, gorge] [egg, hose, rub] [egg, rub, hose] [ego, bugs, her] [ego, grub, she] [ego, her, bugs] [ego, she, grub] [erg, bogus, he] [erg, bug, hose] [erg, bus, go, he] [erg, bus, he, go] [erg, go, bus, he] [erg, go, he, bus] [erg, go, he, sub] [erg, go, sub, he] [erg, goes, hub] [erg, he, bogus] [erg, he, bus, go] [erg, he, go, bus] [erg, he, go, sub] [erg, he, sub, go] [erg, hose, bug] [erg, hub, goes] ... (full output is on web site)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/04/2011 for the course CSE 143 taught by Professor Sr during the Spring '08 term at University of Washington.

Page1 / 4

spec6 - CSE 143, Winter 2010 Programming Assignment #6:...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online