Question: This is in C++: For this assignment, you will write a program to play the game Mastermind. Please see https://en.wikipedia.orfi/wiki/Mastermnd (board game) for details of
This is in C++:

For this assignment, you will write a program to play the game Mastermind. Please see https://en.wikipedia.orfi/wiki/Mastermnd (board game) for details of how to play the game. Specifications: 1. Your program should print out instructions for the game. 2. A game consists of trying to guess a secret randomly generated, 4-digit code where each digit is a number from 1 to 6. A player will have 12 guesses to guess the correct 4-digit code. 4. After each guess, your program must inform the player how many digits were guessed correctly in the correct location and how many digits were guessed correctly but in the wrong location. If the player guesses correctly, then your program should congratulate the player on successfully guessing the correct answer. 5. Your program must check that the user enters a valid guess, i.e., that it is exactly 4 digits and that each digit is a number from 1 to 6. 6. After finishing a game, your program should ask the user if they want to play again or quit the program. The program should play another game unless the user chose to quit the program. 7. Your program must include and properly use a function to check if the guess entered by the user is valid or not. The function should return true or false. 8. Your program must include and properly use a function to count the number of digits of the guess that are correct and in the correct position. This function must take as input the guess and the secret code to be guessed. The function should return the number of digits that are correct and in the correct location. 9. Your program must include and properly use a function to count the number of digits of the guess that are correct and in the incorrect position. This function must take as input the guess and the secret code to be guessed. The function should return the number of digits that are correct and in the incorrect location. 10. Your program should print out the secret answer at the beginning of each round for grading/debugging purposes
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
