Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using C++ Language First you need to ask the user to enter a letter. Then you'll check if that letter exists in your secret word.
Using C++ Language
First you need to ask the user to enter a letter. Then you'll check if that letter exists in your secret word. If it does exist, then you should tell the user and display the puzzle with the letter revealed. If the letter does not exist, then inform the user that the letter is not found. You will repeat this process until all the correct letters have been guessed or the user has entered 7 wrong letters Hopefully it is readily clear that you will need to use a loop to keep prompting the user to enter a letter. You will also need to use conditionals to check if the letter exists. You will need to use an array to store the secret letters (since a word is just a collection of letters). We'll also need arrays to keep track of the previously guessed letters (we don't want the player to guess wrong a second time) and the solved letters An example of a winning game Welcome to Hangman!! Take a guess: Your guess: a There's a A! Take a guess: Your guess: C Sorry, no c's. You have 6 wrong guesses remaining. Take a guess: Your guess: a You already guessed A. Take a quess: PRO RA M M I N Your guess: g There's a G! CONGRATS! You solved the puzzle: PROGRAMMI N G
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started