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!). 4. Set the following variable in your program ``` std::string wordToGuess = "Programming"; // NOTICE the word doesn't get set to all uppercase at initialization ``` 5. Convert the `wordToGuess` to all uppercase and output 6. 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`    1) Prompt the user for the `letterToGuess`    2) Captitalize the `letterToGuess`, so that a case-insensitive search can be completed by the program    3) Indicate to the user whether or not the `letterToGuess` was *found* or *not found* in the `wordToGuess` (case insensitive search).    4) 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!.    5) The user **CANNOT** win the game yet or guess the word correctly yet. Current code C++   #include #include "myfuncts.h"   // ONLY include header file (.h files)   int main() { conststd::stringBOARD1 = " -------|\n | |\n |\n |\n |\n |\n -----\n"; conststd::stringBOARD2 = " -------|\n | |\n O |\n |\n |\n |\n -----\n "; conststd::stringBOARD3 = " -------|\n | |\n O |\n | |\n |\n |\n -----\n"; conststd::stringBOARD4 = " -------|\n | |\n O |\n -| |\n |\n |\n -----\n"; conststd::stringBOARD5 = " -------|\n | |\n O |\n -|- |\n |\n |\n -----\n"; conststd::stringBOARD6 = " -------|\n | |\n O |\n -|- |\n / |\n |\n -----\n"; conststd::stringBOARD7 = " -------|\n | |\n O |\n -|- |\n / \\ |\n |\n -----\n";   return 0; }   Screenshots attached are start and finish of expected output

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

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!).
4. Set the following variable in your program

```
std::string wordToGuess = "Programming";

// NOTICE the word doesn't get set to all uppercase at initialization
```
5. Convert the `wordToGuess` to all uppercase and output
6. 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`
   1) Prompt the user for the `letterToGuess`
   2) Captitalize the `letterToGuess`, so that a case-insensitive search can be completed by the program
   3) Indicate to the user whether or not the `letterToGuess` was *found* or *not found* in the `wordToGuess` (case insensitive search).
   4) 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!.
   5) The user **CANNOT** win the game yet or guess the word correctly yet.

Current code C++

 
#include <iostream>
#include "myfuncts.h"
 
// ONLY include header file (.h files)
 
int main() {
conststd::stringBOARD1 = " -------|\n | |\n |\n |\n |\n |\n -----\n";
conststd::stringBOARD2 = " -------|\n | |\n O |\n |\n |\n |\n -----\n ";
conststd::stringBOARD3 = " -------|\n | |\n O |\n | |\n |\n |\n -----\n";
conststd::stringBOARD4 = " -------|\n | |\n O |\n -| |\n |\n |\n -----\n";
conststd::stringBOARD5 = " -------|\n | |\n O |\n -|- |\n |\n |\n -----\n";
conststd::stringBOARD6 = " -------|\n | |\n O |\n -|- |\n / |\n |\n -----\n";
conststd::stringBOARD7 = " -------|\n | |\n O |\n -|- |\n / \\ |\n |\n -----\n";
 
return 0;
}
 
Screenshots attached are start and finish of expected output
43 Let's PLAY
44
45 Word to Guess: PROGRAMMING
46
47
48
49
50
51
52
53
54
55
56
57
Enter a letter to guess: w
You entered: W
W is NOT in the word to guess.
|
0
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73 Enter a letter to guess: w
Enter a letter to guess: G
You entered: G
G is in the word to guess.
|
0
74 You entered: W
75 W is NOT in the word to guess.
Transcribed Image Text:43 Let's PLAY 44 45 Word to Guess: PROGRAMMING 46 47 48 49 50 51 52 53 54 55 56 57 Enter a letter to guess: w You entered: W W is NOT in the word to guess. | 0 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 Enter a letter to guess: w Enter a letter to guess: G You entered: G G is in the word to guess. | 0 74 You entered: W 75 W is NOT in the word to guess.
109
110
111
112
113
114 You entered: T
115 T is NOT in the word to guess.
116
117
118
119 -|-
120 /
121
122
-|-
|
Enter a letter to guess: T
1
0
1
123 Enter a letter to guess: p
124 You entered: P
125
126
127
|
128 0
129 -|-
130
131
132
133 Enter a letter to guess: D
134 You entered: D
135 D is NOT in the word to guess.
136
137
1
138 0
139 -|-
140 1
141
142
143
144
P is in the word to guess.
Sorry you lose
the word was: PROGRAMMING
Transcribed Image Text:109 110 111 112 113 114 You entered: T 115 T is NOT in the word to guess. 116 117 118 119 -|- 120 / 121 122 -|- | Enter a letter to guess: T 1 0 1 123 Enter a letter to guess: p 124 You entered: P 125 126 127 | 128 0 129 -|- 130 131 132 133 Enter a letter to guess: D 134 You entered: D 135 D is NOT in the word to guess. 136 137 1 138 0 139 -|- 140 1 141 142 143 144 P is in the word to guess. Sorry you lose the word was: PROGRAMMING
Expert Solution
steps

Step by step

Solved in 4 steps with 5 images

Blurred answer
Knowledge Booster
Random Class and its operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education