Question: Overload a unary operator for the Deck class (see Programming Exercise 3.3) whose invocation results in a Decks being shuffled. For example, if the bitwise
Overload a unary operator for the Deck class (see Programming Exercise 3.3) whose invocation results in a Decks being shuffled. For example, if the bitwise complement operator ~ is overloaded, then the code slice
shuffles d
Exercise 3.3
Implement a Deck class that represents a deck of 52 cards. The public interface should include methods to shuffle, deal, display hands, do pairwise comparisons of cards (e.g., a Queen beats a Jack), and the like. To simulate shuffling, you can use a random number generator such as the library function rand.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
