Reading: Read everything through Ch7 in the Objects
First
text. Work along
with it, using BlueJ.
Study: Midterm, in class
tuesday, March 31, covers everything from all semester. Part 1 will be
written on
paper. Part 2 will be practical with you writing Java code in BlueJ. Review all readings and homeworks.
There is no HW to hand in this week
Lab Wednesday, March 25,
2009: Computer
Science: Cement Occupiers
1) Design a getTwoWords(string input) method to include in your
Anagram
class. It should run with the same database as lbefore, but it
allows one
to quickly generate a pair of words, both from the dictionary, which
when
combined are an anagram of the input. For example its output for the
input "computerscience" includes "cement occupiers", "ecumenic
copters", and "uric competences". Design the form of the return value
so as to minimize
repetition. (Hint: do not precompute a Map keyed on the
letters in every possible pair of words.)
2) Implement your method. Make a way, using a Scanner, to easily try it
on typed inputs. (You might want the input method to remove spaces,
hyphens, and other punctuation, so you can easily type or paste in any
phrase.) You should find sixteen distinct two-word anagrams of
"computerscience".
3) Find some two-word anagrams for your name, first
and
last together, possibly with a middle name or initial, or whatever it
takes to get an interesting answer.
4) Play with your program and find an interesting, original,
never-before-known, two-word anagram of some word or phrase.
5) You do not have to hand anything in for this.