Prog 2 Precaution

Prof. Reed, CS 102, Fall 2011

Program is due at 11:59pm on the date indicated on the course schedule page.

In learning something new it is good to take every precaution.  Write a word-guessing game where words must be formed using the letters from the word "precaution," where each letter is used at most once.  Running your program should look like the following:

Author: Dale Reed Program: #1, Precaution TA: Richard Francis Burton, Wed 8am    Play the game of Precaution.  Try and create as many unique words as you can using only the letters  in the word 'precaution' where each letter is used at most once.  Words must be at least 3 characters long. An added wrinkle is that The last letter of each word guessed must be the first letter of the next word guessed.  Type in the word 'exit' to exit the program.  Guess a word using the letters in "precaution": trip 1 words found: trip  Guess a word using the letters in "precaution": print 2 words found: trip       print  Guess a word using the letters in "precaution": to Sorry, words must be longer than 3 characters.  Guess a word using the letters in "precaution": trecapn Sorry, that is not a valid dictionary word.  Guess a word using the letters in "precaution": tear 3 words found: trip       print      tear  Guess a word using the letters in "precaution": trap Sorry, the current word must start with 'r'  Guess a word using the letters in "precaution": root Sorry, you used an invalid letter.  Guess a word using the letters in "precaution": real Sorry, you used an invalid letter.  Guess a word using the letters in "precaution": exit  Thanks for playing. 3 words found: trip       print      tear  Goodbye. 

You need to know the following concepts in order to write this program:

Hints:

Looking for up to 5 points of extra credit?  Do the extra work described below.  Be sure that you have turned in a completed working version of the basic requirements before you try this extra credit. 

       Instead of simply using the word 'Precaution', choose randomly from among a set of possible words to use. (See this code for a sample of a random number generator.) Implement a timer (see ElapsedTime.java), giving users a maximum of 4 minutes.  Once time is up, display all the possible words that could have been formed.