Question: We want to re-do the program given for Activity zyDE 7.3.2 (String searching example: Hangman). The problem specification is the same as described in the

 We want to re-do the program given for Activity zyDE 7.3.2
(String searching example: Hangman). The problem specification is the same as described

We want to re-do the program given for Activity zyDE 7.3.2 (String searching example: Hangman). The problem specification is the same as described in the activity. Our goal is to rewrite the program in a different style. We combine all characters guessed so far as a string. Consider word- onomatopoeia' as in the given example. After we have entered the guesses y', m,'n' and a, we maintain the four guessed letters as a string called guesses ymna. The hidden word is computed to be -n-ma- Write a function hidden word vord, guesses) which returns the hidden word given word and guesses. You are supposed to use a different logic than the one given in the sample program. You should initialize hidden word to an empty string. Then for each character in word, decide (by checking with guesses) to see if the character should be hidden, or displayed. Using the function hidden.word, you are asked to rewrite the program. You are also asked to improve the dialog between the program and the user. When the length of user input is not 1, you should print a meaningful message before asking the user to enter another character. When the user enters a character that he/she has guessed before, you should not count this as a valid guess, and offer the user another chance to guess again

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!