Question: Using C++. Following the directions in the assignment. Program 2: Expand the guessing game from the first assignment. Expand the range to be 1 to
Using C++. Following the directions in the assignment. Program 2: Expand the guessing game from the first assignment. Expand the range to be 1 to 20 and allow the user to get a maximum of 5 attempts to guess it. The game ends when the user has guessed the correct number (a win) or the number of incorrect guesses has reached 5 (a loss). At the end of each game, users should be told whether they won or lost. To make the game more interesting, the program should vary the wording of the messages that it outputs for winning, for losing, and for asking for another game. Create at least 2 different messages for each of these cases, and use random numbers to choose among them. After printing out the win/loss messages, ask the user whether they want to play again and have them answer y' or 'n'. When the user quits with the 'n' answer, the program should output the total number of wins and losses. If they answer 'y',then a new random number should be generated and they will of course, have 5 attempts again to guess the number. Here's some pseudo code that describes the outerloop of game control. set answer to 'y while the answer is y' do the following steps
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
