In C++, I need help
Below is the definition of a structure that represents a playing
card. The suit of the card is represented using an enum, and the
rank of the card is represented using an integer from 1 to 13,
where 1 is ace, and 11, 12, and 13 are jack, queen, king
respectively.
In the game of blackjack, ranks 2 through 10 count for the
corresponding number of points; jacks, queens, and kings count for
10 points; and an ace counts for 11 points. (In the full rules of
the game, aces can count as 1 or 11 points, but don't worry about
that complexity here.)
Write a function that takes two cards as parameters, and returns
their total points value.
enum { CLUBS, DIAMONDS, HEARTS, SPADES } Suit;
struct Card {
Suit suit;
int rank;
};
In C++, I need help Below is the definition of a structure that represents a playing card. The suit of the card is repre
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am