Hello, I am currently writing a blackjack game in C++. I don't know how I can incorporate cardName function in my program.
Note: All face cards (Jack, Queen, King) count as 10.
// cardValue
// determines the value of a card for purposes of totaling a hand
// all face cards count as 10; aces count here as 1
// Parameter:
// card (input int) encoded card value 0-51
// Returns:
// an integer value in the range 1-10
// cardName
// Determines the name of a card, such as "Three of Spades"
// Parameter:
// card (input int) encoded card value 0-51
// Return Value
// a string value, obtained with the help of the assign() and
// and append() methods described in <string>
1 2 3 4 5 6 7 8 9 10
|
int cardValue(int card)
{
if (card < 9)
return card;
else if (card > 9)
return 10;
}
// Implement cardName
|