Question: I need help getting this new input for hangman in C++. Implement the following updates and test the hangman program as specified for ONE SINGLE
I need help getting this new input for hangman in C++.
Implement the following updates and test the hangman program as specified for ONE SINGLE game play where the game ends when the player loses the game (Note: game cannot be won yet!).
Set the following variable in your program
std::string wordToGuess = "Programming";
// NOTICE the word doesn't get set to all uppercase at initialization
Convert the wordToGuess to all uppercase and output
A game play is played where the program will continue to prompt the player for a letterToGuess and check if the letterToGuess is found or not found in wordToGuess. Each time the result is not found, the wrongGuesses is incremented. Repeat this process until the player loses when wrongGuesses == 6
Prompt the user for the letterToGuess
Captitalize the letterToGuess, so that a case-insensitive search can be completed by the program
Indicate to the user whether or not the letterToGuess was found or not found in the wordToGuess (case insensitive search).
ALWAYS Output the hangman board that corresponds to the number of wrongGuesses after each guess NOT just for the incorrect guesses, but for ALL guesses: correct or incorrect!.
The user CANNOT win the game yet or guess the word correctly yet.
Expected Output Topic 3 Phase
Let's PLAY
|
-----
Enter a letter to guess: w
You entered: W
W is NOT in the word to guess.
-------|
| |
O |
-| |
|
|
-----
Enter a letter to guess: r
You entered: R
R is in the word to guess.
-------|
| |
O |
-| |
|
|
-----
Enter a letter to guess: z
You entered: Z
Z is NOT in the word to guess.
-------|
| |
O |
-|- |
|
|
-----
Enter a letter to guess: T
You entered: T
T is NOT in the word to guess.
-------|
| |
O |
-|- |
/ |
|
-----
Enter a letter to guess: p
You entered: P
P is in the word to guess.
-------|
| |
O |
-|- |
/ |
|
-----
Enter a letter to guess: D
You entered: D
D is NOT in the word to guess.
-------|
| |
O |
-|- |
/ \ |
|
-----
Sorry you lose - the word was: PROGRAMMING
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
