Simplifying member functions in Blackjack game For my display functions in my Blackjack game, I want to control each player's stats output based on whether a turn is in progress or has ended.  Normally, you could only see one card that your opponent(s) hold, while the rest are only revealed at the end of each turn.  My code does that well, but I'm having trouble making it more concise.
The display function in Game is called to display each player's stats (name, chips, and hand).  It takes a Boolean argument to determine if it should display each CPU's partial stats (during each turn) or full stats (after each turn).  At the function call in Game, the bool argument is passed to the respective display function in Player, where the human player and CPU player have individual display procedures.  The display functions in Player primarily display the chip amounts and card rank totals.  They also call respective Hand display functions which, again, solely depend on the Boolean argument for displaying the CPUs' stats.
How could I simplify this code to achieve the same output (shown below the code)?
Game.cpp
displayStats(false); // function call elsewhere in Game

void Game::displayStats(bool showCPUResults) const
{
    players[0].displayPlayerStats(); // displays player stats

    for (int i = 1; i &lt; numPlrs; i++)
        players[i].displayCPUStats(showCPUResults); // displays CPU stats
}

Player.cpp
void Player::displayPlayerStats() const
{
    // always shown
    std::stringstream ss;
    std::cout &lt;&lt; &quot;\n* &quot; &lt;&lt; name &lt;&lt; &quot;: &quot;;
    std::cout &lt;&lt; &quot;($&quot; &lt;&lt; chips &lt;&lt; &quot;) &quot;;

    // displays two-digit card rank total (always shown)
    if (totalCardsValue &lt;= 9)
        ss &lt;&lt; &quot;(0&quot; &lt;&lt; totalCardsValue &lt;&lt; &quot;)  &quot;;
    else
        ss &lt;&lt; &quot;(&quot; &lt;&lt; totalCardsValue &lt;&lt; &quot;)  &quot;;

    std::cout &lt;&lt; ss.str();

    // displays human player's hand
    playerHand[0].displayPlayerHand();
}

void Player::displayCPUStats(bool showResults) const
{
    // always shown
    std::stringstream ss;
    std::cout &lt;&lt; &quot;\n* &quot; &lt;&lt; name &lt;&lt; &quot;: &quot;;
    std::cout &lt;&lt; &quot;($&quot; &lt;&lt; chips &lt;&lt; &quot;) &quot;;

    if (!showResults)
    {
        std::cout &lt;&lt; &quot;      &quot;;
        playerHand[0].displayCPUHand(showResults);
    }
    else
    {
            // only shown after each turn
        if (totalCardsValue &lt;= 9)
            ss &lt;&lt; &quot;(0&quot; &lt;&lt; totalCardsValue &lt;&lt; &quot;)  &quot;;
        else
            ss &lt;&lt; &quot;(&quot; &lt;&lt; totalCardsValue &lt;&lt; &quot;)  &quot;;

        std::cout &lt;&lt; ss.str();
            
            // displays CPU's hand
        playerHand[0].displayCPUHand(showResults);
    }
}

Hand.cpp
void Hand::displayPlayerHand() const
{
    // displays player's full hand (always)
    for (unsigned i = 0; i &lt; cards.size(); i++)
        std::cout &lt;&lt; cards[i] &lt;&lt; &quot; &quot;;
}

void Hand::displayCPUHand(bool showCPUHand) const
{
    // displays CPU's first card (always)
    std::cout &lt;&lt; cards[0] &lt;&lt; &quot; &quot;;

    // displays the rest of the CPU's cards (only after each turn)
    if (showCPUHand)
    {
        for (unsigned i = 1; i &lt; cards.size(); i++)
            std::cout &lt;&lt; cards[i] &lt;&lt; &quot; &quot;;
    }
}

Output during a turn...

Jamal: ($1000) (23)  [8C] [6H] [9C]
CPU1: ($1000) [AD]

...and after a turn...

Jamal: ($1000) (23)  [8C] [6H] [9C]
CPU1: ($1000) (21)  [AD] [KH]
If you want to make things more consice, you could change a few things:


Number of card printed on 2 digits:

if (totalCardsValue &lt;= 9)
    ss &lt;&lt; "(0" &lt;&lt; totalCardsValue &lt;&lt; ")  ";
else
    ss &lt;&lt; "(" &lt;&lt; totalCardsValue &lt;&lt; ")  ";


could be written

ss &lt;&lt; ((totalCardsValue &lt;= 9) ? "(0" : "(") &lt;&lt; totalCardsValue &lt;&lt; ")  ";


or 

ss &lt;&lt; "(" &lt;&lt; std::setw(2) &lt;&lt; std::setfill('0') &lt;&lt; totalCardsValue &lt;&lt; ")  ";

No need for temporary std::stringstream.
I think you could just std::cout directly without using std::stringstream ss.
Removing duplicated code: void Hand::displayPlayerHand() does the same as void Hand::displayCPUHand(true). This would probably better if you were naming this method display and calling the parameter displayAllCards or displayOnlyFirst. Also, you might want to give it a default value. 

Corresponding code for Hand.cpp is:

void Hand::display(bool displayAllCards) const 
{
    // displays the first card
    std::cout &lt;&lt; cards[0] &lt;&lt; " ";

    // displays the rest of the cards if required
    if (displayAllCards)
    {
        for (unsigned i = 1; i &lt; cards.size(); i++)
            std::cout &lt;&lt; cards[i] &lt;&lt; " ";
    }
}

Removing duplicated code: things can be changed in Player.cpp too as Player::displayCPUStats and  Player::displayPlayerStats really look alike.

Edited to finish my answer: Indeed, displayPlayerStats() is nothing but displayCPUStats(true). Here again, it might be worth changing the names of methods and variables.

Corresponding code for Player.cpp is:

void Player::displayStats(bool displayAllCards) const
{
    std::cout &lt;&lt; "\n* " &lt;&lt; name &lt;&lt; ": ";
    std::cout &lt;&lt; "($" &lt;&lt; chips &lt;&lt; ") ";

    if (displayAllCards)
    {
        std::cout &lt;&lt; ((totalCardsValue &lt;= 9) ? "(0" : "(") &lt;&lt; totalCardsValue &lt;&lt; ")  ";
    }
    playerHand[0].displayHand(displayAllCards);
}