The following is an old word puzzle: “Name a common word, besides tremendous, stupendous and horrendous, that ends in dous.” If you think about this for a while it will probably come to you. However, we can also solve this puzzle by reading a text file of English words and outputting the word if it contains “dous” at the end. The text file “words.txt” contains 87314 English words, including the word that completes the puzzle. This file is available online with the source code for the book. Write a program that reads each word from the text file and outputs only those containing “dous” at the end to solve the puzzle.
Fairly short text-file program. The dictionary of words can be used for many other puzzle-based programs involving words.
See the code in WordPuzzle.java.
You might also like to view...
Which of the following statements is true?
a. Predicate methods typically test a condition and modify the object on which they're called. b. Predicate methods typically do not test a condition and do not modify the object on which they're called. c. Predicate methods typically test a condition and do not modify the object on which they're called. d. Predicate methods typically do not test a condition and modify the object on which they're called.
A subclass can directly access __________.
a. only protected and private members of the superclass b. all members of the superclass c. only public and private members of the superclass d. only public and protected members of the superclass
What are the default object styles for any document?
What will be an ideal response?
What are the steps to take in order to create a high-quality Web version of an image?
What will be an ideal response?