Guys/Gals PLEASE give feedback about my solution

#include
#include

using namespace std;

void PrintIntro();
void PlayGame();
string GetGuess();

//the entry point for our application
int main()
{
PrintIntro();
PlayGame();
return 0;
}
// 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 letter " << WORD_LENGTH;
cout << " isogram I’m thinking of?\n”;
cout << endl;
return;
}
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++)
{
cout << "Your guess was: " << GetGuess() << endl;
cout << endl;
}
}
// get a guess from the player
string GetGuess()
{
string Guess = “”;
cout << "Enter your guess: ";
getline(cin, Guess);
return Guess;
}

Not sure what happened to your #includes, but nice code

Privacy & Terms