[code]#include
#include
using namespace std;
void PrintIntro();
void PlayGame();
string GetGuess();
string PrintBack();
string Guess = “”;
int main()
{
PrintIntro();
PlayGame();
return 0; // exit the application
}
void PlayGame()
{
// loop for the number of turns, asking for guesses
constexpr int NUMBER_OF_TURNS = 5;
for (int count = 1; count <= NUMBER_OF_TURNS; count++)
{
GetGuess();
PrintBack();
cout << endl;
}
}
// introduce the game
void PrintIntro()
{
constexpr int WORD_LENGTH = 9;
cout << “Welcome to Bulls and Cows, a fun word game!\n”;
cout << “Can you guess the " << WORD_LENGTH;
cout << " letter isogram I’m thinking of?\n”;
cout << endl;
return;
}
// get a guess from the player
string GetGuess()
{
cout << "What is your guess: "; getline(cin, Guess);
return Guess;
}
// print the guess back to them
string PrintBack()
{
cout << "You wrote: " << Guess << endl;
return Guess;
}[/code]