Question
Problem 1: Create a class of Card (private members int cardRank, string cardSuit) and create a singular list DeckOfCards of 52 nodes without repetition. Now
Problem 1: Create a class of Card (private members int cardRank, string cardSuit) and create a singular list DeckOfCards of 52 nodes without repetition. Now do a random swap using a member function and another swap member function like Problem 2 (previous homework). A random swap function can be for (int i = 0; i < 52; i++) { int r = i + rand() % (52 - i); swap(n[i], n[r]);
Problem 2. Create a circular list of 4 players in a round table and the shuffled 52 cards are distributed to each of them. Print the card received by each player. Write a class construct for this problem. Use copy constructor and overload assignment operator as necessary.
Problem 3. Play a game between two players called Matching Cardsuit where two players in a circular list alternately continue drawing card from a 52-shuffle card deck and the player having a match of card suit takes it all and starts the play by drawing card from the deck. Finally, the cards remaining without a match goes to the player, who does not have any card left to draw from the deck. Store the cards received by each player in a list and print them out. The player who has highest number of cards wins. Write C++ code of the Matching Cardsuit game. Transform this problem into a single or multiple class construct with appropriate constructor, copy constructor, overloading assignment operator and member functions.
answer these three problems in c++ language
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started